From 5be89ca9e927f495ec40944cc7a98cd4ae6850e0 Mon Sep 17 00:00:00 2001 From: Vo Hoang Huy Date: Thu, 23 May 2024 00:33:56 +0700 Subject: [PATCH] update --- dist-components/index.d.ts | 1 + dist-components/index.es.js | 1313 +++++++++++++++--------------- dist-components/index.es.js.map | 2 +- dist-components/index.umd.js | 16 +- dist-components/index.umd.js.map | 2 +- package.json | 2 +- 6 files changed, 669 insertions(+), 667 deletions(-) diff --git a/dist-components/index.d.ts b/dist-components/index.d.ts index 60ce8bb..0ca842c 100644 --- a/dist-components/index.d.ts +++ b/dist-components/index.d.ts @@ -34,6 +34,7 @@ export declare type Props = { isForPreview?: boolean; isForManager?: boolean; adminId?: string; + API_URL?: string; }; export { } diff --git a/dist-components/index.es.js b/dist-components/index.es.js index 2f342ad..e3dc04d 100644 --- a/dist-components/index.es.js +++ b/dist-components/index.es.js @@ -2,21 +2,21 @@ var vn = (t, e, r) => { if (!e.has(t)) throw TypeError("Cannot " + r); }; -var u = (t, e, r) => (vn(t, e, "read from private field"), r ? r.call(t) : e.get(t)), L = (t, e, r) => { +var u = (t, e, r) => (vn(t, e, "read from private field"), r ? r.call(t) : e.get(t)), M = (t, e, r) => { if (e.has(t)) throw TypeError("Cannot add the same private member more than once"); e instanceof WeakSet ? e.add(t) : e.set(t, r); -}, T = (t, e, r, n) => (vn(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r); +}, R = (t, e, r, n) => (vn(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r); var Lr = (t, e, r, n) => ({ set _(s) { - T(t, e, s, r); + R(t, e, s, r); }, get _() { return u(t, e, n); } }), Q = (t, e, r) => (vn(t, e, "access private method"), r); import * as we from "react"; -import Ai, { createContext as Ti, isValidElement as xt, createElement as pe, Fragment as Et, useEffect as Ye, useRef as Ae, useLayoutEffect as Na, useState as _t, memo as ja, useContext as Ri, useCallback as Hr, useMemo as Vr, forwardRef as Zn, Children as ar, cloneElement as Pi } from "react"; +import Ai, { createContext as Ri, isValidElement as xt, createElement as pe, Fragment as Et, useEffect as Ye, useRef as Ae, useLayoutEffect as Na, useState as _t, memo as ja, useContext as Ti, useCallback as Hr, useMemo as Vr, forwardRef as Zn, Children as ar, cloneElement as Pi } from "react"; import { createPortal as Da } from "react-dom"; var ut = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Ba(t) { @@ -70,17 +70,17 @@ function Fa() { var x = v && c[v] || c[_]; return typeof x == "function" ? x : null; } - var k = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; - function M(c) { + var S = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function $(c) { { for (var x = arguments.length, O = new Array(x > 1 ? x - 1 : 0), F = 1; F < x; F++) O[F - 1] = arguments[F]; - P("error", c, O); + B("error", c, O); } } - function P(c, x, O) { + function B(c, x, O) { { - var F = k.ReactDebugCurrentFrame, K = F.getStackAddendum(); + var F = S.ReactDebugCurrentFrame, K = F.getStackAddendum(); K !== "" && (x += "%s", O = O.concat([K])); var Z = O.map(function(W) { return String(W); @@ -88,16 +88,16 @@ function Fa() { Z.unshift("Warning: " + x), Function.prototype.apply.call(console[c], console, Z); } } - var q = !1, $ = !1, Y = !1, ne = !1, B = !1, G; + var N = !1, P = !1, Y = !1, ne = !1, j = !1, G; G = Symbol.for("react.module.reference"); function X(c) { - return !!(typeof c == "string" || typeof c == "function" || c === n || c === i || B || c === s || c === f || c === h || ne || c === y || q || $ || Y || typeof c == "object" && c !== null && (c.$$typeof === d || c.$$typeof === p || c.$$typeof === o || c.$$typeof === a || c.$$typeof === l || // This needs to include all possible module reference object + return !!(typeof c == "string" || typeof c == "function" || c === n || c === i || j || c === s || c === f || c === h || ne || c === y || N || P || Y || typeof c == "object" && c !== null && (c.$$typeof === d || c.$$typeof === p || c.$$typeof === o || c.$$typeof === a || c.$$typeof === l || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. c.$$typeof === G || c.getModuleId !== void 0)); } - function D(c, x, O) { + function q(c, x, O) { var F = c.displayName; if (F) return F; @@ -110,7 +110,7 @@ function Fa() { function A(c) { if (c == null) return null; - if (typeof c.tag == "number" && M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof c == "function") + if (typeof c.tag == "number" && $("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof c == "function") return c.displayName || c.name || null; if (typeof c == "string") return c; @@ -137,7 +137,7 @@ function Fa() { var O = c; return g(O._context) + ".Provider"; case l: - return D(c, c.render, "ForwardRef"); + return q(c, c.render, "ForwardRef"); case p: var F = c.displayName || null; return F !== null ? F : A(c.type) || "Memo"; @@ -152,14 +152,14 @@ function Fa() { } return null; } - var E = Object.assign, b = 0, w, C, S, N, j, V, J; + var E = Object.assign, w = 0, b, C, k, L, D, V, J; function ie() { } ie.__reactDisabledLog = !0; function ue() { { - if (b === 0) { - w = console.log, C = console.info, S = console.warn, N = console.error, j = console.group, V = console.groupCollapsed, J = console.groupEnd; + if (w === 0) { + b = console.log, C = console.info, k = console.warn, L = console.error, D = console.group, V = console.groupCollapsed, J = console.groupEnd; var c = { configurable: !0, enumerable: !0, @@ -176,12 +176,12 @@ function Fa() { groupEnd: c }); } - b++; + w++; } } function be() { { - if (b--, b === 0) { + if (w--, w === 0) { var c = { configurable: !0, enumerable: !0, @@ -189,19 +189,19 @@ function Fa() { }; Object.defineProperties(console, { log: E({}, c, { - value: w + value: b }), info: E({}, c, { value: C }), warn: E({}, c, { - value: S + value: k }), error: E({}, c, { - value: N + value: L }), group: E({}, c, { - value: j + value: D }), groupCollapsed: E({}, c, { value: V @@ -211,30 +211,30 @@ function Fa() { }) }); } - b < 0 && M("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + w < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } - var Le = k.ReactCurrentDispatcher, Te; + var Le = S.ReactCurrentDispatcher, Re; function Ne(c, x, O) { { - if (Te === void 0) + if (Re === void 0) try { throw Error(); } catch (K) { var F = K.stack.trim().match(/\n( *(at )?)/); - Te = F && F[1] || ""; + Re = F && F[1] || ""; } return ` -` + Te + c; +` + Re + c; } } - var Re = !1, le; + var Te = !1, le; { var je = typeof WeakMap == "function" ? WeakMap : Map; le = new je(); } function Ke(c, x) { - if (!c || Re) + if (!c || Te) return ""; { var O = le.get(c); @@ -242,7 +242,7 @@ function Fa() { return O; } var F; - Re = !0; + Te = !0; var K = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var Z; @@ -299,10 +299,10 @@ function Fa() { } } } finally { - Re = !1, Le.current = Z, be(), Error.prepareStackTrace = K; + Te = !1, Le.current = Z, be(), Error.prepareStackTrace = K; } - var At = c ? c.displayName || c.name : "", Rs = At ? Ne(At) : ""; - return typeof c == "function" && le.set(c, Rs), Rs; + var At = c ? c.displayName || c.name : "", Ts = At ? Ne(At) : ""; + return typeof c == "function" && le.set(c, Ts), Ts; } function Ct(c, x, O) { return Ke(c, !1); @@ -340,7 +340,7 @@ function Fa() { } return ""; } - var $r = Object.prototype.hasOwnProperty, bs = {}, vs = k.ReactDebugCurrentFrame; + var $r = Object.prototype.hasOwnProperty, bs = {}, vs = S.ReactDebugCurrentFrame; function Mr(c) { if (c) { var x = c._owner, O = Pr(c.type, c._source, x ? x.type : null); @@ -363,7 +363,7 @@ function Fa() { } catch (oe) { H = oe; } - H && !(H instanceof Error) && (Mr(K), M("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", F || "React class", O, W, typeof H), Mr(null)), H instanceof Error && !(H.message in bs) && (bs[H.message] = !0, Mr(K), M("Failed %s type: %s", O, H.message), Mr(null)); + H && !(H instanceof Error) && (Mr(K), $("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", F || "React class", O, W, typeof H), Mr(null)), H instanceof Error && !(H.message in bs) && (bs[H.message] = !0, Mr(K), $("Failed %s type: %s", O, H.message), Mr(null)); } } } @@ -389,9 +389,9 @@ function Fa() { } function xs(c) { if (ba(c)) - return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ma(c)), ws(c); + return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ma(c)), ws(c); } - var Xt = k.ReactCurrentOwner, va = { + var Xt = S.ReactCurrentOwner, va = { key: !0, ref: !0, __self: !0, @@ -417,13 +417,13 @@ function Fa() { function _a(c, x) { if (typeof c.ref == "string" && Xt.current && x && Xt.current.stateNode !== x) { var O = A(Xt.current.type); - yn[O] || (M('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(Xt.current.type), c.ref), yn[O] = !0); + yn[O] || ($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(Xt.current.type), c.ref), yn[O] = !0); } } function Ea(c, x) { { var O = function() { - _s || (_s = !0, M("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x)); + _s || (_s = !0, $("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x)); }; O.isReactWarning = !0, Object.defineProperty(c, "key", { get: O, @@ -434,7 +434,7 @@ function Fa() { function Sa(c, x) { { var O = function() { - Es || (Es = !0, M("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x)); + Es || (Es = !0, $("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x)); }; O.isReactWarning = !0, Object.defineProperty(c, "ref", { get: O, @@ -489,7 +489,7 @@ function Fa() { return ka(c, H, ye, K, F, Xt.current, W); } } - var gn = k.ReactCurrentOwner, Ss = k.ReactDebugCurrentFrame; + var gn = S.ReactCurrentOwner, Ss = S.ReactDebugCurrentFrame; function Ot(c) { if (c) { var x = c._owner, O = Pr(c.type, c._source, x ? x.type : null); @@ -548,7 +548,7 @@ Check the top-level render call using <` + O + ">."); return; Cs[O] = !0; var F = ""; - c && c._owner && c._owner !== gn.current && (F = " It was passed a child from " + A(c._owner.type) + "."), Ot(c), M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', O, F), Ot(null); + c && c._owner && c._owner !== gn.current && (F = " It was passed a child from " + A(c._owner.type) + "."), Ot(c), $('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', O, F), Ot(null); } } function As(c, x) { @@ -570,7 +570,7 @@ Check the top-level render call using <` + O + ">."); } } } - function Ta(c) { + function Ra(c) { { var x = c.type; if (x == null || typeof x == "string") @@ -590,24 +590,24 @@ Check the top-level render call using <` + O + ">."); } else if (x.PropTypes !== void 0 && !mn) { mn = !0; var K = A(x); - M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", K || "Unknown"); + $("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", K || "Unknown"); } - typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); + typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && $("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } - function Ra(c) { + function Ta(c) { { for (var x = Object.keys(c.props), O = 0; O < x.length; O++) { var F = x[O]; if (F !== "children" && F !== "key") { - Ot(c), M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", F), Ot(null); + Ot(c), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", F), Ot(null); break; } } - c.ref !== null && (Ot(c), M("Invalid attribute `ref` supplied to `React.Fragment`."), Ot(null)); + c.ref !== null && (Ot(c), $("Invalid attribute `ref` supplied to `React.Fragment`."), Ot(null)); } } - function Ts(c, x, O, F, K, Z) { + function Rs(c, x, O, F, K, Z) { { var W = X(c); if (!W) { @@ -616,7 +616,7 @@ Check the top-level render call using <` + O + ">."); var ye = Oa(K); ye ? H += ye : H += ks(); var oe; - c === null ? oe = "null" : pn(c) ? oe = "array" : c !== void 0 && c.$$typeof === e ? (oe = "<" + (A(c.type) || "Unknown") + " />", H = " Did you accidentally export a JSX literal instead of a component?") : oe = typeof c, M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", oe, H); + c === null ? oe = "null" : pn(c) ? oe = "array" : c !== void 0 && c.$$typeof === e ? (oe = "<" + (A(c.type) || "Unknown") + " />", H = " Did you accidentally export a JSX literal instead of a component?") : oe = typeof c, $("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", oe, H); } var ae = Ca(c, x, O, K, Z); if (ae == null) @@ -630,25 +630,25 @@ Check the top-level render call using <` + O + ">."); As(_e[At], c); Object.freeze && Object.freeze(_e); } else - M("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); + $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else As(_e, c); } - return c === n ? Ra(ae) : Ta(ae), ae; + return c === n ? Ta(ae) : Ra(ae), ae; } } function Pa(c, x, O) { - return Ts(c, x, O, !0); + return Rs(c, x, O, !0); } function $a(c, x, O) { - return Ts(c, x, O, !1); + return Rs(c, x, O, !1); } var Ma = $a, La = Pa; Zt.Fragment = n, Zt.jsx = Ma, Zt.jsxs = La; }()), Zt; } process.env.NODE_ENV === "production" ? kn.exports = Ia() : kn.exports = Fa(); -var R = kn.exports; +var T = kn.exports; const $i = Object, rn = Map, Or = Set, es = Or.prototype.has, Ua = Or.prototype.add, Kr = rn.prototype.has, Ms = rn.prototype.get, nn = rn.prototype.set, $t = 1, Cn = 2, cr = 4, Gr = 8, qa = 16, Ha = 32, Ge = "__t", Ls = "__p", On = "__e", Va = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Qa = "http://www.w3.org/1999/xlink", za = "http://www.w3.org/2000/xmlns/", Wa = 120, Ya = new Or(["href", "list", "form", "tabIndex", "download"]), Ka = new Or(["area", "base", "basefont", "bgsound", "br", "col", "command", "embed", "frame", "hr", "image", "img", "input", "isindex", "keygen", "link", "menuitem", "meta", "nextid", "param", "source", "track", "wbr"]); if (typeof window > "u") throw new Error( @@ -1019,47 +1019,47 @@ class Bi extends lr { y = r[--f]; continue; } - const m = p.k, k = d.k; - if (m === k) { - Rt.call(p, d), n[l] = p, p = r[++a], d = n[++l]; + const m = p.k, S = d.k; + if (m === S) { + Tt.call(p, d), n[l] = p, p = r[++a], d = n[++l]; continue; } - const M = y.k, P = v.k; - if (M === P) { - Rt.call(y, v), n[h] = y, y = r[--f], v = n[--h]; + const $ = y.k, B = v.k; + if ($ === B) { + Tt.call(y, v), n[h] = y, y = r[--f], v = n[--h]; continue; } - if (m === P) { - Rt.call(p, v), n[h] = p; - const $ = n[h + 1]; - wn.call(p, $, ($ == null ? void 0 : $.l) || null), p = r[++a], v = n[--h]; + if (m === B) { + Tt.call(p, v), n[h] = p; + const P = n[h + 1]; + wn.call(p, P, (P == null ? void 0 : P.l) || null), p = r[++a], v = n[--h]; continue; } - if (M === k) { - Rt.call(y, d), n[l] = y; - const $ = r[a]; - wn.call(y, $, ($ == null ? void 0 : $.l) || null), y = r[--f], d = n[++l]; + if ($ === S) { + Tt.call(y, d), n[l] = y; + const P = r[a]; + wn.call(y, P, (P == null ? void 0 : P.l) || null), y = r[--f], d = n[++l]; continue; } if (!_) { _ = new rn(); - for (let $ = a; $ <= f; $++) - nn.call(_, r[$].k, $); + for (let P = a; P <= f; P++) + nn.call(_, r[P].k, P); } - const q = _.get(k); - if (q === void 0) + const N = _.get(S); + if (N === void 0) Mt.call(d, o, p.l || null); else { - const $ = r[q]; - wn.call($, p, null), Rt.call($, d), n[l] = $, r[q] = null; + const P = r[N]; + wn.call(P, p, null), Tt.call(P, d), n[l] = P, r[N] = null; } d = n[++l]; } if (a <= f || l <= h) if (a > f) { const m = n[h + 1]; - for (let k = l; k <= h; ++k) - Mt.call(n[k], o, m ? m.l : null); + for (let S = l; S <= h; ++S) + Mt.call(n[S], o, m ? m.l : null); } else for (let m = a; m <= f; ++m) Xr.call(r[m]); @@ -1117,7 +1117,7 @@ const ts = Bi.prototype, Ii = ts.m, Fi = ts.p, fc = ts.x, dc = new Proxy( ); }, pc = (t, e) => { if (("b" in t || "b" in e) && Fi.call(t, e), t.l || Mt.call(t, void 0, null, null), t.k && t.k === e.k || t.r === e.r) - return Rt.call(t, e); + return Tt.call(t, e); const r = Mt.call(e, t.t(), t.l, null); return Xr.call(t), t.k = e.k, r; }; @@ -1137,17 +1137,17 @@ class qi extends lr { const _ = h.e[y], m = this.d[_.h]; if (_.t & $t) { if (m instanceof lr) { - const k = lt(p, _.i); - n ? m.m(p, k, k) : m.m(p, k); + const S = lt(p, _.i); + n ? m.m(p, S, S) : m.m(p, S); continue; } if (p[Ge] || (p[Ge] = new Array(v)), m && typeof m == "object" && "foreign" in m) { if (n) { - const M = lt(p, _.i); - m.reset(M); + const $ = lt(p, _.i); + m.reset($); } - const k = m.current; - p[Ge][y] = k, n || Qr.call(p, k, lt(p, _.i)); + const S = m.current; + p[Ge][y] = S, n || Qr.call(p, S, lt(p, _.i)); continue; } if (n) { @@ -1161,16 +1161,16 @@ class qi extends lr { _.i ); } else if (_.t & cr) { - const k = Bs(p, _.n, m); - p[Ls + _.n] = k; + const S = Bs(p, _.n, m); + p[Ls + _.n] = S; } else if (_.t & Cn) qs(p, _.n, m); else if (_.t & Gr) if (typeof m == "string" || typeof m == "number") Nr(p, _.n, m); else - for (const k in m) - Nr(p, k, m[k]); + for (const S in m) + Nr(p, S, m[S]); else Us(p, _.n, m); } @@ -1273,12 +1273,12 @@ const Vs = (t, e, r, n) => { e = lt(e, a); } return i && (r[n] = e), e; -}, Ar = qi.prototype, Mt = Ar.m, Rt = Ar.p, wn = Ar.v, Xr = Ar.x, yc = Ar.u, gc = { +}, Ar = qi.prototype, Mt = Ar.m, Tt = Ar.p, wn = Ar.v, Xr = Ar.x, yc = Ar.u, gc = { noSlot: !1 }, an = "slot", Hi = "g", mc = ({ effect: t, deps: e -}) => (Ye(t, e || []), null), Me = /* @__PURE__ */ new Map(), bc = Ti(!1), vc = (t, e, r) => { +}) => (Ye(t, e || []), null), Me = /* @__PURE__ */ new Map(), bc = Ri(!1), vc = (t, e, r) => { const n = { ref: e }; let s = 0; for (const i in t) { @@ -1338,23 +1338,23 @@ const Vs = (t, e, r, n) => { const r = { ...t.props }; "css" in r && "__EMOTION_TYPE_PLEASE_DO_NOT_USE__" in r && (r.style = r.css.styles, e = r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__, delete r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__, delete r.css); const n = (s = t.props) == null ? void 0 : s.children; - return n != null && (r.children = Tn(t.props.children).map( + return n != null && (r.children = Rn(t.props.children).map( (i) => An(i) )), { type: e, // lets pretend no function go through props: r }; -}, Tn = (t) => { +}, Rn = (t) => { if (t == null) return []; if (typeof t == "object" && "type" in t && t.type === Et) - return Tn(t.props.children); + return Rn(t.props.children); if (!Array.isArray(t) || typeof t == "object" && "$" in t) return [t]; const e = t.flat(1 / 0), r = []; for (let n = 0, s = e.length; n < s; ++n) - r.push(...Tn(e[n])); + r.push(...Rn(e[n])); return r; }, Vi = typeof window > "u" ? Ye : Na; function ns(t, e, r) { @@ -1413,21 +1413,21 @@ const zi = (t, e = {}) => { e == null ? void 0 : e.svg )); const i = (o, a) => { - var P, q; + var B, N; const l = xc(), f = wc(), h = o._hmr, p = Ae(null), d = Ae(null), y = Ae([]); - o = vc(o, a, y.current), (P = d.current) == null || P.call(d, o); + o = vc(o, a, y.current), (B = d.current) == null || B.call(d, o); const v = Hr(() => { - var Y, ne, B; + var Y, ne, j; if (!p.current && !r) return; - const $ = n(o, o.key); - return h && ((Y = p.current) != null && Y.textContent) && (p.current.textContent = ""), r && (p.current = ((ne = f.current) == null ? void 0 : ne.el) ?? ((B = l.current) == null ? void 0 : B.el), (o.scoped || f.current && l.current && f.current.depth > l.current.depth) && (p.current = l.current.el), p.current.childNodes.length && console.error( + const P = n(o, o.key); + return h && ((Y = p.current) != null && Y.textContent) && (p.current.textContent = ""), r && (p.current = ((ne = f.current) == null ? void 0 : ne.el) ?? ((j = l.current) == null ? void 0 : j.el), (o.scoped || f.current && l.current && f.current.depth > l.current.depth) && (p.current = l.current.el), p.current.childNodes.length && console.error( new Error(`\`experimental_options.noSlot\` does not support having siblings at the moment. The block element should be the only child of the \`${Li.call(p.current).outerHTML}\` element. To avoid this error, \`experimental_options.noSlot\` should be false`) - )), (d.current === null || h) && (Mt.call($, p.current, null), d.current = (G) => { + )), (d.current === null || h) && (Mt.call(P, p.current, null), d.current = (G) => { pc( - $, + P, n( G, G.key, @@ -1435,11 +1435,11 @@ To avoid this error, \`experimental_options.noSlot\` should be false`) ) ); }), () => { - Xr.call($); + Xr.call(P); }; - }, []), _ = Vr(() => r ? null : pe((e == null ? void 0 : e.as) ?? s, { ref: p }), []), m = y.current.length, k = new Array(m); - for (let $ = 0; $ < m; ++$) - k[$] = (q = y.current[$]) == null ? void 0 : q.portal; + }, []), _ = Vr(() => r ? null : pe((e == null ? void 0 : e.as) ?? s, { ref: p }), []), m = y.current.length, S = new Array(m); + for (let P = 0; P < m; ++P) + S[P] = (N = y.current[P]) == null ? void 0 : N.portal; return pe( Et, {}, @@ -1448,7 +1448,7 @@ To avoid this error, \`experimental_options.noSlot\` should be false`) effect: v, deps: h ? [h] : [] }), - k + S ); }; return Kr.call(Me, i) || nn.call(Me, i, zi), e != null && e.name && (t && (t.displayName = `Million(Render(${e.name}))`), i.displayName = `Million(Block(${e.name}))`), i; @@ -1539,7 +1539,7 @@ function cn(t, { portals: e, ...r }) { name: n, shouldUpdate: kc }), i = (e == null ? void 0 : e.length) || 0, o = e && i > 0 ? (a) => { - const l = Ri(bc), [f] = _t(() => []), h = { ...a, scoped: l }; + const l = Ti(bc), [f] = _t(() => []), h = { ...a, scoped: l }; for (let d = 0; d < i; d++) { const y = e[d], v = rs( h[y], @@ -1569,8 +1569,8 @@ const er = { TYPING: "typing", STOP_TYPING: "stop-typing", AGENT_MESSAGE: "agent-message" -}, zs = "user-bot-id", Rn = "https://api.dialoguebot.tech"; -console.log("API_URL", Rn); +}, zs = "user-bot-id", Tn = "https://api.dialoguebot.tech"; +console.log("API_URL", Tn); var at = {}, te = {}, fe = {}; Object.defineProperty(fe, "__esModule", { value: !0 }); fe.output = fe.exists = fe.hash = fe.bytes = fe.bool = fe.number = fe.isBytes = void 0; @@ -1755,61 +1755,61 @@ ln.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis const A = g.length, E = A / 2; if (A % 2) throw new Error("padded hex string expected, got unpadded hex of length " + A); - const b = new Uint8Array(E); - for (let w = 0, C = 0; w < E; w++, C += 2) { - const S = v(g.charCodeAt(C)), N = v(g.charCodeAt(C + 1)); - if (S === void 0 || N === void 0) { - const j = g[C] + g[C + 1]; - throw new Error('hex string expected, got non-hex character "' + j + '" at index ' + C); + const w = new Uint8Array(E); + for (let b = 0, C = 0; b < E; b++, C += 2) { + const k = v(g.charCodeAt(C)), L = v(g.charCodeAt(C + 1)); + if (k === void 0 || L === void 0) { + const D = g[C] + g[C + 1]; + throw new Error('hex string expected, got non-hex character "' + D + '" at index ' + C); } - b[w] = S * 16 + N; + w[b] = k * 16 + L; } - return b; + return w; } t.hexToBytes = _; const m = async () => { }; t.nextTick = m; - async function k(g, A, E) { - let b = Date.now(); - for (let w = 0; w < g; w++) { - E(w); - const C = Date.now() - b; - C >= 0 && C < A || (await (0, t.nextTick)(), b += C); + async function S(g, A, E) { + let w = Date.now(); + for (let b = 0; b < g; b++) { + E(b); + const C = Date.now() - w; + C >= 0 && C < A || (await (0, t.nextTick)(), w += C); } } - t.asyncLoop = k; - function M(g) { + t.asyncLoop = S; + function $(g) { if (typeof g != "string") throw new Error(`utf8ToBytes expected string, got ${typeof g}`); return new Uint8Array(new TextEncoder().encode(g)); } - t.utf8ToBytes = M; - function P(g) { - return typeof g == "string" && (g = M(g)), (0, r.bytes)(g), g; + t.utf8ToBytes = $; + function B(g) { + return typeof g == "string" && (g = $(g)), (0, r.bytes)(g), g; } - t.toBytes = P; - function q(...g) { + t.toBytes = B; + function N(...g) { let A = 0; - for (let b = 0; b < g.length; b++) { - const w = g[b]; - (0, r.bytes)(w), A += w.length; + for (let w = 0; w < g.length; w++) { + const b = g[w]; + (0, r.bytes)(b), A += b.length; } const E = new Uint8Array(A); - for (let b = 0, w = 0; b < g.length; b++) { - const C = g[b]; - E.set(C, w), w += C.length; + for (let w = 0, b = 0; w < g.length; w++) { + const C = g[w]; + E.set(C, b), b += C.length; } return E; } - t.concatBytes = q; - class $ { + t.concatBytes = N; + class P { // Safe version that clones internal state clone() { return this._cloneInto(); } } - t.Hash = $; + t.Hash = P; const Y = {}.toString; function ne(g, A) { if (A !== void 0 && Y.call(A) !== "[object Object]") @@ -1817,36 +1817,36 @@ ln.crypto = typeof globalThis == "object" && "crypto" in globalThis ? globalThis return Object.assign(g, A); } t.checkOpts = ne; - function B(g) { - const A = (b) => g().update(P(b)).digest(), E = g(); + function j(g) { + const A = (w) => g().update(B(w)).digest(), E = g(); return A.outputLen = E.outputLen, A.blockLen = E.blockLen, A.create = () => g(), A; } - t.wrapConstructor = B; + t.wrapConstructor = j; function G(g) { - const A = (b, w) => g(w).update(P(b)).digest(), E = g({}); - return A.outputLen = E.outputLen, A.blockLen = E.blockLen, A.create = (b) => g(b), A; + const A = (w, b) => g(b).update(B(w)).digest(), E = g({}); + return A.outputLen = E.outputLen, A.blockLen = E.blockLen, A.create = (w) => g(w), A; } t.wrapConstructorWithOpts = G; function X(g) { - const A = (b, w) => g(w).update(P(b)).digest(), E = g({}); - return A.outputLen = E.outputLen, A.blockLen = E.blockLen, A.create = (b) => g(b), A; + const A = (w, b) => g(b).update(B(w)).digest(), E = g({}); + return A.outputLen = E.outputLen, A.blockLen = E.blockLen, A.create = (w) => g(w), A; } t.wrapXOFConstructorWithOpts = X; - function D(g = 32) { + function q(g = 32) { if (e.crypto && typeof e.crypto.getRandomValues == "function") return e.crypto.getRandomValues(new Uint8Array(g)); throw new Error("crypto.getRandomValues must be defined"); } - t.randomBytes = D; + t.randomBytes = q; })(wo); Object.defineProperty(te, "__esModule", { value: !0 }); te.shake256 = te.shake128 = te.keccak_512 = te.keccak_384 = te.keccak_256 = te.keccak_224 = te.sha3_512 = te.sha3_384 = te.sha3_256 = te.sha3_224 = te.Keccak = te.keccakP = void 0; -const Tt = fe, hr = I, We = wo, xo = [], _o = [], Eo = [], Ac = /* @__PURE__ */ BigInt(0), tr = /* @__PURE__ */ BigInt(1), Tc = /* @__PURE__ */ BigInt(2), Rc = /* @__PURE__ */ BigInt(7), Pc = /* @__PURE__ */ BigInt(256), $c = /* @__PURE__ */ BigInt(113); +const Rt = fe, hr = I, We = wo, xo = [], _o = [], Eo = [], Ac = /* @__PURE__ */ BigInt(0), tr = /* @__PURE__ */ BigInt(1), Rc = /* @__PURE__ */ BigInt(2), Tc = /* @__PURE__ */ BigInt(7), Pc = /* @__PURE__ */ BigInt(256), $c = /* @__PURE__ */ BigInt(113); for (let t = 0, e = tr, r = 1, n = 0; t < 24; t++) { [r, n] = [n, (2 * r + 3 * n) % 5], xo.push(2 * (5 * n + r)), _o.push((t + 1) * (t + 2) / 2 % 64); let s = Ac; for (let i = 0; i < 7; i++) - e = (e << tr ^ (e >> Rc) * $c) % Pc, e & Tc && (s ^= tr << (tr << /* @__PURE__ */ BigInt(i)) - tr); + e = (e << tr ^ (e >> Tc) * $c) % Pc, e & Rc && (s ^= tr << (tr << /* @__PURE__ */ BigInt(i)) - tr); Eo.push(s); } const [Mc, Lc] = /* @__PURE__ */ (0, hr.split)(Eo, !0), Ws = (t, e, r) => r > 32 ? (0, hr.rotlBH)(t, e, r) : (0, hr.rotlSH)(t, e, r), Ys = (t, e, r) => r > 32 ? (0, hr.rotlBL)(t, e, r) : (0, hr.rotlSL)(t, e, r); @@ -1876,10 +1876,10 @@ function So(t, e = 24) { r.fill(0); } te.keccakP = So; -class Tr extends We.Hash { +class Rr extends We.Hash { // NOTE: we accept arguments in bytes instead of bits here. constructor(e, r, n, s = !1, i = 24) { - if (super(), this.blockLen = e, this.suffix = r, this.outputLen = n, this.enableXOF = s, this.rounds = i, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, (0, Tt.number)(n), 0 >= this.blockLen || this.blockLen >= 200) + if (super(), this.blockLen = e, this.suffix = r, this.outputLen = n, this.enableXOF = s, this.rounds = i, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, (0, Rt.number)(n), 0 >= this.blockLen || this.blockLen >= 200) throw new Error("Sha3 supports only keccak-f1600 function"); this.state = new Uint8Array(200), this.state32 = (0, We.u32)(this.state); } @@ -1887,7 +1887,7 @@ class Tr extends We.Hash { We.isLE || (0, We.byteSwap32)(this.state32), So(this.state32, this.rounds), We.isLE || (0, We.byteSwap32)(this.state32), this.posOut = 0, this.pos = 0; } update(e) { - (0, Tt.exists)(this); + (0, Rt.exists)(this); const { blockLen: r, state: n } = this; e = (0, We.toBytes)(e); const s = e.length; @@ -1907,7 +1907,7 @@ class Tr extends We.Hash { e[n] ^= r, r & 128 && n === s - 1 && this.keccak(), e[s - 1] ^= 128, this.keccak(); } writeInto(e) { - (0, Tt.exists)(this, !1), (0, Tt.bytes)(e), this.finish(); + (0, Rt.exists)(this, !1), (0, Rt.bytes)(e), this.finish(); const r = this.state, { blockLen: n } = this; for (let s = 0, i = e.length; s < i; ) { this.posOut >= n && this.keccak(); @@ -1922,10 +1922,10 @@ class Tr extends We.Hash { return this.writeInto(e); } xof(e) { - return (0, Tt.number)(e), this.xofInto(new Uint8Array(e)); + return (0, Rt.number)(e), this.xofInto(new Uint8Array(e)); } digestInto(e) { - if ((0, Tt.output)(e, this), this.finished) + if ((0, Rt.output)(e, this), this.finished) throw new Error("digest() was already called"); return this.writeInto(e), this.destroy(), e; } @@ -1937,11 +1937,11 @@ class Tr extends We.Hash { } _cloneInto(e) { const { blockLen: r, suffix: n, outputLen: s, rounds: i, enableXOF: o } = this; - return e || (e = new Tr(r, n, s, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = n, e.outputLen = s, e.enableXOF = o, e.destroyed = this.destroyed, e; + return e || (e = new Rr(r, n, s, o, i)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = i, e.suffix = n, e.outputLen = s, e.enableXOF = o, e.destroyed = this.destroyed, e; } } -te.Keccak = Tr; -const ct = (t, e, r) => (0, We.wrapConstructor)(() => new Tr(e, t, r)); +te.Keccak = Rr; +const ct = (t, e, r) => (0, We.wrapConstructor)(() => new Rr(e, t, r)); te.sha3_224 = ct(6, 144, 224 / 8); te.sha3_256 = ct(6, 136, 256 / 8); te.sha3_384 = ct(6, 104, 384 / 8); @@ -1950,7 +1950,7 @@ te.keccak_224 = ct(1, 144, 224 / 8); te.keccak_256 = ct(1, 136, 256 / 8); te.keccak_384 = ct(1, 104, 384 / 8); te.keccak_512 = ct(1, 72, 512 / 8); -const ko = (t, e, r) => (0, We.wrapXOFConstructorWithOpts)((n = {}) => new Tr(e, t, n.dkLen === void 0 ? r : n.dkLen, !0)); +const ko = (t, e, r) => (0, We.wrapXOFConstructorWithOpts)((n = {}) => new Rr(e, t, n.dkLen === void 0 ? r : n.dkLen, !0)); te.shake128 = ko(31, 168, 128 / 8); te.shake256 = ko(31, 136, 256 / 8); const { sha3_512: Nc } = te, Co = 24, ur = 32, $n = (t = 4, e = Math.random) => { @@ -1970,20 +1970,20 @@ function Oo(t) { const Ao = (t = "") => Oo(Nc(t)).toString(36).slice(1), Ks = Array.from( { length: 26 }, (t, e) => String.fromCharCode(e + 97) -), jc = (t) => Ks[Math.floor(t() * Ks.length)], To = ({ +), jc = (t) => Ks[Math.floor(t() * Ks.length)], Ro = ({ globalObj: t = typeof ut < "u" ? ut : typeof window < "u" ? window : {}, random: e = Math.random } = {}) => { const r = Object.keys(t).toString(), n = r.length ? r + $n(ur, e) : $n(ur, e); return Ao(n).substring(0, ur); -}, Ro = (t) => () => t++, Dc = 476782367, Po = ({ +}, To = (t) => () => t++, Dc = 476782367, Po = ({ // Fallback if the user does not pass in a CSPRNG. This should be OK // because we don't rely solely on the random number generator for entropy. // We also use the host fingerprint, current time, and a session counter. random: t = Math.random, - counter: e = Ro(Math.floor(t() * Dc)), + counter: e = To(Math.floor(t() * Dc)), length: r = Co, - fingerprint: n = To({ random: t }) + fingerprint: n = Ro({ random: t }) } = {}) => function() { const i = jc(t), o = Date.now().toString(36), a = e().toString(36), l = $n(r, t), f = `${o + l + a + n}`; return `${i + Ao(f).substring(1, r)}`; @@ -2000,8 +2000,8 @@ at.getConstants = () => ({ defaultLength: Co, bigLength: ur }); at.init = Po; at.createId = Bc; at.bufToBigInt = Oo; -at.createCounter = Ro; -at.createFingerprint = To; +at.createCounter = To; +at.createFingerprint = Ro; at.isCuid = Ic; const { createId: Fc, init: Sh, getConstants: kh, isCuid: Ch } = at; var Uc = Fc; @@ -2045,7 +2045,7 @@ const Ee = () => { l: Math.round(f * 100) }; }; -var Rr = class { +var Tr = class { constructor() { this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this); } @@ -2175,13 +2175,13 @@ function Qc(t, e, r = 0) { const n = [e, ...t]; return r && n.length > r ? n.slice(0, -1) : n; } -var pr = Symbol(), dt, et, Lt, vi, zc = (vi = class extends Rr { +var pr = Symbol(), dt, et, Lt, vi, zc = (vi = class extends Tr { constructor() { super(); - L(this, dt, void 0); - L(this, et, void 0); - L(this, Lt, void 0); - T(this, Lt, (e) => { + M(this, dt, void 0); + M(this, et, void 0); + M(this, Lt, void 0); + R(this, Lt, (e) => { if (!Yt && window.addEventListener) { const r = () => e(); return window.addEventListener("visibilitychange", r, !1), () => { @@ -2195,16 +2195,16 @@ var pr = Symbol(), dt, et, Lt, vi, zc = (vi = class extends Rr { } onUnsubscribe() { var e; - this.hasListeners() || ((e = u(this, et)) == null || e.call(this), T(this, et, void 0)); + this.hasListeners() || ((e = u(this, et)) == null || e.call(this), R(this, et, void 0)); } setEventListener(e) { var r; - T(this, Lt, e), (r = u(this, et)) == null || r.call(this), T(this, et, e((n) => { + R(this, Lt, e), (r = u(this, et)) == null || r.call(this), R(this, et, e((n) => { typeof n == "boolean" ? this.setFocused(n) : this.onFocus(); })); } setFocused(e) { - u(this, dt) !== e && (T(this, dt, e), this.onFocus()); + u(this, dt) !== e && (R(this, dt, e), this.onFocus()); } onFocus() { const e = this.isFocused(); @@ -2216,13 +2216,13 @@ var pr = Symbol(), dt, et, Lt, vi, zc = (vi = class extends Rr { var e; return typeof u(this, dt) == "boolean" ? u(this, dt) : ((e = globalThis.document) == null ? void 0 : e.visibilityState) !== "hidden"; } -}, dt = new WeakMap(), et = new WeakMap(), Lt = new WeakMap(), vi), cs = new zc(), Nt, tt, jt, wi, Wc = (wi = class extends Rr { +}, dt = new WeakMap(), et = new WeakMap(), Lt = new WeakMap(), vi), cs = new zc(), Nt, tt, jt, wi, Wc = (wi = class extends Tr { constructor() { super(); - L(this, Nt, !0); - L(this, tt, void 0); - L(this, jt, void 0); - T(this, jt, (e) => { + M(this, Nt, !0); + M(this, tt, void 0); + M(this, jt, void 0); + R(this, jt, (e) => { if (!Yt && window.addEventListener) { const r = () => e(!0), n = () => e(!1); return window.addEventListener("online", r, !1), window.addEventListener("offline", n, !1), () => { @@ -2236,14 +2236,14 @@ var pr = Symbol(), dt, et, Lt, vi, zc = (vi = class extends Rr { } onUnsubscribe() { var e; - this.hasListeners() || ((e = u(this, tt)) == null || e.call(this), T(this, tt, void 0)); + this.hasListeners() || ((e = u(this, tt)) == null || e.call(this), R(this, tt, void 0)); } setEventListener(e) { var r; - T(this, jt, e), (r = u(this, tt)) == null || r.call(this), T(this, tt, e(this.setOnline.bind(this))); + R(this, jt, e), (r = u(this, tt)) == null || r.call(this), R(this, tt, e(this.setOnline.bind(this))); } setOnline(e) { - u(this, Nt) !== e && (T(this, Nt, e), this.listeners.forEach((n) => { + u(this, Nt) !== e && (R(this, Nt, e), this.listeners.forEach((n) => { n(e); })); } @@ -2267,27 +2267,27 @@ function _n(t) { } function jo(t) { let e = !1, r = 0, n = !1, s, i, o; - const a = new Promise((m, k) => { - i = m, o = k; + const a = new Promise((m, S) => { + i = m, o = S; }), l = (m) => { - var k; - n || (y(new No(m)), (k = t.abort) == null || k.call(t)); + var S; + n || (y(new No(m)), (S = t.abort) == null || S.call(t)); }, f = () => { e = !0; }, h = () => { e = !1; }, p = () => !cs.isFocused() || t.networkMode !== "always" && !Zr.isOnline(), d = (m) => { - var k; - n || (n = !0, (k = t.onSuccess) == null || k.call(t, m), s == null || s(), i(m)); + var S; + n || (n = !0, (S = t.onSuccess) == null || S.call(t, m), s == null || s(), i(m)); }, y = (m) => { - var k; - n || (n = !0, (k = t.onError) == null || k.call(t, m), s == null || s(), o(m)); + var S; + n || (n = !0, (S = t.onError) == null || S.call(t, m), s == null || s(), o(m)); }, v = () => new Promise((m) => { - var k; - s = (M) => { - const P = n || !p(); - return P && m(M), P; - }, (k = t.onPause) == null || k.call(t); + var S; + s = ($) => { + const B = n || !p(); + return B && m($), B; + }, (S = t.onPause) == null || S.call(t); }).then(() => { var m; s = void 0, n || (m = t.onContinue) == null || m.call(t); @@ -2297,23 +2297,23 @@ function jo(t) { let m; try { m = t.fn(); - } catch (k) { - m = Promise.reject(k); + } catch (S) { + m = Promise.reject(S); } - Promise.resolve(m).then(d).catch((k) => { + Promise.resolve(m).then(d).catch((S) => { var Y; if (n) return; - const M = t.retry ?? (Yt ? 0 : 3), P = t.retryDelay ?? Yc, q = typeof P == "function" ? P(r, k) : P, $ = M === !0 || typeof M == "number" && r < M || typeof M == "function" && M(r, k); - if (e || !$) { - y(k); + const $ = t.retry ?? (Yt ? 0 : 3), B = t.retryDelay ?? Yc, N = typeof B == "function" ? B(r, S) : B, P = $ === !0 || typeof $ == "number" && r < $ || typeof $ == "function" && $(r, S); + if (e || !P) { + y(S); return; } - r++, (Y = t.onFail) == null || Y.call(t, r, k), Hc(q).then(() => { + r++, (Y = t.onFail) == null || Y.call(t, r, S), Hc(N).then(() => { if (p()) return v(); }).then(() => { - e ? y(k) : _(); + e ? y(S) : _(); }); }); }; @@ -2375,13 +2375,13 @@ function Kc() { } var de = Kc(), pt, xi, Do = (xi = class { constructor() { - L(this, pt, void 0); + M(this, pt, void 0); } destroy() { this.clearGcTimeout(); } scheduleGc() { - this.clearGcTimeout(), Mn(this.gcTime) && T(this, pt, setTimeout(() => { + this.clearGcTimeout(), Mn(this.gcTime) && R(this, pt, setTimeout(() => { this.optionalRemove(); }, this.gcTime)); } @@ -2392,20 +2392,20 @@ var de = Kc(), pt, xi, Do = (xi = class { ); } clearGcTimeout() { - u(this, pt) && (clearTimeout(u(this, pt)), T(this, pt, void 0)); + u(this, pt) && (clearTimeout(u(this, pt)), R(this, pt, void 0)); } }, pt = new WeakMap(), xi), Dt, Bt, Se, ge, he, yr, yt, Pe, ze, _i, Gc = (_i = class extends Do { constructor(e) { super(); - L(this, Pe); - L(this, Dt, void 0); - L(this, Bt, void 0); - L(this, Se, void 0); - L(this, ge, void 0); - L(this, he, void 0); - L(this, yr, void 0); - L(this, yt, void 0); - T(this, yt, !1), T(this, yr, e.defaultOptions), this.setOptions(e.options), T(this, he, []), T(this, Se, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, T(this, Dt, e.state || Xc(this.options)), this.state = u(this, Dt), this.scheduleGc(); + M(this, Pe); + M(this, Dt, void 0); + M(this, Bt, void 0); + M(this, Se, void 0); + M(this, ge, void 0); + M(this, he, void 0); + M(this, yr, void 0); + M(this, yt, void 0); + R(this, yt, !1), R(this, yr, e.defaultOptions), this.setOptions(e.options), R(this, he, []), R(this, Se, e.cache), this.queryKey = e.queryKey, this.queryHash = e.queryHash, R(this, Dt, e.state || Xc(this.options)), this.state = u(this, Dt), this.scheduleGc(); } get meta() { return this.options.meta; @@ -2469,7 +2469,7 @@ var de = Kc(), pt, xi, Do = (xi = class { u(this, he).includes(e) || (u(this, he).push(e), this.clearGcTimeout(), u(this, Se).notify({ type: "observerAdded", query: this, observer: e })); } removeObserver(e) { - u(this, he).includes(e) && (T(this, he, u(this, he).filter((r) => r !== e)), u(this, he).length || (u(this, ge) && (u(this, yt) ? u(this, ge).cancel({ revert: !0 }) : u(this, ge).cancelRetry()), this.scheduleGc()), u(this, Se).notify({ type: "observerRemoved", query: this, observer: e })); + u(this, he).includes(e) && (R(this, he, u(this, he).filter((r) => r !== e)), u(this, he).length || (u(this, ge) && (u(this, yt) ? u(this, ge).cancel({ revert: !0 }) : u(this, ge).cancelRetry()), this.scheduleGc()), u(this, Se).notify({ type: "observerRemoved", query: this, observer: e })); } getObserversCount() { return u(this, he).length; @@ -2498,7 +2498,7 @@ var de = Kc(), pt, xi, Do = (xi = class { }, i = (d) => { Object.defineProperty(d, "signal", { enumerable: !0, - get: () => (T(this, yt, !0), n.signal) + get: () => (R(this, yt, !0), n.signal) }); }; i(s); @@ -2506,7 +2506,7 @@ var de = Kc(), pt, xi, Do = (xi = class { `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'` ), !this.options.queryFn || this.options.queryFn === pr ? Promise.reject( new Error(`Missing queryFn: '${this.options.queryHash}'`) - ) : (T(this, yt, !1), this.options.persister ? this.options.persister( + ) : (R(this, yt, !1), this.options.persister ? this.options.persister( this.options.queryFn, s, this @@ -2522,7 +2522,7 @@ var de = Kc(), pt, xi, Do = (xi = class { i(a), (f = this.options.behavior) == null || f.onFetch( a, this - ), T(this, Bt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((h = a.fetchOptions) == null ? void 0 : h.meta)) && Q(this, Pe, ze).call(this, { type: "fetch", meta: (p = a.fetchOptions) == null ? void 0 : p.meta }); + ), R(this, Bt, this.state), (this.state.fetchStatus === "idle" || this.state.fetchMeta !== ((h = a.fetchOptions) == null ? void 0 : h.meta)) && Q(this, Pe, ze).call(this, { type: "fetch", meta: (p = a.fetchOptions) == null ? void 0 : p.meta }); const l = (d) => { var y, v, _, m; _n(d) && d.silent || Q(this, Pe, ze).call(this, { @@ -2539,7 +2539,7 @@ var de = Kc(), pt, xi, Do = (xi = class { this )), this.isFetchingOptimistic || this.scheduleGc(), this.isFetchingOptimistic = !1; }; - return T(this, ge, jo({ + return R(this, ge, jo({ fn: a.fetchFn, abort: n.abort.bind(n), onSuccess: (d) => { @@ -2670,11 +2670,11 @@ function Xc(t) { fetchStatus: "idle" }; } -var De, Ei, Jc = (Ei = class extends Rr { +var De, Ei, Jc = (Ei = class extends Tr { constructor(e = {}) { super(); - L(this, De, void 0); - this.config = e, T(this, De, /* @__PURE__ */ new Map()); + M(this, De, void 0); + this.config = e, R(this, De, /* @__PURE__ */ new Map()); } build(e, r, n) { const s = r.queryKey, i = r.queryHash ?? as(s, r); @@ -2745,12 +2745,12 @@ var De, Ei, Jc = (Ei = class extends Rr { }, De = new WeakMap(), Ei), Be, gr, xe, It, Ie, Ze, Si, Zc = (Si = class extends Do { constructor(e) { super(); - L(this, Ie); - L(this, Be, void 0); - L(this, gr, void 0); - L(this, xe, void 0); - L(this, It, void 0); - this.mutationId = e.mutationId, T(this, gr, e.defaultOptions), T(this, xe, e.mutationCache), T(this, Be, []), this.state = e.state || el(), this.setOptions(e.options), this.scheduleGc(); + M(this, Ie); + M(this, Be, void 0); + M(this, gr, void 0); + M(this, xe, void 0); + M(this, It, void 0); + this.mutationId = e.mutationId, R(this, gr, e.defaultOptions), R(this, xe, e.mutationCache), R(this, Be, []), this.state = e.state || el(), this.setOptions(e.options), this.scheduleGc(); } setOptions(e) { this.options = { ...u(this, gr), ...e }, this.updateGcTime(this.options.gcTime); @@ -2766,7 +2766,7 @@ var De, Ei, Jc = (Ei = class extends Rr { })); } removeObserver(e) { - T(this, Be, u(this, Be).filter((r) => r !== e)), this.scheduleGc(), u(this, xe).notify({ + R(this, Be, u(this, Be).filter((r) => r !== e)), this.scheduleGc(), u(this, xe).notify({ type: "observerRemoved", mutation: this, observer: e @@ -2781,11 +2781,11 @@ var De, Ei, Jc = (Ei = class extends Rr { this.execute(this.state.variables); } async execute(e) { - var s, i, o, a, l, f, h, p, d, y, v, _, m, k, M, P, q, $, Y, ne; - const r = () => (T(this, It, jo({ + var s, i, o, a, l, f, h, p, d, y, v, _, m, S, $, B, N, P, Y, ne; + const r = () => (R(this, It, jo({ fn: () => this.options.mutationFn ? this.options.mutationFn(e) : Promise.reject(new Error("No mutationFn found")), - onFail: (B, G) => { - Q(this, Ie, Ze).call(this, { type: "failed", failureCount: B, error: G }); + onFail: (j, G) => { + Q(this, Ie, Ze).call(this, { type: "failed", failureCount: j, error: G }); }, onPause: () => { Q(this, Ie, Ze).call(this, { type: "pause" }); @@ -2811,50 +2811,50 @@ var De, Ei, Jc = (Ei = class extends Rr { variables: e }); } - const B = await r(); + const j = await r(); return await ((f = (l = u(this, xe).config).onSuccess) == null ? void 0 : f.call( l, - B, + j, e, this.state.context, this - )), await ((p = (h = this.options).onSuccess) == null ? void 0 : p.call(h, B, e, this.state.context)), await ((y = (d = u(this, xe).config).onSettled) == null ? void 0 : y.call( + )), await ((p = (h = this.options).onSuccess) == null ? void 0 : p.call(h, j, e, this.state.context)), await ((y = (d = u(this, xe).config).onSettled) == null ? void 0 : y.call( d, - B, + j, null, this.state.variables, this.state.context, this - )), await ((_ = (v = this.options).onSettled) == null ? void 0 : _.call(v, B, null, e, this.state.context)), Q(this, Ie, Ze).call(this, { type: "success", data: B }), B; - } catch (B) { + )), await ((_ = (v = this.options).onSettled) == null ? void 0 : _.call(v, j, null, e, this.state.context)), Q(this, Ie, Ze).call(this, { type: "success", data: j }), j; + } catch (j) { try { - throw await ((k = (m = u(this, xe).config).onError) == null ? void 0 : k.call( + throw await ((S = (m = u(this, xe).config).onError) == null ? void 0 : S.call( m, - B, + j, e, this.state.context, this - )), await ((P = (M = this.options).onError) == null ? void 0 : P.call( - M, - B, + )), await ((B = ($ = this.options).onError) == null ? void 0 : B.call( + $, + j, e, this.state.context - )), await (($ = (q = u(this, xe).config).onSettled) == null ? void 0 : $.call( - q, + )), await ((P = (N = u(this, xe).config).onSettled) == null ? void 0 : P.call( + N, void 0, - B, + j, this.state.variables, this.state.context, this )), await ((ne = (Y = this.options).onSettled) == null ? void 0 : ne.call( Y, void 0, - B, + j, e, this.state.context - )), B; + )), j; } finally { - Q(this, Ie, Ze).call(this, { type: "error", error: B }); + Q(this, Ie, Ze).call(this, { type: "error", error: j }); } } } @@ -2935,13 +2935,13 @@ function el() { submittedAt: 0 }; } -var ke, mr, gt, ki, tl = (ki = class extends Rr { +var ke, mr, gt, ki, tl = (ki = class extends Tr { constructor(e = {}) { super(); - L(this, ke, void 0); - L(this, mr, void 0); - L(this, gt, void 0); - this.config = e, T(this, ke, []), T(this, mr, 0); + M(this, ke, void 0); + M(this, mr, void 0); + M(this, gt, void 0); + this.config = e, R(this, ke, []), R(this, mr, 0); } build(e, r, n) { const s = new Zc({ @@ -2956,7 +2956,7 @@ var ke, mr, gt, ki, tl = (ki = class extends Rr { u(this, ke).push(e), this.notify({ type: "added", mutation: e }); } remove(e) { - T(this, ke, u(this, ke).filter((r) => r !== e)), this.notify({ type: "removed", mutation: e }); + R(this, ke, u(this, ke).filter((r) => r !== e)), this.notify({ type: "removed", mutation: e }); } clear() { de.batch(() => { @@ -2987,7 +2987,7 @@ var ke, mr, gt, ki, tl = (ki = class extends Rr { }); } resumePausedMutations() { - return T(this, gt, (u(this, gt) ?? Promise.resolve()).then(() => { + return R(this, gt, (u(this, gt) ?? Promise.resolve()).then(() => { const e = u(this, ke).filter((r) => r.state.isPaused); return de.batch( () => e.reduce( @@ -2996,7 +2996,7 @@ var ke, mr, gt, ki, tl = (ki = class extends Rr { ) ); }).then(() => { - T(this, gt, void 0); + R(this, gt, void 0); })), u(this, gt); } }, ke = new WeakMap(), mr = new WeakMap(), gt = new WeakMap(), ki); @@ -3004,11 +3004,11 @@ function rl(t) { return { onFetch: (e, r) => { const n = async () => { - var v, _, m, k, M; - const s = e.options, i = (m = (_ = (v = e.fetchOptions) == null ? void 0 : v.meta) == null ? void 0 : _.fetchMore) == null ? void 0 : m.direction, o = ((k = e.state.data) == null ? void 0 : k.pages) || [], a = ((M = e.state.data) == null ? void 0 : M.pageParams) || [], l = { pages: [], pageParams: [] }; + var v, _, m, S, $; + const s = e.options, i = (m = (_ = (v = e.fetchOptions) == null ? void 0 : v.meta) == null ? void 0 : _.fetchMore) == null ? void 0 : m.direction, o = ((S = e.state.data) == null ? void 0 : S.pages) || [], a = (($ = e.state.data) == null ? void 0 : $.pageParams) || [], l = { pages: [], pageParams: [] }; let f = !1; - const h = (P) => { - Object.defineProperty(P, "signal", { + const h = (B) => { + Object.defineProperty(B, "signal", { enumerable: !0, get: () => (e.signal.aborted ? f = !0 : e.signal.addEventListener("abort", () => { f = !0; @@ -3018,42 +3018,42 @@ function rl(t) { `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.options.queryHash}'` ), Promise.reject( new Error(`Missing queryFn: '${e.options.queryHash}'`) - )), d = async (P, q, $) => { + )), d = async (B, N, P) => { if (f) return Promise.reject(); - if (q == null && P.pages.length) - return Promise.resolve(P); + if (N == null && B.pages.length) + return Promise.resolve(B); const Y = { queryKey: e.queryKey, - pageParam: q, - direction: $ ? "backward" : "forward", + pageParam: N, + direction: P ? "backward" : "forward", meta: e.options.meta }; h(Y); const ne = await p( Y - ), { maxPages: B } = e.options, G = $ ? Qc : Vc; + ), { maxPages: j } = e.options, G = P ? Qc : Vc; return { - pages: G(P.pages, ne, B), - pageParams: G(P.pageParams, q, B) + pages: G(B.pages, ne, j), + pageParams: G(B.pageParams, N, j) }; }; let y; if (i && o.length) { - const P = i === "backward", q = P ? nl : ti, $ = { + const B = i === "backward", N = B ? nl : ti, P = { pages: o, pageParams: a - }, Y = q(s, $); - y = await d($, Y, P); + }, Y = N(s, P); + y = await d(P, Y, B); } else { y = await d( l, a[0] ?? s.initialPageParam ); - const P = t ?? o.length; - for (let q = 1; q < P; q++) { - const $ = ti(s, y); - y = await d(y, $); + const B = t ?? o.length; + for (let N = 1; N < B; N++) { + const P = ti(s, y); + y = await d(y, P); } } return y; @@ -3095,26 +3095,26 @@ function nl(t, { pages: e, pageParams: r }) { } var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { constructor(t = {}) { - L(this, se, void 0); - L(this, rt, void 0); - L(this, nt, void 0); - L(this, Ft, void 0); - L(this, Ut, void 0); - L(this, st, void 0); - L(this, qt, void 0); - L(this, Ht, void 0); - T(this, se, t.queryCache || new Jc()), T(this, rt, t.mutationCache || new tl()), T(this, nt, t.defaultOptions || {}), T(this, Ft, /* @__PURE__ */ new Map()), T(this, Ut, /* @__PURE__ */ new Map()), T(this, st, 0); + M(this, se, void 0); + M(this, rt, void 0); + M(this, nt, void 0); + M(this, Ft, void 0); + M(this, Ut, void 0); + M(this, st, void 0); + M(this, qt, void 0); + M(this, Ht, void 0); + R(this, se, t.queryCache || new Jc()), R(this, rt, t.mutationCache || new tl()), R(this, nt, t.defaultOptions || {}), R(this, Ft, /* @__PURE__ */ new Map()), R(this, Ut, /* @__PURE__ */ new Map()), R(this, st, 0); } mount() { - Lr(this, st)._++, u(this, st) === 1 && (T(this, qt, cs.subscribe(async (t) => { + Lr(this, st)._++, u(this, st) === 1 && (R(this, qt, cs.subscribe(async (t) => { t && (await this.resumePausedMutations(), u(this, se).onFocus()); - })), T(this, Ht, Zr.subscribe(async (t) => { + })), R(this, Ht, Zr.subscribe(async (t) => { t && (await this.resumePausedMutations(), u(this, se).onOnline()); }))); } unmount() { var t, e; - Lr(this, st)._--, u(this, st) === 0 && ((t = u(this, qt)) == null || t.call(this), T(this, qt, void 0), (e = u(this, Ht)) == null || e.call(this), T(this, Ht, void 0)); + Lr(this, st)._--, u(this, st) === 0 && ((t = u(this, qt)) == null || t.call(this), R(this, qt, void 0), (e = u(this, Ht)) == null || e.call(this), R(this, Ht, void 0)); } isFetching(t) { return u(this, se).findAll({ ...t, fetchStatus: "fetching" }).length; @@ -3238,7 +3238,7 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { return u(this, nt); } setDefaultOptions(t) { - T(this, nt, t); + R(this, nt, t); } setQueryDefaults(t, e) { u(this, Ft).set(fr(t), { @@ -3291,35 +3291,35 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { clear() { u(this, se).clear(), u(this, rt).clear(); } -}, se = new WeakMap(), rt = new WeakMap(), nt = new WeakMap(), Ft = new WeakMap(), Ut = new WeakMap(), st = new WeakMap(), qt = new WeakMap(), Ht = new WeakMap(), Ci), ve, ee, br, me, mt, Vt, Fe, vr, Qt, zt, bt, vt, it, Wt, wt, ir, wr, Dn, xr, Bn, _r, In, Er, Fn, Sr, Un, kr, qn, Cr, Hn, tn, Io, Oi, il = (Oi = class extends Rr { +}, se = new WeakMap(), rt = new WeakMap(), nt = new WeakMap(), Ft = new WeakMap(), Ut = new WeakMap(), st = new WeakMap(), qt = new WeakMap(), Ht = new WeakMap(), Ci), ve, ee, br, me, mt, Vt, Fe, vr, Qt, zt, bt, vt, it, Wt, wt, ir, wr, Dn, xr, Bn, _r, In, Er, Fn, Sr, Un, kr, qn, Cr, Hn, tn, Io, Oi, il = (Oi = class extends Tr { constructor(e, r) { super(); - L(this, wt); - L(this, wr); - L(this, xr); - L(this, _r); - L(this, Er); - L(this, Sr); - L(this, kr); - L(this, Cr); - L(this, tn); - L(this, ve, void 0); - L(this, ee, void 0); - L(this, br, void 0); - L(this, me, void 0); - L(this, mt, void 0); - L(this, Vt, void 0); - L(this, Fe, void 0); - L(this, vr, void 0); - L(this, Qt, void 0); + M(this, wt); + M(this, wr); + M(this, xr); + M(this, _r); + M(this, Er); + M(this, Sr); + M(this, kr); + M(this, Cr); + M(this, tn); + M(this, ve, void 0); + M(this, ee, void 0); + M(this, br, void 0); + M(this, me, void 0); + M(this, mt, void 0); + M(this, Vt, void 0); + M(this, Fe, void 0); + M(this, vr, void 0); + M(this, Qt, void 0); // This property keeps track of the last query with defined data. // It will be used to pass the previous data and query to the placeholder function between renders. - L(this, zt, void 0); - L(this, bt, void 0); - L(this, vt, void 0); - L(this, it, void 0); - L(this, Wt, /* @__PURE__ */ new Set()); - this.options = r, T(this, ve, e), T(this, Fe, null), this.bindMethods(), this.setOptions(r); + M(this, zt, void 0); + M(this, bt, void 0); + M(this, vt, void 0); + M(this, it, void 0); + M(this, Wt, /* @__PURE__ */ new Set()); + this.options = r, R(this, ve, e), R(this, Fe, null), this.bindMethods(), this.setOptions(r); } bindMethods() { this.refetch = this.refetch.bind(this); @@ -3368,7 +3368,7 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { } getOptimisticResult(e) { const r = u(this, ve).getQueryCache().build(u(this, ve), e), n = this.createResult(r, e); - return al(this, n) && (T(this, me, n), T(this, Vt, this.options), T(this, mt, u(this, ee).state)), n; + return al(this, n) && (R(this, me, n), R(this, Vt, this.options), R(this, mt, u(this, ee).state)), n; } getCurrentResult() { return u(this, me); @@ -3409,7 +3409,7 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { const n = u(this, ee), s = this.options, i = u(this, me), o = u(this, mt), a = u(this, Vt), f = e !== n ? e.state : u(this, br), { state: h } = e; let p = { ...h }, d = !1, y; if (r._optimisticResults) { - const B = this.hasListeners(), G = !B && ri(e, r), X = B && ni(e, n, r, s); + const j = this.hasListeners(), G = !j && ri(e, r), X = j && ni(e, n, r, s); (G || X) && (p = { ...p, ...Bo(h.data, e.options) @@ -3421,41 +3421,41 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { y = u(this, Qt); else try { - T(this, vr, r.select), y = r.select(p.data), y = jn(i == null ? void 0 : i.data, y, r), T(this, Qt, y), T(this, Fe, null); - } catch (B) { - T(this, Fe, B); + R(this, vr, r.select), y = r.select(p.data), y = jn(i == null ? void 0 : i.data, y, r), R(this, Qt, y), R(this, Fe, null); + } catch (j) { + R(this, Fe, j); } else y = p.data; if (r.placeholderData !== void 0 && y === void 0 && m === "pending") { - let B; + let j; if (i != null && i.isPlaceholderData && r.placeholderData === (a == null ? void 0 : a.placeholderData)) - B = i.data; - else if (B = typeof r.placeholderData == "function" ? r.placeholderData( + j = i.data; + else if (j = typeof r.placeholderData == "function" ? r.placeholderData( (ne = u(this, zt)) == null ? void 0 : ne.state.data, u(this, zt) - ) : r.placeholderData, r.select && B !== void 0) + ) : r.placeholderData, r.select && j !== void 0) try { - B = r.select(B), T(this, Fe, null); + j = r.select(j), R(this, Fe, null); } catch (G) { - T(this, Fe, G); + R(this, Fe, G); } - B !== void 0 && (m = "success", y = jn( + j !== void 0 && (m = "success", y = jn( i == null ? void 0 : i.data, - B, + j, r ), d = !0); } u(this, Fe) && (v = u(this, Fe), y = u(this, Qt), _ = Date.now(), m = "error"); - const k = p.fetchStatus === "fetching", M = m === "pending", P = m === "error", q = M && k, $ = y !== void 0; + const S = p.fetchStatus === "fetching", $ = m === "pending", B = m === "error", N = $ && S, P = y !== void 0; return { status: m, fetchStatus: p.fetchStatus, - isPending: M, + isPending: $, isSuccess: m === "success", - isError: P, - isInitialLoading: q, - isLoading: q, + isError: B, + isInitialLoading: N, + isLoading: N, data: y, dataUpdatedAt: p.dataUpdatedAt, error: v, @@ -3465,21 +3465,21 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { errorUpdateCount: p.errorUpdateCount, isFetched: p.dataUpdateCount > 0 || p.errorUpdateCount > 0, isFetchedAfterMount: p.dataUpdateCount > f.dataUpdateCount || p.errorUpdateCount > f.errorUpdateCount, - isFetching: k, - isRefetching: k && !M, - isLoadingError: P && !$, + isFetching: S, + isRefetching: S && !$, + isLoadingError: B && !P, isPaused: p.fetchStatus === "paused", isPlaceholderData: d, - isRefetchError: P && $, + isRefetchError: B && P, isStale: us(e, r), refetch: this.refetch }; } updateResult(e) { const r = u(this, me), n = this.createResult(u(this, ee), this.options); - if (T(this, mt, u(this, ee).state), T(this, Vt, this.options), u(this, mt).data !== void 0 && T(this, zt, u(this, ee)), Ln(n, r)) + if (R(this, mt, u(this, ee).state), R(this, Vt, this.options), u(this, mt).data !== void 0 && R(this, zt, u(this, ee)), Ln(n, r)) return; - T(this, me, n); + R(this, me, n); const s = {}, i = () => { if (!r) return !0; @@ -3513,27 +3513,27 @@ var se, rt, nt, Ft, Ut, st, qt, Ht, Ci, sl = (Ci = class { u(this, me).dataUpdatedAt, this.options.staleTime ) + 1; - T(this, bt, setTimeout(() => { + R(this, bt, setTimeout(() => { u(this, me).isStale || this.updateResult(); }, r)); }, xr = new WeakSet(), Bn = function() { return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(u(this, ee)) : this.options.refetchInterval) ?? !1; }, _r = new WeakSet(), In = function(e) { - Q(this, kr, qn).call(this), T(this, it, e), !(Yt || this.options.enabled === !1 || !Mn(u(this, it)) || u(this, it) === 0) && T(this, vt, setInterval(() => { + Q(this, kr, qn).call(this), R(this, it, e), !(Yt || this.options.enabled === !1 || !Mn(u(this, it)) || u(this, it) === 0) && R(this, vt, setInterval(() => { (this.options.refetchIntervalInBackground || cs.isFocused()) && Q(this, wt, ir).call(this); }, u(this, it))); }, Er = new WeakSet(), Fn = function() { Q(this, wr, Dn).call(this), Q(this, _r, In).call(this, Q(this, xr, Bn).call(this)); }, Sr = new WeakSet(), Un = function() { - u(this, bt) && (clearTimeout(u(this, bt)), T(this, bt, void 0)); + u(this, bt) && (clearTimeout(u(this, bt)), R(this, bt, void 0)); }, kr = new WeakSet(), qn = function() { - u(this, vt) && (clearInterval(u(this, vt)), T(this, vt, void 0)); + u(this, vt) && (clearInterval(u(this, vt)), R(this, vt, void 0)); }, Cr = new WeakSet(), Hn = function() { const e = u(this, ve).getQueryCache().build(u(this, ve), this.options); if (e === u(this, ee)) return; const r = u(this, ee); - T(this, ee, e), T(this, br, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this)); + R(this, ee, e), R(this, br, e.state), this.hasListeners() && (r == null || r.removeObserver(this), e.addObserver(this)); }, tn = new WeakSet(), Io = function(e) { de.batch(() => { e.listeners && this.listeners.forEach((r) => { @@ -3580,7 +3580,7 @@ var Fo = we.createContext( children: e }) => (we.useEffect(() => (t.mount(), () => { t.unmount(); -}), [t]), /* @__PURE__ */ R.jsx(Fo.Provider, { value: t, children: e })), qo = we.createContext(!1), ll = () => we.useContext(qo); +}), [t]), /* @__PURE__ */ T.jsx(Fo.Provider, { value: t, children: e })), qo = we.createContext(!1), ll = () => we.useContext(qo); qo.Provider; function ul() { let t = !1; @@ -3821,9 +3821,9 @@ function Al(t, e) { const Yo = 4; function ce(t) { if (t) - return Tl(t); + return Rl(t); } -function Tl(t) { +function Rl(t) { for (var e in ce.prototype) t[e] = ce.prototype[e]; return t; @@ -3874,9 +3874,9 @@ const Oe = typeof self < "u" ? self : typeof window < "u" ? window : Function("r function Ko(t, ...e) { return e.reduce((r, n) => (t.hasOwnProperty(n) && (r[n] = t[n]), r), {}); } -const Rl = Oe.setTimeout, Pl = Oe.clearTimeout; +const Tl = Oe.setTimeout, Pl = Oe.clearTimeout; function un(t, e) { - e.useNativeTimers ? (t.setTimeoutFn = Rl.bind(Oe), t.clearTimeoutFn = Pl.bind(Oe)) : (t.setTimeoutFn = Oe.setTimeout.bind(Oe), t.clearTimeoutFn = Oe.clearTimeout.bind(Oe)); + e.useNativeTimers ? (t.setTimeoutFn = Tl.bind(Oe), t.clearTimeoutFn = Pl.bind(Oe)) : (t.setTimeoutFn = Oe.setTimeout.bind(Oe), t.clearTimeoutFn = Oe.clearTimeout.bind(Oe)); } const $l = 1.33; function Ml(t) { @@ -5908,7 +5908,7 @@ function fu(t) { [] ); } -const na = Ti({}), du = ({ +const na = Ri({}), du = ({ children: t, channelId: e, onEndBot: r, @@ -5920,19 +5920,20 @@ const na = Ti({}), du = ({ customStyles: l, isForPreview: f, isForManager: h, - adminId: p + adminId: p, + ...d }) => { - const [d, y] = _t(!1), [v, _] = _t(h ? void 0 : l), m = Uo(), k = Vr(() => new URLSearchParams(window.location.search), []), M = Vr(() => a || Ee(), [a]), P = Vr(() => e || k.get("channelId") || "", [e, k]), q = Ae(Yr(Rn, { + const [y, v] = _t(!1), [_, m] = _t(h ? void 0 : l), S = Uo(), $ = Vr(() => new URLSearchParams(window.location.search), []), B = Vr(() => a || Ee(), [a]), N = Vr(() => e || $.get("channelId") || "", [e, $]), P = Ae(Yr(d.API_URL || Tn, { autoConnect: !1, transports: ["websocket"], query: { - userId: p ? `${M}_${p}` : M + userId: p ? `${B}_${p}` : B } })), { - data: $, - isLoading: Y + data: Y, + isLoading: ne } = si({ - queryKey: ["messages", P, a || Ee()], + queryKey: ["messages", N, a || Ee()], queryFn: async () => { try { return f ? [{ @@ -5944,103 +5945,103 @@ const na = Ti({}), du = ({ message: "I want to know more about your product", userId: Ee(), createdAt: (/* @__PURE__ */ new Date()).toISOString() - }] : (await (await fetch(`${URL}/api/conversation-live-chat/${a || Ee()}/${P}`)).json()).data; + }] : (await (await fetch(`${URL}/api/conversation-live-chat/${a || Ee()}/${N}`)).json()).data; } catch { return []; } }, initialData: [] }), { - data: ne + data: j } = si({ - queryKey: ["custom-style", P, a || Ee()], + queryKey: ["custom-style", N, a || Ee()], queryFn: async () => { try { - return (await (await fetch(`${Rn}/api/custom-chatbox/${P}`)).json()).data; + return (await (await fetch(`${d.API_URL || Tn}/api/custom-chatbox/${N}`)).json()).data; } catch { return; } }, enabled: !n && !f && !h - }), B = Hr(({ - message: D, - cb: g, - extraData: A, - type: E + }), G = Hr(({ + message: g, + cb: A, + extraData: E, + type: w }) => { - const b = D.trim(); + const b = g.trim(); if (b.length === 0) return; - const w = Gs(P, a), C = { - message: E === "list-button" ? A || "" : b, + const C = Gs(N, a), k = { + message: w === "list-button" ? E || "" : b, userId: p || a || Ee(), template: {}, createdAt: (/* @__PURE__ */ new Date()).toISOString(), isTest: n }; - q.current.emit(er.MESSAGE, { + P.current.emit(er.MESSAGE, { message: b, - address: w, + address: C, isTest: n, - createdAt: C.createdAt - }), m.setQueryData(["messages", P, a || Ee()], (S) => [...S, C]), g && g(C); - }, [P, p, n, m, a]), G = Hr(() => { + createdAt: k.createdAt + }), S.setQueryData(["messages", N, a || Ee()], (L) => [...L, k]), A && A(k); + }, [N, p, n, S, a]), X = Hr(() => { window.parent && window.parent.postMessage({ type: "TOGGLE_CHAT" }, "*"), s == null || s(); - }, [s]), X = Hr(() => { - f || (q.current.emit(er.MESSAGE, { + }, [s]), q = Hr(() => { + f || (P.current.emit(er.MESSAGE, { type: "event", typeName: "endConversation", - address: Gs(P, a), + address: Gs(N, a), isTest: n, message: "" - }), y(!1), m.setQueryData(["messages", P, a || Ee()], () => [])); - }, [P, f, n, m, a]); + }), v(!1), S.setQueryData(["messages", N, a || Ee()], () => [])); + }, [N, f, n, S, a]); return fu(() => { - q.current.disconnect(); + P.current.disconnect(); }), Ye(() => { if (f) return; - const D = q.current; - return D.connect(), D.on(er.MESSAGE, (g) => { - var A; - ((A = g.template) == null ? void 0 : A.type) === "list-button" ? y(!0) : y(!1), m.setQueryData(["messages", P, a || Ee()], (E) => [...E, g].filter((b) => b.userId !== "typing")); - }), D.on(er.TYPING, () => { - m.setQueryData(["messages", P, a || Ee()], (g) => [...g, { + const g = P.current; + return g.connect(), g.on(er.MESSAGE, (A) => { + var E; + ((E = A.template) == null ? void 0 : E.type) === "list-button" ? v(!0) : v(!1), S.setQueryData(["messages", N, a || Ee()], (w) => [...w, A].filter((b) => b.userId !== "typing")); + }), g.on(er.TYPING, () => { + S.setQueryData(["messages", N, a || Ee()], (A) => [...A, { userId: "typing" }]); - }), D.on(er.STOP_TYPING, () => { - m.setQueryData(["messages", P, a || Ee()], (g) => g.filter((A) => A.userId !== "typing")); + }), g.on(er.STOP_TYPING, () => { + S.setQueryData(["messages", N, a || Ee()], (A) => A.filter((E) => E.userId !== "typing")); }), () => { - D.disconnect(); + g.disconnect(); }; - }, [P, m, a, f]), Ye(() => { - f && y(!0); + }, [N, S, a, f]), Ye(() => { + f && v(!0); }, [f]), Ye(() => { - ne && !h && _(ne); - }, [ne, h]), Ye(() => { - l && !h && _(l); - }, [l, h]), /* @__PURE__ */ R.jsx(na.Provider, { value: { - socket: q.current, - messages: $, - channelId: P, + j && !h && m(j); + }, [j, h]), Ye(() => { + l && !h && m(l); + }, [l, h]), /* @__PURE__ */ T.jsx(na.Provider, { value: { + socket: P.current, + messages: Y, + channelId: N, onEndBot: r, isTest: n, - handleSendMessage: B, - handleClose: G, - disableInput: d, + handleSendMessage: G, + handleClose: X, + disableInput: y, isShowClose: i, - isLoadingMessages: Y, + isLoadingMessages: ne, isForLiveChat: o, userId: a, - handleReload: X, - customStyles: v, + handleReload: q, + customStyles: _, adminId: p, isForManager: h }, children: t }); }, kt = () => { - const t = Ri(na); + const t = Ti(na); if (!t) throw new Error("useSocket must be used within SocketProvider"); return t; @@ -6310,9 +6311,9 @@ function re(t) { const e = (r) => r[t] || []; return e.isThemeGetter = !0, e; } -const ca = /^\[(?:([a-z-]+):)?(.+)\]$/i, Au = /^\d+\/\d+$/, Tu = /* @__PURE__ */ new Set(["px", "full", "screen"]), Ru = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Pu = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, $u = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, Mu = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Lu = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; +const ca = /^\[(?:([a-z-]+):)?(.+)\]$/i, Au = /^\d+\/\d+$/, Ru = /* @__PURE__ */ new Set(["px", "full", "screen"]), Tu = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, Pu = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, $u = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, Mu = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Lu = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/; function Qe(t) { - return ht(t) || Tu.has(t) || Au.test(t); + return ht(t) || Ru.has(t) || Au.test(t); } function Xe(t) { return Gt(t, "length", qu); @@ -6333,7 +6334,7 @@ function U(t) { return ca.test(t); } function Je(t) { - return Ru.test(t); + return Tu.test(t); } const ju = /* @__PURE__ */ new Set(["length", "size", "percentage"]); function Du(t) { @@ -6369,7 +6370,7 @@ function Vu(t) { return Lu.test(t); } function Qu() { - const t = re("colors"), e = re("spacing"), r = re("blur"), n = re("brightness"), s = re("borderColor"), i = re("borderRadius"), o = re("borderSpacing"), a = re("borderWidth"), l = re("contrast"), f = re("grayscale"), h = re("hueRotate"), p = re("invert"), d = re("gap"), y = re("gradientColorStops"), v = re("gradientColorStopPositions"), _ = re("inset"), m = re("margin"), k = re("opacity"), M = re("padding"), P = re("saturate"), q = re("scale"), $ = re("sepia"), Y = re("skew"), ne = re("space"), B = re("translate"), G = () => ["auto", "contain", "none"], X = () => ["auto", "hidden", "clip", "visible", "scroll"], D = () => ["auto", U, e], g = () => [U, e], A = () => ["", Qe, Xe], E = () => ["auto", ht, U], b = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], w = () => ["solid", "dashed", "dotted", "double", "none"], C = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"], S = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], N = () => ["", "0", U], j = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], V = () => [ht, Ur], J = () => [ht, U]; + const t = re("colors"), e = re("spacing"), r = re("blur"), n = re("brightness"), s = re("borderColor"), i = re("borderRadius"), o = re("borderSpacing"), a = re("borderWidth"), l = re("contrast"), f = re("grayscale"), h = re("hueRotate"), p = re("invert"), d = re("gap"), y = re("gradientColorStops"), v = re("gradientColorStopPositions"), _ = re("inset"), m = re("margin"), S = re("opacity"), $ = re("padding"), B = re("saturate"), N = re("scale"), P = re("sepia"), Y = re("skew"), ne = re("space"), j = re("translate"), G = () => ["auto", "contain", "none"], X = () => ["auto", "hidden", "clip", "visible", "scroll"], q = () => ["auto", U, e], g = () => [U, e], A = () => ["", Qe, Xe], E = () => ["auto", ht, U], w = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], b = () => ["solid", "dashed", "dotted", "double", "none"], C = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity", "plus-lighter"], k = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], L = () => ["", "0", U], D = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], V = () => [ht, Ur], J = () => [ht, U]; return { cacheSize: 500, separator: ":", @@ -6383,19 +6384,19 @@ function Qu() { borderSpacing: g(), borderWidth: A(), contrast: V(), - grayscale: N(), + grayscale: L(), hueRotate: J(), - invert: N(), + invert: L(), gap: g(), gradientColorStops: [t], gradientColorStopPositions: [Nu, Xe], - inset: D(), - margin: D(), + inset: q(), + margin: q(), opacity: V(), padding: g(), saturate: V(), scale: V(), - sepia: N(), + sepia: L(), skew: J(), space: g(), translate: g() @@ -6426,14 +6427,14 @@ function Qu() { * @see https://tailwindcss.com/docs/break-after */ "break-after": [{ - "break-after": j() + "break-after": D() }], /** * Break Before * @see https://tailwindcss.com/docs/break-before */ "break-before": [{ - "break-before": j() + "break-before": D() }], /** * Break Inside @@ -6492,7 +6493,7 @@ function Qu() { * @see https://tailwindcss.com/docs/object-position */ "object-position": [{ - object: [...b(), U] + object: [...w(), U] }], /** * Overflow @@ -6622,7 +6623,7 @@ function Qu() { * @see https://tailwindcss.com/docs/flex-basis */ basis: [{ - basis: D() + basis: q() }], /** * Flex Direction @@ -6650,14 +6651,14 @@ function Qu() { * @see https://tailwindcss.com/docs/flex-grow */ grow: [{ - grow: N() + grow: L() }], /** * Flex Shrink * @see https://tailwindcss.com/docs/flex-shrink */ shrink: [{ - shrink: N() + shrink: L() }], /** * Order @@ -6773,7 +6774,7 @@ function Qu() { * @see https://tailwindcss.com/docs/justify-content */ "justify-content": [{ - justify: ["normal", ...S()] + justify: ["normal", ...k()] }], /** * Justify Items @@ -6794,7 +6795,7 @@ function Qu() { * @see https://tailwindcss.com/docs/align-content */ "align-content": [{ - content: ["normal", ...S(), "baseline"] + content: ["normal", ...k(), "baseline"] }], /** * Align Items @@ -6815,7 +6816,7 @@ function Qu() { * @see https://tailwindcss.com/docs/place-content */ "place-content": [{ - "place-content": [...S(), "baseline"] + "place-content": [...k(), "baseline"] }], /** * Place Items @@ -6837,63 +6838,63 @@ function Qu() { * @see https://tailwindcss.com/docs/padding */ p: [{ - p: [M] + p: [$] }], /** * Padding X * @see https://tailwindcss.com/docs/padding */ px: [{ - px: [M] + px: [$] }], /** * Padding Y * @see https://tailwindcss.com/docs/padding */ py: [{ - py: [M] + py: [$] }], /** * Padding Start * @see https://tailwindcss.com/docs/padding */ ps: [{ - ps: [M] + ps: [$] }], /** * Padding End * @see https://tailwindcss.com/docs/padding */ pe: [{ - pe: [M] + pe: [$] }], /** * Padding Top * @see https://tailwindcss.com/docs/padding */ pt: [{ - pt: [M] + pt: [$] }], /** * Padding Right * @see https://tailwindcss.com/docs/padding */ pr: [{ - pr: [M] + pr: [$] }], /** * Padding Bottom * @see https://tailwindcss.com/docs/padding */ pb: [{ - pb: [M] + pb: [$] }], /** * Padding Left * @see https://tailwindcss.com/docs/padding */ pl: [{ - pl: [M] + pl: [$] }], /** * Margin @@ -7151,7 +7152,7 @@ function Qu() { * @see https://tailwindcss.com/docs/placeholder-opacity */ "placeholder-opacity": [{ - "placeholder-opacity": [k] + "placeholder-opacity": [S] }], /** * Text Alignment @@ -7172,7 +7173,7 @@ function Qu() { * @see https://tailwindcss.com/docs/text-opacity */ "text-opacity": [{ - "text-opacity": [k] + "text-opacity": [S] }], /** * Text Decoration @@ -7184,7 +7185,7 @@ function Qu() { * @see https://tailwindcss.com/docs/text-decoration-style */ "text-decoration-style": [{ - decoration: [...w(), "wavy"] + decoration: [...b(), "wavy"] }], /** * Text Decoration Thickness @@ -7287,7 +7288,7 @@ function Qu() { * @see https://tailwindcss.com/docs/background-opacity */ "bg-opacity": [{ - "bg-opacity": [k] + "bg-opacity": [S] }], /** * Background Origin @@ -7301,7 +7302,7 @@ function Qu() { * @see https://tailwindcss.com/docs/background-position */ "bg-position": [{ - bg: [...b(), Bu] + bg: [...w(), Bu] }], /** * Background Repeat @@ -7551,14 +7552,14 @@ function Qu() { * @see https://tailwindcss.com/docs/border-opacity */ "border-opacity": [{ - "border-opacity": [k] + "border-opacity": [S] }], /** * Border Style * @see https://tailwindcss.com/docs/border-style */ "border-style": [{ - border: [...w(), "hidden"] + border: [...b(), "hidden"] }], /** * Divide Width X @@ -7589,14 +7590,14 @@ function Qu() { * @see https://tailwindcss.com/docs/divide-opacity */ "divide-opacity": [{ - "divide-opacity": [k] + "divide-opacity": [S] }], /** * Divide Style * @see https://tailwindcss.com/docs/divide-style */ "divide-style": [{ - divide: w() + divide: b() }], /** * Border Color @@ -7659,7 +7660,7 @@ function Qu() { * @see https://tailwindcss.com/docs/outline-style */ "outline-style": [{ - outline: ["", ...w()] + outline: ["", ...b()] }], /** * Outline Offset @@ -7706,7 +7707,7 @@ function Qu() { * @see https://tailwindcss.com/docs/ring-opacity */ "ring-opacity": [{ - "ring-opacity": [k] + "ring-opacity": [S] }], /** * Ring Offset Width @@ -7742,7 +7743,7 @@ function Qu() { * @see https://tailwindcss.com/docs/opacity */ opacity: [{ - opacity: [k] + opacity: [S] }], /** * Mix Blend Mode @@ -7821,14 +7822,14 @@ function Qu() { * @see https://tailwindcss.com/docs/saturate */ saturate: [{ - saturate: [P] + saturate: [B] }], /** * Sepia * @see https://tailwindcss.com/docs/sepia */ sepia: [{ - sepia: [$] + sepia: [P] }], /** * Backdrop Filter @@ -7885,21 +7886,21 @@ function Qu() { * @see https://tailwindcss.com/docs/backdrop-opacity */ "backdrop-opacity": [{ - "backdrop-opacity": [k] + "backdrop-opacity": [S] }], /** * Backdrop Saturate * @see https://tailwindcss.com/docs/backdrop-saturate */ "backdrop-saturate": [{ - "backdrop-saturate": [P] + "backdrop-saturate": [B] }], /** * Backdrop Sepia * @see https://tailwindcss.com/docs/backdrop-sepia */ "backdrop-sepia": [{ - "backdrop-sepia": [$] + "backdrop-sepia": [P] }], // Tables /** @@ -7993,21 +7994,21 @@ function Qu() { * @see https://tailwindcss.com/docs/scale */ scale: [{ - scale: [q] + scale: [N] }], /** * Scale X * @see https://tailwindcss.com/docs/scale */ "scale-x": [{ - "scale-x": [q] + "scale-x": [N] }], /** * Scale Y * @see https://tailwindcss.com/docs/scale */ "scale-y": [{ - "scale-y": [q] + "scale-y": [N] }], /** * Rotate @@ -8021,14 +8022,14 @@ function Qu() { * @see https://tailwindcss.com/docs/translate */ "translate-x": [{ - "translate-x": [B] + "translate-x": [j] }], /** * Translate Y * @see https://tailwindcss.com/docs/translate */ "translate-y": [{ - "translate-y": [B] + "translate-y": [j] }], /** * Skew X @@ -8393,112 +8394,112 @@ var ua = { exports: {} }; (function(r, n) { t.exports = n(); })(ut, function() { - var r = 1e3, n = 6e4, s = 36e5, i = "millisecond", o = "second", a = "minute", l = "hour", f = "day", h = "week", p = "month", d = "quarter", y = "year", v = "date", _ = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, k = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(E) { - var b = ["th", "st", "nd", "rd"], w = E % 100; - return "[" + E + (b[(w - 20) % 10] || b[w] || b[0]) + "]"; - } }, P = function(E, b, w) { + var r = 1e3, n = 6e4, s = 36e5, i = "millisecond", o = "second", a = "minute", l = "hour", f = "day", h = "week", p = "month", d = "quarter", y = "year", v = "date", _ = "Invalid Date", m = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, S = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, $ = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(E) { + var w = ["th", "st", "nd", "rd"], b = E % 100; + return "[" + E + (w[(b - 20) % 10] || w[b] || w[0]) + "]"; + } }, B = function(E, w, b) { var C = String(E); - return !C || C.length >= b ? E : "" + Array(b + 1 - C.length).join(w) + E; - }, q = { s: P, z: function(E) { - var b = -E.utcOffset(), w = Math.abs(b), C = Math.floor(w / 60), S = w % 60; - return (b <= 0 ? "+" : "-") + P(C, 2, "0") + ":" + P(S, 2, "0"); - }, m: function E(b, w) { - if (b.date() < w.date()) - return -E(w, b); - var C = 12 * (w.year() - b.year()) + (w.month() - b.month()), S = b.clone().add(C, p), N = w - S < 0, j = b.clone().add(C + (N ? -1 : 1), p); - return +(-(C + (w - S) / (N ? S - j : j - S)) || 0); + return !C || C.length >= w ? E : "" + Array(w + 1 - C.length).join(b) + E; + }, N = { s: B, z: function(E) { + var w = -E.utcOffset(), b = Math.abs(w), C = Math.floor(b / 60), k = b % 60; + return (w <= 0 ? "+" : "-") + B(C, 2, "0") + ":" + B(k, 2, "0"); + }, m: function E(w, b) { + if (w.date() < b.date()) + return -E(b, w); + var C = 12 * (b.year() - w.year()) + (b.month() - w.month()), k = w.clone().add(C, p), L = b - k < 0, D = w.clone().add(C + (L ? -1 : 1), p); + return +(-(C + (b - k) / (L ? k - D : D - k)) || 0); }, a: function(E) { return E < 0 ? Math.ceil(E) || 0 : Math.floor(E); }, p: function(E) { return { M: p, y, w: h, d: f, D: v, h: l, m: a, s: o, ms: i, Q: d }[E] || String(E || "").toLowerCase().replace(/s$/, ""); }, u: function(E) { return E === void 0; - } }, $ = "en", Y = {}; - Y[$] = M; - var ne = "$isDayjsObject", B = function(E) { + } }, P = "en", Y = {}; + Y[P] = $; + var ne = "$isDayjsObject", j = function(E) { return E instanceof g || !(!E || !E[ne]); - }, G = function E(b, w, C) { - var S; - if (!b) - return $; - if (typeof b == "string") { - var N = b.toLowerCase(); - Y[N] && (S = N), w && (Y[N] = w, S = N); - var j = b.split("-"); - if (!S && j.length > 1) - return E(j[0]); + }, G = function E(w, b, C) { + var k; + if (!w) + return P; + if (typeof w == "string") { + var L = w.toLowerCase(); + Y[L] && (k = L), b && (Y[L] = b, k = L); + var D = w.split("-"); + if (!k && D.length > 1) + return E(D[0]); } else { - var V = b.name; - Y[V] = b, S = V; + var V = w.name; + Y[V] = w, k = V; } - return !C && S && ($ = S), S || !C && $; - }, X = function(E, b) { - if (B(E)) + return !C && k && (P = k), k || !C && P; + }, X = function(E, w) { + if (j(E)) return E.clone(); - var w = typeof b == "object" ? b : {}; - return w.date = E, w.args = arguments, new g(w); - }, D = q; - D.l = G, D.i = B, D.w = function(E, b) { - return X(E, { locale: b.$L, utc: b.$u, x: b.$x, $offset: b.$offset }); + var b = typeof w == "object" ? w : {}; + return b.date = E, b.args = arguments, new g(b); + }, q = N; + q.l = G, q.i = j, q.w = function(E, w) { + return X(E, { locale: w.$L, utc: w.$u, x: w.$x, $offset: w.$offset }); }; var g = function() { - function E(w) { - this.$L = G(w.locale, null, !0), this.parse(w), this.$x = this.$x || w.x || {}, this[ne] = !0; + function E(b) { + this.$L = G(b.locale, null, !0), this.parse(b), this.$x = this.$x || b.x || {}, this[ne] = !0; } - var b = E.prototype; - return b.parse = function(w) { + var w = E.prototype; + return w.parse = function(b) { this.$d = function(C) { - var S = C.date, N = C.utc; - if (S === null) + var k = C.date, L = C.utc; + if (k === null) return /* @__PURE__ */ new Date(NaN); - if (D.u(S)) + if (q.u(k)) return /* @__PURE__ */ new Date(); - if (S instanceof Date) - return new Date(S); - if (typeof S == "string" && !/Z$/i.test(S)) { - var j = S.match(m); - if (j) { - var V = j[2] - 1 || 0, J = (j[7] || "0").substring(0, 3); - return N ? new Date(Date.UTC(j[1], V, j[3] || 1, j[4] || 0, j[5] || 0, j[6] || 0, J)) : new Date(j[1], V, j[3] || 1, j[4] || 0, j[5] || 0, j[6] || 0, J); + if (k instanceof Date) + return new Date(k); + if (typeof k == "string" && !/Z$/i.test(k)) { + var D = k.match(m); + if (D) { + var V = D[2] - 1 || 0, J = (D[7] || "0").substring(0, 3); + return L ? new Date(Date.UTC(D[1], V, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, J)) : new Date(D[1], V, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, J); } } - return new Date(S); - }(w), this.init(); - }, b.init = function() { - var w = this.$d; - this.$y = w.getFullYear(), this.$M = w.getMonth(), this.$D = w.getDate(), this.$W = w.getDay(), this.$H = w.getHours(), this.$m = w.getMinutes(), this.$s = w.getSeconds(), this.$ms = w.getMilliseconds(); - }, b.$utils = function() { - return D; - }, b.isValid = function() { + return new Date(k); + }(b), this.init(); + }, w.init = function() { + var b = this.$d; + this.$y = b.getFullYear(), this.$M = b.getMonth(), this.$D = b.getDate(), this.$W = b.getDay(), this.$H = b.getHours(), this.$m = b.getMinutes(), this.$s = b.getSeconds(), this.$ms = b.getMilliseconds(); + }, w.$utils = function() { + return q; + }, w.isValid = function() { return this.$d.toString() !== _; - }, b.isSame = function(w, C) { - var S = X(w); - return this.startOf(C) <= S && S <= this.endOf(C); - }, b.isAfter = function(w, C) { - return X(w) < this.startOf(C); - }, b.isBefore = function(w, C) { - return this.endOf(C) < X(w); - }, b.$g = function(w, C, S) { - return D.u(w) ? this[C] : this.set(S, w); - }, b.unix = function() { + }, w.isSame = function(b, C) { + var k = X(b); + return this.startOf(C) <= k && k <= this.endOf(C); + }, w.isAfter = function(b, C) { + return X(b) < this.startOf(C); + }, w.isBefore = function(b, C) { + return this.endOf(C) < X(b); + }, w.$g = function(b, C, k) { + return q.u(b) ? this[C] : this.set(k, b); + }, w.unix = function() { return Math.floor(this.valueOf() / 1e3); - }, b.valueOf = function() { + }, w.valueOf = function() { return this.$d.getTime(); - }, b.startOf = function(w, C) { - var S = this, N = !!D.u(C) || C, j = D.p(w), V = function(Re, le) { - var je = D.w(S.$u ? Date.UTC(S.$y, le, Re) : new Date(S.$y, le, Re), S); - return N ? je : je.endOf(f); - }, J = function(Re, le) { - return D.w(S.toDate()[Re].apply(S.toDate("s"), (N ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(le)), S); + }, w.startOf = function(b, C) { + var k = this, L = !!q.u(C) || C, D = q.p(b), V = function(Te, le) { + var je = q.w(k.$u ? Date.UTC(k.$y, le, Te) : new Date(k.$y, le, Te), k); + return L ? je : je.endOf(f); + }, J = function(Te, le) { + return q.w(k.toDate()[Te].apply(k.toDate("s"), (L ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(le)), k); }, ie = this.$W, ue = this.$M, be = this.$D, Le = "set" + (this.$u ? "UTC" : ""); - switch (j) { + switch (D) { case y: - return N ? V(1, 0) : V(31, 11); + return L ? V(1, 0) : V(31, 11); case p: - return N ? V(1, ue) : V(0, ue + 1); + return L ? V(1, ue) : V(0, ue + 1); case h: - var Te = this.$locale().weekStart || 0, Ne = (ie < Te ? ie + 7 : ie) - Te; - return V(N ? be - Ne : be + (6 - Ne), ue); + var Re = this.$locale().weekStart || 0, Ne = (ie < Re ? ie + 7 : ie) - Re; + return V(L ? be - Ne : be + (6 - Ne), ue); case f: case v: return J(Le + "Hours", 0); @@ -8511,171 +8512,171 @@ var ua = { exports: {} }; default: return this.clone(); } - }, b.endOf = function(w) { - return this.startOf(w, !1); - }, b.$set = function(w, C) { - var S, N = D.p(w), j = "set" + (this.$u ? "UTC" : ""), V = (S = {}, S[f] = j + "Date", S[v] = j + "Date", S[p] = j + "Month", S[y] = j + "FullYear", S[l] = j + "Hours", S[a] = j + "Minutes", S[o] = j + "Seconds", S[i] = j + "Milliseconds", S)[N], J = N === f ? this.$D + (C - this.$W) : C; - if (N === p || N === y) { + }, w.endOf = function(b) { + return this.startOf(b, !1); + }, w.$set = function(b, C) { + var k, L = q.p(b), D = "set" + (this.$u ? "UTC" : ""), V = (k = {}, k[f] = D + "Date", k[v] = D + "Date", k[p] = D + "Month", k[y] = D + "FullYear", k[l] = D + "Hours", k[a] = D + "Minutes", k[o] = D + "Seconds", k[i] = D + "Milliseconds", k)[L], J = L === f ? this.$D + (C - this.$W) : C; + if (L === p || L === y) { var ie = this.clone().set(v, 1); ie.$d[V](J), ie.init(), this.$d = ie.set(v, Math.min(this.$D, ie.daysInMonth())).$d; } else V && this.$d[V](J); return this.init(), this; - }, b.set = function(w, C) { - return this.clone().$set(w, C); - }, b.get = function(w) { - return this[D.p(w)](); - }, b.add = function(w, C) { - var S, N = this; - w = Number(w); - var j = D.p(C), V = function(ue) { - var be = X(N); - return D.w(be.date(be.date() + Math.round(ue * w)), N); + }, w.set = function(b, C) { + return this.clone().$set(b, C); + }, w.get = function(b) { + return this[q.p(b)](); + }, w.add = function(b, C) { + var k, L = this; + b = Number(b); + var D = q.p(C), V = function(ue) { + var be = X(L); + return q.w(be.date(be.date() + Math.round(ue * b)), L); }; - if (j === p) - return this.set(p, this.$M + w); - if (j === y) - return this.set(y, this.$y + w); - if (j === f) + if (D === p) + return this.set(p, this.$M + b); + if (D === y) + return this.set(y, this.$y + b); + if (D === f) return V(1); - if (j === h) + if (D === h) return V(7); - var J = (S = {}, S[a] = n, S[l] = s, S[o] = r, S)[j] || 1, ie = this.$d.getTime() + w * J; - return D.w(ie, this); - }, b.subtract = function(w, C) { - return this.add(-1 * w, C); - }, b.format = function(w) { - var C = this, S = this.$locale(); + var J = (k = {}, k[a] = n, k[l] = s, k[o] = r, k)[D] || 1, ie = this.$d.getTime() + b * J; + return q.w(ie, this); + }, w.subtract = function(b, C) { + return this.add(-1 * b, C); + }, w.format = function(b) { + var C = this, k = this.$locale(); if (!this.isValid()) - return S.invalidDate || _; - var N = w || "YYYY-MM-DDTHH:mm:ssZ", j = D.z(this), V = this.$H, J = this.$m, ie = this.$M, ue = S.weekdays, be = S.months, Le = S.meridiem, Te = function(le, je, Ke, Ct) { - return le && (le[je] || le(C, N)) || Ke[je].slice(0, Ct); + return k.invalidDate || _; + var L = b || "YYYY-MM-DDTHH:mm:ssZ", D = q.z(this), V = this.$H, J = this.$m, ie = this.$M, ue = k.weekdays, be = k.months, Le = k.meridiem, Re = function(le, je, Ke, Ct) { + return le && (le[je] || le(C, L)) || Ke[je].slice(0, Ct); }, Ne = function(le) { - return D.s(V % 12 || 12, le, "0"); - }, Re = Le || function(le, je, Ke) { + return q.s(V % 12 || 12, le, "0"); + }, Te = Le || function(le, je, Ke) { var Ct = le < 12 ? "AM" : "PM"; return Ke ? Ct.toLowerCase() : Ct; }; - return N.replace(k, function(le, je) { + return L.replace(S, function(le, je) { return je || function(Ke) { switch (Ke) { case "YY": return String(C.$y).slice(-2); case "YYYY": - return D.s(C.$y, 4, "0"); + return q.s(C.$y, 4, "0"); case "M": return ie + 1; case "MM": - return D.s(ie + 1, 2, "0"); + return q.s(ie + 1, 2, "0"); case "MMM": - return Te(S.monthsShort, ie, be, 3); + return Re(k.monthsShort, ie, be, 3); case "MMMM": - return Te(be, ie); + return Re(be, ie); case "D": return C.$D; case "DD": - return D.s(C.$D, 2, "0"); + return q.s(C.$D, 2, "0"); case "d": return String(C.$W); case "dd": - return Te(S.weekdaysMin, C.$W, ue, 2); + return Re(k.weekdaysMin, C.$W, ue, 2); case "ddd": - return Te(S.weekdaysShort, C.$W, ue, 3); + return Re(k.weekdaysShort, C.$W, ue, 3); case "dddd": return ue[C.$W]; case "H": return String(V); case "HH": - return D.s(V, 2, "0"); + return q.s(V, 2, "0"); case "h": return Ne(1); case "hh": return Ne(2); case "a": - return Re(V, J, !0); + return Te(V, J, !0); case "A": - return Re(V, J, !1); + return Te(V, J, !1); case "m": return String(J); case "mm": - return D.s(J, 2, "0"); + return q.s(J, 2, "0"); case "s": return String(C.$s); case "ss": - return D.s(C.$s, 2, "0"); + return q.s(C.$s, 2, "0"); case "SSS": - return D.s(C.$ms, 3, "0"); + return q.s(C.$ms, 3, "0"); case "Z": - return j; + return D; } return null; - }(le) || j.replace(":", ""); + }(le) || D.replace(":", ""); }); - }, b.utcOffset = function() { + }, w.utcOffset = function() { return 15 * -Math.round(this.$d.getTimezoneOffset() / 15); - }, b.diff = function(w, C, S) { - var N, j = this, V = D.p(C), J = X(w), ie = (J.utcOffset() - this.utcOffset()) * n, ue = this - J, be = function() { - return D.m(j, J); + }, w.diff = function(b, C, k) { + var L, D = this, V = q.p(C), J = X(b), ie = (J.utcOffset() - this.utcOffset()) * n, ue = this - J, be = function() { + return q.m(D, J); }; switch (V) { case y: - N = be() / 12; + L = be() / 12; break; case p: - N = be(); + L = be(); break; case d: - N = be() / 3; + L = be() / 3; break; case h: - N = (ue - ie) / 6048e5; + L = (ue - ie) / 6048e5; break; case f: - N = (ue - ie) / 864e5; + L = (ue - ie) / 864e5; break; case l: - N = ue / s; + L = ue / s; break; case a: - N = ue / n; + L = ue / n; break; case o: - N = ue / r; + L = ue / r; break; default: - N = ue; + L = ue; } - return S ? N : D.a(N); - }, b.daysInMonth = function() { + return k ? L : q.a(L); + }, w.daysInMonth = function() { return this.endOf(p).$D; - }, b.$locale = function() { + }, w.$locale = function() { return Y[this.$L]; - }, b.locale = function(w, C) { - if (!w) + }, w.locale = function(b, C) { + if (!b) return this.$L; - var S = this.clone(), N = G(w, C, !0); - return N && (S.$L = N), S; - }, b.clone = function() { - return D.w(this.$d, this); - }, b.toDate = function() { + var k = this.clone(), L = G(b, C, !0); + return L && (k.$L = L), k; + }, w.clone = function() { + return q.w(this.$d, this); + }, w.toDate = function() { return new Date(this.valueOf()); - }, b.toJSON = function() { + }, w.toJSON = function() { return this.isValid() ? this.toISOString() : null; - }, b.toISOString = function() { + }, w.toISOString = function() { return this.$d.toISOString(); - }, b.toString = function() { + }, w.toString = function() { return this.$d.toUTCString(); }, E; }(), A = g.prototype; return X.prototype = A, [["$ms", i], ["$s", o], ["$m", a], ["$H", l], ["$W", f], ["$M", p], ["$y", y], ["$D", v]].forEach(function(E) { - A[E[1]] = function(b) { - return this.$g(b, E[0], E[1]); + A[E[1]] = function(w) { + return this.$g(w, E[0], E[1]); }; - }), X.extend = function(E, b) { - return E.$i || (E(b, g, X), E.$i = !0), X; - }, X.locale = G, X.isDayjs = B, X.unix = function(E) { + }), X.extend = function(E, w) { + return E.$i || (E(w, g, X), E.$i = !0), X; + }, X.locale = G, X.isDayjs = j, X.unix = function(E) { return X(1e3 * E); - }, X.en = Y[$], X.Ls = Y, X.p = {}, X; + }, X.en = Y[P], X.Ls = Y, X.p = {}, X; }); })(ua); var Wu = ua.exports; @@ -8780,9 +8781,9 @@ const Ju = hn("Send", [ const Zu = hn("X", [ ["path", { d: "M18 6 6 18", key: "1bl5f8" }], ["path", { d: "m6 6 12 12", key: "d8bk6v" }] -]), eh = cn((t) => /* @__PURE__ */ R.jsx("slot", { children: /* @__PURE__ */ R.jsx("div", { className: t.v0, children: /* @__PURE__ */ R.jsxs("div", { className: t.v1, children: [ - /* @__PURE__ */ R.jsx("span", { className: t.v2, children: t.v3 }), - /* @__PURE__ */ R.jsxs("div", { className: t.v4, style: t.v5, children: [ +]), eh = cn((t) => /* @__PURE__ */ T.jsx("slot", { children: /* @__PURE__ */ T.jsx("div", { className: t.v0, children: /* @__PURE__ */ T.jsxs("div", { className: t.v1, children: [ + /* @__PURE__ */ T.jsx("span", { className: t.v2, children: t.v3 }), + /* @__PURE__ */ T.jsxs("div", { className: t.v4, style: t.v5, children: [ t.v6, t.v7 ] }) @@ -8800,7 +8801,7 @@ const Zu = hn("X", [ } = kt(), i = t.isBot; return ( /*@million jsx-skip*/ - /* @__PURE__ */ R.jsx(eh, { v0: ft("flex min-h-9 justify-end pl-8", { + /* @__PURE__ */ T.jsx(eh, { v0: ft("flex min-h-9 justify-end pl-8", { "justify-start pr-8 pl-0": i }), v1: ft("flex flex-col gap-1 w-full items-end", { "items-start": i @@ -8957,7 +8958,7 @@ const mi = (t) => typeof t == "boolean" ? "".concat(t) : t === 0 ? "0" : t, bi = ...s }, i) => { const o = n ? ha : "button"; - return /* @__PURE__ */ R.jsx(o, { className: ft(ch({ + return /* @__PURE__ */ T.jsx(o, { className: ft(ch({ variant: e, size: r, className: t @@ -8971,9 +8972,9 @@ const lh = ({ handleSendMessage: e, customStyles: r } = kt(), n = r != null && r.color ? os(r.color) : null; - return /* @__PURE__ */ R.jsxs("div", { className: "space-y-2", "data-buttons": !0, children: [ - /* @__PURE__ */ R.jsx(fn, { message: t }), - /* @__PURE__ */ R.jsx("div", { className: "flex gap-1 items-center w-[80%] justify-center flex-wrap mx-auto", children: t.template.data.map((s) => /* @__PURE__ */ R.jsx(dn, { variant: "message", size: "sm", onClick: () => { + return /* @__PURE__ */ T.jsxs("div", { className: "space-y-2", "data-buttons": !0, children: [ + /* @__PURE__ */ T.jsx(fn, { message: t }), + /* @__PURE__ */ T.jsx("div", { className: "flex gap-1 items-center w-[80%] justify-center flex-wrap mx-auto", children: t.template.data.map((s) => /* @__PURE__ */ T.jsx(dn, { variant: "message", size: "sm", onClick: () => { if (s.type === "postback") { if (!s.payload) return; @@ -8992,10 +8993,10 @@ const lh = ({ "--primary": n ? `${n.h} ${n.s}% ${n.l}%` : void 0 }, children: s.title })) }) ] }); -}, uh = cn((t) => /* @__PURE__ */ R.jsxs("div", { className: "w-full space-y-1 text-center", children: [ - /* @__PURE__ */ R.jsx("img", { src: t.v0, alt: t.v1, className: "rounded-md object-cover h-full w-full" }), - /* @__PURE__ */ R.jsx("h3", { className: "font-semibold", children: t.v2 }), - /* @__PURE__ */ R.jsx("p", { className: "text-sm", children: t.v3 }), +}, uh = cn((t) => /* @__PURE__ */ T.jsxs("div", { className: "w-full space-y-1 text-center", children: [ + /* @__PURE__ */ T.jsx("img", { src: t.v0, alt: t.v1, className: "rounded-md object-cover h-full w-full" }), + /* @__PURE__ */ T.jsx("h3", { className: "font-semibold", children: t.v2 }), + /* @__PURE__ */ T.jsx("p", { className: "text-sm", children: t.v3 }), t.v4 ] }), { name: "Card_1", @@ -9009,7 +9010,7 @@ const lh = ({ } = kt(), n = r != null && r.color ? os(r.color) : null; return ( /*@million jsx-skip*/ - /* @__PURE__ */ R.jsx(uh, { v0: t.image_url, v1: t.title, v2: t.title, v3: t.subtitle, v4: t.buttons && t.buttons.length > 0 && /* @__PURE__ */ R.jsx("div", { className: "w-full mt-2", children: t.buttons.map((s, i) => /* @__PURE__ */ R.jsx(dn, { variant: "message", className: "!rounded-md w-full", onClick: () => { + /* @__PURE__ */ T.jsx(uh, { v0: t.image_url, v1: t.title, v2: t.title, v3: t.subtitle, v4: t.buttons && t.buttons.length > 0 && /* @__PURE__ */ T.jsx("div", { className: "w-full mt-2", children: t.buttons.map((s, i) => /* @__PURE__ */ T.jsx(dn, { variant: "message", className: "!rounded-md w-full", onClick: () => { if (s.type === "postback") { if (!s.payload) return; @@ -9030,16 +9031,16 @@ const lh = ({ ); }, fh = ({ message: t -}) => /* @__PURE__ */ R.jsx("div", { className: "flex flex-col space-y-2 gap-1", children: t.template.data.map((e, r) => /* @__PURE__ */ R.jsx(fn, { message: t, children: /* @__PURE__ */ R.jsx(hh, { card: e }) }, r)) }), dh = () => /* @__PURE__ */ R.jsx(fn, { message: { +}) => /* @__PURE__ */ T.jsx("div", { className: "flex flex-col space-y-2 gap-1", children: t.template.data.map((e, r) => /* @__PURE__ */ T.jsx(fn, { message: t, children: /* @__PURE__ */ T.jsx(hh, { card: e }) }, r)) }), dh = () => /* @__PURE__ */ T.jsx(fn, { message: { isBot: !0, message: "", template: {}, userId: "typing", createdAt: (/* @__PURE__ */ new Date()).toISOString() -}, children: /* @__PURE__ */ R.jsxs("div", { className: "flex space-x-1 h-full flex-1 items-center", children: [ - /* @__PURE__ */ R.jsx("div", { className: "w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.3s]" }), - /* @__PURE__ */ R.jsx("div", { className: "w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.15s]" }), - /* @__PURE__ */ R.jsx("div", { className: "w-1 h-1 bg-neutral-800 rounded-full animate-bounce" }) +}, children: /* @__PURE__ */ T.jsxs("div", { className: "flex space-x-1 h-full flex-1 items-center", children: [ + /* @__PURE__ */ T.jsx("div", { className: "w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.3s]" }), + /* @__PURE__ */ T.jsx("div", { className: "w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.15s]" }), + /* @__PURE__ */ T.jsx("div", { className: "w-1 h-1 bg-neutral-800 rounded-full animate-bounce" }) ] }) }), ph = () => { const t = Ae(null), { messages: e, @@ -9052,22 +9053,22 @@ const lh = ({ }, [e]); const n = (s, i) => { var o, a; - return (s == null ? void 0 : s.userId) === "typing" ? /* @__PURE__ */ R.jsx(dh, {}) : ((o = s == null ? void 0 : s.template) == null ? void 0 : o.type) === "list-button" ? /* @__PURE__ */ R.jsx(lh, { message: s }, `${s.createdAt}+${i}`) : ((a = s == null ? void 0 : s.template) == null ? void 0 : a.type) === "list-card" ? /* @__PURE__ */ R.jsx(fh, { message: s }, `${s.createdAt}+${i}`) : /* @__PURE__ */ R.jsx(fn, { message: s }, `${s.createdAt}+${i}`); + return (s == null ? void 0 : s.userId) === "typing" ? /* @__PURE__ */ T.jsx(dh, {}) : ((o = s == null ? void 0 : s.template) == null ? void 0 : o.type) === "list-button" ? /* @__PURE__ */ T.jsx(lh, { message: s }, `${s.createdAt}+${i}`) : ((a = s == null ? void 0 : s.template) == null ? void 0 : a.type) === "list-card" ? /* @__PURE__ */ T.jsx(fh, { message: s }, `${s.createdAt}+${i}`) : /* @__PURE__ */ T.jsx(fn, { message: s }, `${s.createdAt}+${i}`); }; - return /* @__PURE__ */ R.jsx("div", { className: "p-2 flex-1 pr-3 overflow-y-auto", children: r ? /* @__PURE__ */ R.jsx("div", { children: /* @__PURE__ */ R.jsx(Gu, { className: "animate-spin w-4 h-4" }) }) : /* @__PURE__ */ R.jsxs("div", { className: "flex flex-col gap-1", children: [ - e.length > 0 && /* @__PURE__ */ R.jsx("div", { className: "text-center text-xs text-neutral-500 py-2", children: qr(e[0].createdAt).format("DD/MM/YYYY HH:mm") }), - e.map((s, i) => /* @__PURE__ */ R.jsxs(Et, { children: [ - i > 0 && qr(s.createdAt).diff(qr(e[i - 1].createdAt), "minutes") > 10 && /* @__PURE__ */ R.jsx("div", { className: "text-center text-xs text-neutral-500 py-2", children: qr(s.createdAt).format("DD/MM/YYYY HH:mm") }), + return /* @__PURE__ */ T.jsx("div", { className: "p-2 flex-1 pr-3 overflow-y-auto", children: r ? /* @__PURE__ */ T.jsx("div", { children: /* @__PURE__ */ T.jsx(Gu, { className: "animate-spin w-4 h-4" }) }) : /* @__PURE__ */ T.jsxs("div", { className: "flex flex-col gap-1", children: [ + e.length > 0 && /* @__PURE__ */ T.jsx("div", { className: "text-center text-xs text-neutral-500 py-2", children: qr(e[0].createdAt).format("DD/MM/YYYY HH:mm") }), + e.map((s, i) => /* @__PURE__ */ T.jsxs(Et, { children: [ + i > 0 && qr(s.createdAt).diff(qr(e[i - 1].createdAt), "minutes") > 10 && /* @__PURE__ */ T.jsx("div", { className: "text-center text-xs text-neutral-500 py-2", children: qr(s.createdAt).format("DD/MM/YYYY HH:mm") }), n(s, i) ] }, i)), - /* @__PURE__ */ R.jsx("div", { ref: t }) + /* @__PURE__ */ T.jsx("div", { ref: t }) ] }) }); -}, yh = cn((t) => /* @__PURE__ */ R.jsx("header", { className: "flex items-center bg-primary select-none h-[3.75rem]", style: t.v0, children: /* @__PURE__ */ R.jsxs("div", { className: "flex items-center px-2 gap-2 justify-between w-full", children: [ - /* @__PURE__ */ R.jsxs("div", { className: "flex items-center p-2 gap-2", children: [ +}, yh = cn((t) => /* @__PURE__ */ T.jsx("header", { className: "flex items-center bg-primary select-none h-[3.75rem]", style: t.v0, children: /* @__PURE__ */ T.jsxs("div", { className: "flex items-center px-2 gap-2 justify-between w-full", children: [ + /* @__PURE__ */ T.jsxs("div", { className: "flex items-center p-2 gap-2", children: [ t.v1, - /* @__PURE__ */ R.jsx("span", { className: "font-medium text-white", children: t.v2 }) + /* @__PURE__ */ T.jsx("span", { className: "font-medium text-white", children: t.v2 }) ] }), - /* @__PURE__ */ R.jsxs("div", { className: "flex items-center gap-3", children: [ + /* @__PURE__ */ T.jsxs("div", { className: "flex items-center gap-3", children: [ t.v3, t.v4 ] }) @@ -9084,15 +9085,15 @@ const lh = ({ } = kt(); return ( /*@million jsx-skip*/ - /* @__PURE__ */ R.jsx(yh, { v0: { + /* @__PURE__ */ T.jsx(yh, { v0: { backgroundColor: n == null ? void 0 : n.color - }, v1: n != null && n.logoUrl ? /* @__PURE__ */ R.jsx("img", { src: n == null ? void 0 : n.logoUrl, alt: "logo", className: "w-10 h-10 rounded-full overflow-hidden object-cover" }) : /* @__PURE__ */ R.jsx("svg", { width: "40", height: "40", className: "text-neutral-700 fill-neutral-700 bg-neutral-700 rounded-full", children: /* @__PURE__ */ R.jsx("text", { "text-anchor": "middle", x: "50%", y: "50%", dy: "0.35em", fill: "#ffffff", "font-size": "1rem", children: "B" }) }), v2: (n == null ? void 0 : n.name) || "DialogueBot", v3: !s && /* @__PURE__ */ R.jsx("div", { className: "w-6 h-6 flex items-center justify-center cursor-pointer", onClick: r, children: /* @__PURE__ */ R.jsx(Xu, { className: "w-4 h-4 text-white" }) }), v4: e && /* @__PURE__ */ R.jsx("div", { className: "w-6 h-6 flex items-center justify-center cursor-pointer", onClick: t, children: /* @__PURE__ */ R.jsx(Zu, { className: "w-4 h-4 text-white" }) }) }) + }, v1: n != null && n.logoUrl ? /* @__PURE__ */ T.jsx("img", { src: n == null ? void 0 : n.logoUrl, alt: "logo", className: "w-10 h-10 rounded-full overflow-hidden object-cover" }) : /* @__PURE__ */ T.jsx("svg", { width: "40", height: "40", className: "text-neutral-700 fill-neutral-700 bg-neutral-700 rounded-full", children: /* @__PURE__ */ T.jsx("text", { "text-anchor": "middle", x: "50%", y: "50%", dy: "0.35em", fill: "#ffffff", "font-size": "1rem", children: "B" }) }), v2: (n == null ? void 0 : n.name) || "DialogueBot", v3: !s && /* @__PURE__ */ T.jsx("div", { className: "w-6 h-6 flex items-center justify-center cursor-pointer", onClick: r, children: /* @__PURE__ */ T.jsx(Xu, { className: "w-4 h-4 text-white" }) }), v4: e && /* @__PURE__ */ T.jsx("div", { className: "w-6 h-6 flex items-center justify-center cursor-pointer", onClick: t, children: /* @__PURE__ */ T.jsx(Zu, { className: "w-4 h-4 text-white" }) }) }) ); }, da = we.forwardRef(({ className: t, type: e, ...r -}, n) => /* @__PURE__ */ R.jsx("input", { type: e, className: ft("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", t), ref: n, ...r })); +}, n) => /* @__PURE__ */ T.jsx("input", { type: e, className: ft("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", t), ref: n, ...r })); da.displayName = "Input"; const mh = () => { const { @@ -9104,22 +9105,22 @@ const mh = () => { message: n }), s("")); }, o = r != null && r.color ? os(r.color) : null; - return /* @__PURE__ */ R.jsxs("div", { className: "flex items-center py-2 px-3 gap-2 border-input border-t", children: [ - /* @__PURE__ */ R.jsx(da, { className: "flex-1", placeholder: "Type a message...", value: n, onChange: (a) => s(a.target.value), onKeyDown: i, disabled: e, style: { + return /* @__PURE__ */ T.jsxs("div", { className: "flex items-center py-2 px-3 gap-2 border-input border-t", children: [ + /* @__PURE__ */ T.jsx(da, { className: "flex-1", placeholder: "Type a message...", value: n, onChange: (a) => s(a.target.value), onKeyDown: i, disabled: e, style: { "--primary": o ? `${o.h} ${o.s}% ${o.l}%` : void 0 } }), - /* @__PURE__ */ R.jsx(dn, { size: "icon", className: "flex-shrink-0", onClick: () => { + /* @__PURE__ */ T.jsx(dn, { size: "icon", className: "flex-shrink-0", onClick: () => { t({ message: n, cb: () => s("") }); }, disabled: e, style: { "--primary": o ? `${o.h} ${o.s}% ${o.l}%` : void 0 - }, children: /* @__PURE__ */ R.jsx(Ju, { className: "w-4 h-4" }) }) + }, children: /* @__PURE__ */ T.jsx(Ju, { className: "w-4 h-4" }) }) ] }); -}, bh = new sl(), vh = cn((t) => /* @__PURE__ */ R.jsx("div", { className: t.v0, style: t.v1, children: /* @__PURE__ */ R.jsxs("div", { className: "flex flex-col h-full overflow-hidden w-full flex-1", children: [ +}, bh = new sl(), vh = cn((t) => /* @__PURE__ */ T.jsx("div", { className: t.v0, style: t.v1, children: /* @__PURE__ */ T.jsxs("div", { className: "flex flex-col h-full overflow-hidden w-full flex-1", children: [ t.v2, - /* @__PURE__ */ R.jsxs("div", { className: "flex-1 flex flex-col min-h-[1px]", children: [ + /* @__PURE__ */ T.jsxs("div", { className: "flex-1 flex flex-col min-h-[1px]", children: [ t.v3, t.v4 ] }) @@ -9135,12 +9136,12 @@ const mh = () => { } = kt(); return ( /*@million jsx-skip*/ - /* @__PURE__ */ R.jsx(vh, { v0: ft("select-none w-full h-screen flex flex-col shadow chatbox", t), v1: { + /* @__PURE__ */ T.jsx(vh, { v0: ft("select-none w-full h-screen flex flex-col shadow chatbox", t), v1: { width: e == null ? void 0 : e.windowSize.width, height: e == null ? void 0 : e.windowSize.height - }, v2: /* @__PURE__ */ R.jsx(gh, {}), v3: /* @__PURE__ */ R.jsx(ph, {}), v4: !r && /* @__PURE__ */ R.jsx(mh, {}) }) + }, v2: /* @__PURE__ */ T.jsx(gh, {}), v3: /* @__PURE__ */ T.jsx(ph, {}), v4: !r && /* @__PURE__ */ T.jsx(mh, {}) }) ); -}, Oh = (t) => /* @__PURE__ */ R.jsx(cl, { client: bh, children: /* @__PURE__ */ R.jsx(du, { ...t, children: /* @__PURE__ */ R.jsx(wh, { className: t.className }) }) }); +}, Oh = (t) => /* @__PURE__ */ T.jsx(cl, { client: bh, children: /* @__PURE__ */ T.jsx(du, { ...t, children: /* @__PURE__ */ T.jsx(wh, { className: t.className }) }) }); export { Oh as ChatBox }; diff --git a/dist-components/index.es.js.map b/dist-components/index.es.js.map index b287f15..c2d101f 100644 --- a/dist-components/index.es.js.map +++ b/dist-components/index.es.js.map @@ -1 +1 @@ -{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../node_modules/million/dist/shared/million.fb41761f.mjs","../node_modules/million/dist/packages/experimental.mjs","../node_modules/million/dist/shared/million.9efd57f2.mjs","../node_modules/million/dist/packages/react.mjs","../src/constants/index.ts","../node_modules/@noble/hashes/_assert.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/crypto.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/sha3.js","../node_modules/@paralleldrive/cuid2/src/index.js","../node_modules/@paralleldrive/cuid2/index.js","../src/utils/index.ts","../node_modules/@tanstack/query-core/build/modern/subscribable.js","../node_modules/@tanstack/query-core/build/modern/utils.js","../node_modules/@tanstack/query-core/build/modern/focusManager.js","../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../node_modules/@tanstack/query-core/build/modern/retryer.js","../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../node_modules/@tanstack/query-core/build/modern/removable.js","../node_modules/@tanstack/query-core/build/modern/query.js","../node_modules/@tanstack/query-core/build/modern/queryCache.js","../node_modules/@tanstack/query-core/build/modern/mutation.js","../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../node_modules/@tanstack/query-core/build/modern/queryClient.js","../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../node_modules/@tanstack/react-query/build/modern/isRestoring.js","../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../node_modules/@tanstack/react-query/build/modern/utils.js","../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../node_modules/@tanstack/react-query/build/modern/suspense.js","../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../node_modules/@tanstack/react-query/build/modern/useQuery.js","../node_modules/engine.io-parser/build/esm/commons.js","../node_modules/engine.io-parser/build/esm/encodePacket.browser.js","../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js","../node_modules/engine.io-parser/build/esm/decodePacket.browser.js","../node_modules/engine.io-parser/build/esm/index.js","../node_modules/@socket.io/component-emitter/index.mjs","../node_modules/engine.io-client/build/esm/globalThis.browser.js","../node_modules/engine.io-client/build/esm/util.js","../node_modules/engine.io-client/build/esm/contrib/parseqs.js","../node_modules/engine.io-client/build/esm/transport.js","../node_modules/engine.io-client/build/esm/contrib/yeast.js","../node_modules/engine.io-client/build/esm/contrib/has-cors.js","../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js","../node_modules/engine.io-client/build/esm/transports/polling.js","../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js","../node_modules/engine.io-client/build/esm/transports/websocket.js","../node_modules/engine.io-client/build/esm/transports/webtransport.js","../node_modules/engine.io-client/build/esm/transports/index.js","../node_modules/engine.io-client/build/esm/contrib/parseuri.js","../node_modules/engine.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/url.js","../node_modules/socket.io-parser/build/esm/is-binary.js","../node_modules/socket.io-parser/build/esm/binary.js","../node_modules/socket.io-parser/build/esm/index.js","../node_modules/socket.io-client/build/esm/on.js","../node_modules/socket.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/contrib/backo2.js","../node_modules/socket.io-client/build/esm/manager.js","../node_modules/socket.io-client/build/esm/index.js","../node_modules/lodash.debounce/index.js","../node_modules/usehooks-ts/dist/index.js","../src/context/socket.ctx.tsx","../src/hooks/useSocket.ts","../node_modules/clsx/dist/clsx.mjs","../node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/lib/utils.ts","../node_modules/dayjs/dayjs.min.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/loader-circle.js","../node_modules/lucide-react/dist/esm/icons/refresh-ccw.js","../node_modules/lucide-react/dist/esm/icons/send.js","../node_modules/lucide-react/dist/esm/icons/x.js","../src/components/message.tsx","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/components/ui/button.tsx","../src/components/buttons-message.tsx","../src/components/cards-message.tsx","../src/components/typing-message.tsx","../src/components/body.tsx","../src/components/header.tsx","../src/components/ui/input.tsx","../src/components/send-area.tsx","../src/chatbox/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use client';\nconst Object$ = Object;\nconst Map$ = Map;\nconst Set$ = Set;\nconst SetHas$ = Set$.prototype.has;\nconst SetAdd$ = Set$.prototype.add;\nconst MapHas$ = Map$.prototype.has;\nconst MapGet$ = Map$.prototype.get;\nconst MapSet$ = Map$.prototype.set;\nconst ChildFlag = 1;\nconst AttributeFlag = 2;\nconst EventFlag = 4;\nconst StyleAttributeFlag = 8;\nconst SvgAttributeFlag = 16;\nconst BlockFlag = 32;\nconst TEXT_NODE_CACHE = \"__t\";\nconst EVENT_PATCH = \"__p\";\nconst EVENTS_REGISTRY = \"__e\";\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\nconst XLINK_NS = \"http://www.w3.org/1999/xlink\";\nconst XML_NS = \"http://www.w3.org/2000/xmlns/\";\nconst X_CHAR = 120;\nconst NON_PROPS = new Set$([\"href\", \"list\", \"form\", \"tabIndex\", \"download\"]);\nconst VOID_ELEMENTS = new Set$([\"area\", \"base\", \"basefont\", \"bgsound\", \"br\", \"col\", \"command\", \"embed\", \"frame\", \"hr\", \"image\", \"img\", \"input\", \"isindex\", \"keygen\", \"link\", \"menuitem\", \"meta\", \"nextid\", \"param\", \"source\", \"track\", \"wbr\"]);\n\nif (typeof window === \"undefined\") {\n throw new Error(\n \"See http://million.dev/docs/install to install the compiler.\"\n );\n}\nconst document$ = document;\ndocument$.createElement(\"template\");\nconst HTM_TEMPLATE = /* @__PURE__ */ document$.createElement(\"template\");\nconst HTM_TEMPLATE_CONTENT = HTM_TEMPLATE.content;\nconst SVG_TEMPLATE = /* @__PURE__ */ document$.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"svg\"\n);\nconst node$ = Node.prototype;\nconst element$ = Element.prototype;\nconst characterData$ = CharacterData.prototype;\nconst getOwnPropertyDescriptor$ = Object$.getOwnPropertyDescriptor;\nconst insertBefore$ = node$.insertBefore;\nconst cloneNode$ = node$.cloneNode;\nconst replaceChild$ = node$.replaceChild;\nconst remove$$1 = element$.remove;\nconst addEventListener$ = node$.addEventListener;\nconst removeAttribute$ = element$.removeAttribute;\nconst setAttribute$ = element$.setAttribute;\nconst setAttributeNS$ = element$.setAttributeNS;\nconst setTextContent$ = getOwnPropertyDescriptor$(node$, \"textContent\").set;\nconst firstChild$ = getOwnPropertyDescriptor$(node$, \"firstChild\").get;\nconst nextSibling$ = getOwnPropertyDescriptor$(node$, \"nextSibling\").get;\nconst characterDataSet$ = getOwnPropertyDescriptor$(\n characterData$,\n \"data\"\n).set;\nconst stringToDOM = (content, svg) => {\n const template = svg ? SVG_TEMPLATE : HTM_TEMPLATE;\n template.innerHTML = content;\n const dom = svg ? SVG_TEMPLATE : HTM_TEMPLATE_CONTENT;\n return dom.firstChild;\n};\ndocument$[EVENTS_REGISTRY] = new Set$();\nconst createEventListener = (el, name, value) => {\n let event = name.toLowerCase();\n let capture = false;\n if (event.endsWith(\"capture\")) {\n event = event.slice(0, -7);\n capture = true;\n }\n const key = `$$${event}`;\n if (!SetHas$.call(document$[EVENTS_REGISTRY], event)) {\n addEventListener$.call(\n document$,\n event,\n (nativeEvent) => {\n let el2 = nativeEvent.target;\n while (el2) {\n const handler = el2[key];\n if (handler) {\n Object$.defineProperty(nativeEvent, \"currentTarget\", {\n configurable: true,\n get() {\n return el2;\n }\n });\n handler(nativeEvent);\n }\n el2 = el2.parentNode;\n }\n },\n { capture }\n );\n SetAdd$.call(document$[EVENTS_REGISTRY], event);\n }\n const patch = (newValue) => {\n if (!newValue) {\n el[key] = null;\n } else if (!(\"key\" in newValue && newValue.key === el[key]?.key)) {\n el[key] = newValue;\n }\n };\n patch(value);\n return patch;\n};\nconst childAt = (el, index) => {\n let child = firstChild$.call(el);\n if (index) {\n for (let j = 0; j < index; ++j) {\n if (!child)\n break;\n child = nextSibling$.call(child);\n }\n }\n return child;\n};\nconst visitedNodes = /* @__PURE__ */ new WeakSet();\nconst removeComments = (el) => {\n if (visitedNodes.has(el)) {\n return;\n }\n if (el.nodeType === 8) {\n el.parentNode?.removeChild(el);\n }\n let child = firstChild$.call(el);\n while (child) {\n removeComments(child);\n child = child.nextSibling;\n }\n visitedNodes.add(el);\n};\nconst insertText = (el, value, index) => {\n const node = document$.createTextNode(value);\n const child = childAt(el, index);\n insertBefore$.call(el, node, child);\n return node;\n};\nconst setText = (el, value) => {\n characterDataSet$.call(el, value);\n};\nconst setStyleAttribute = (el, name, value) => {\n if (typeof value !== \"number\" || IS_NON_DIMENSIONAL.test(name)) {\n el.style[name] = value;\n } else if (typeof value === \"string\") {\n el.style.cssText = value;\n } else if (name.startsWith(\"-\")) {\n el.style.setProperty(name, String(value));\n } else if (value === void 0 || value === null) {\n el.style[name] = \"\";\n } else {\n el.style[name] = `${String(value)}px`;\n }\n};\nconst setSvgAttribute = (el, name, value) => {\n name = name.replace(/xlink(?:H|:h)/, \"h\").replace(/sName$/, \"s\");\n if (name.startsWith(\"xmlns\")) {\n setAttributeNS$.call(el, XML_NS, name, String(value));\n } else if (name.startsWith(\"xlink\")) {\n setAttributeNS$.call(el, XLINK_NS, \"href\", String(value));\n }\n};\nconst setAttribute = (el, name, value) => {\n const isValueNully = value === void 0 || value === null;\n value = isValueNully ? \"\" : value;\n if (name in el && el[name] !== void 0 && el[name] !== null && !(el instanceof SVGElement) && SetHas$.call(NON_PROPS, name)) {\n try {\n el[name] = value;\n } catch (_err) {\n }\n } else if (!isValueNully && value !== \"\" && (value !== false || name.includes(\"-\"))) {\n setAttribute$.call(el, name, String(value));\n } else {\n removeAttribute$.call(el, name);\n }\n const isInput = el instanceof HTMLInputElement;\n const isSelect = el instanceof HTMLSelectElement;\n const isTextArea = el instanceof HTMLTextAreaElement;\n if (name === \"value\" && (isInput || isSelect || isTextArea)) {\n setAttribute$.call(el, name, String(value));\n el.value = value;\n }\n};\n\nvar __defProp$1 = Object.defineProperty;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField$1 = (obj, key, value) => {\n __defNormalProp$1(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass AbstractBlock {\n constructor() {\n /* root */\n __publicField$1(this, \"r\");\n /* edits */\n __publicField$1(this, \"e\");\n /* el */\n __publicField$1(this, \"l\");\n /* getElements */\n __publicField$1(this, \"g\");\n /* _shouldUpdate */\n __publicField$1(this, \"_u\");\n /* _parent */\n __publicField$1(this, \"_t\");\n /* props */\n __publicField$1(this, \"d\");\n /* key */\n __publicField$1(this, \"k\");\n /* cache */\n __publicField$1(this, \"c\");\n }\n}\n\nconst renderToTemplate = (vnode, edits = [], path = []) => {\n if (typeof vnode === \"string\")\n return vnode;\n if (typeof vnode === \"number\" || typeof vnode === \"bigint\" || vnode === true) {\n return String(vnode);\n }\n if (vnode === null || vnode === void 0 || vnode === false)\n return \"\";\n if (typeof vnode === \"object\" && \"$\" in vnode) {\n edits.push({\n p: path,\n e: [\n {\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: vnode.$,\n /* index */\n i: 0,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n }\n ],\n i: []\n });\n return \"\";\n }\n let props = \"\";\n let children = \"\";\n const current = {\n p: path,\n // The location of the edit in in the virtual node tree\n e: [],\n // Occur on mount + patch\n i: []\n // Occur before mount\n };\n for (let name in vnode.props) {\n const value = vnode.props[name];\n if (name === \"key\" || name === \"ref\" || name === \"children\") {\n continue;\n }\n if (name === \"className\")\n name = \"class\";\n if (name === \"htmlFor\")\n name = \"for\";\n if (name.startsWith(\"on\")) {\n const isValueHole = \"$\" in value;\n if (isValueHole) {\n current.e.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.i.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i: null,\n /* listener */\n l: value,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (value) {\n if (typeof value === \"object\" && \"$\" in value) {\n if (name === \"style\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else if (name.charCodeAt(0) === X_CHAR) {\n current.e.push({\n /* type */\n t: SvgAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.e.push({\n /* type */\n t: AttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (name === \"style\" && typeof value === \"object\") {\n let style = \"\";\n for (const key in value) {\n if (typeof value[key] === \"object\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: key,\n /* value */\n v: null,\n /* hole */\n h: value[key].$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n let kebabKey = \"\";\n for (let i = 0, j = key.length; i < j; ++i) {\n const char = key.charCodeAt(i);\n if (char < 97) {\n kebabKey += `-${String.fromCharCode(char + 32)}`;\n } else {\n kebabKey += key[i];\n }\n }\n style += `${kebabKey}:${String(value[key])};`;\n }\n props += ` style=\"${style}\"`;\n continue;\n }\n props += ` ${name}=\"${String(value)}\"`;\n }\n }\n if (SetHas$.call(VOID_ELEMENTS, vnode.type)) {\n if (current.e.length)\n edits.push(current);\n return `<${vnode.type}${props} />`;\n }\n let canMergeString = false;\n for (let i = 0, j = vnode.props.children?.length || 0, k = 0; i < j; ++i) {\n const child = vnode.props.children?.[i];\n if (child === null || child === void 0 || child === false)\n continue;\n if (typeof child === \"object\" && \"$\" in child) {\n current.e.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: child.$,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n if (child instanceof AbstractBlock) {\n current.i.push({\n /* type */\n t: BlockFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: child\n });\n continue;\n }\n if (typeof child === \"string\" || typeof child === \"number\" || typeof child === \"bigint\") {\n const value = typeof child === \"number\" || typeof child === \"bigint\" ? String(child) : child;\n if (canMergeString) {\n current.i.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: value,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n canMergeString = true;\n children += value;\n k++;\n continue;\n }\n canMergeString = false;\n const newPath = path.slice();\n newPath.push(k++);\n children += renderToTemplate(child, edits, newPath);\n }\n if (current.i.length || current.e.length)\n edits.push(current);\n return `<${vnode.type}${props}>${children}`;\n};\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nconst mapArray = (children) => {\n return new ArrayBlock(children);\n};\nclass ArrayBlock extends AbstractBlock {\n constructor(children) {\n super();\n __publicField(this, \"b\");\n this.b = children;\n }\n v() {\n }\n p(fragment) {\n const oldChildren = this.b;\n const newChildren = fragment.b;\n const oldChildrenLength = oldChildren.length;\n const newChildrenLength = newChildren.length;\n const parent = this.t();\n if (this === fragment)\n return parent;\n if (newChildrenLength === 0 && oldChildrenLength === 0)\n return parent;\n this.b = newChildren;\n if (newChildrenLength === 0) {\n arrayRemove$.call(this);\n return parent;\n }\n if (oldChildrenLength === 0) {\n arrayMount$.call(fragment, parent);\n return parent;\n }\n let oldHead = 0;\n let newHead = 0;\n let oldTail = oldChildrenLength - 1;\n let newTail = newChildrenLength - 1;\n let oldHeadChild = oldChildren[0];\n let newHeadChild = newChildren[0];\n let oldTailChild = oldChildren[oldTail];\n let newTailChild = newChildren[newTail];\n let oldKeyMap;\n while (oldHead <= oldTail && newHead <= newTail) {\n if (!oldHeadChild) {\n oldHeadChild = oldChildren[++oldHead];\n continue;\n }\n if (!oldTailChild) {\n oldTailChild = oldChildren[--oldTail];\n continue;\n }\n const oldHeadKey = oldHeadChild.k;\n const newHeadKey = newHeadChild.k;\n if (oldHeadKey === newHeadKey) {\n patch$.call(oldHeadChild, newHeadChild);\n newChildren[newHead] = oldHeadChild;\n oldHeadChild = oldChildren[++oldHead];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n const oldTailKey = oldTailChild.k;\n const newTailKey = newTailChild.k;\n if (oldTailKey === newTailKey) {\n patch$.call(oldTailChild, newTailChild);\n newChildren[newTail] = oldTailChild;\n oldTailChild = oldChildren[--oldTail];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldHeadKey === newTailKey) {\n patch$.call(oldHeadChild, newTailChild);\n newChildren[newTail] = oldHeadChild;\n const nextChild = newChildren[newTail + 1];\n move$.call(oldHeadChild, nextChild, nextChild?.l || null);\n oldHeadChild = oldChildren[++oldHead];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldTailKey === newHeadKey) {\n patch$.call(oldTailChild, newHeadChild);\n newChildren[newHead] = oldTailChild;\n const nextChild = oldChildren[oldHead];\n move$.call(oldTailChild, nextChild, nextChild?.l || null);\n oldTailChild = oldChildren[--oldTail];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n if (!oldKeyMap) {\n oldKeyMap = new Map$();\n for (let i = oldHead; i <= oldTail; i++) {\n MapSet$.call(oldKeyMap, oldChildren[i].k, i);\n }\n }\n const oldIndex = oldKeyMap.get(newHeadKey);\n if (oldIndex === void 0) {\n mount$.call(newHeadChild, parent, oldHeadChild.l || null);\n } else {\n const oldChild = oldChildren[oldIndex];\n move$.call(oldChild, oldHeadChild, null);\n patch$.call(oldChild, newHeadChild);\n newChildren[newHead] = oldChild;\n oldChildren[oldIndex] = null;\n }\n newHeadChild = newChildren[++newHead];\n }\n if (oldHead <= oldTail || newHead <= newTail) {\n if (oldHead > oldTail) {\n const nextChild = newChildren[newTail + 1];\n for (let i = newHead; i <= newTail; ++i) {\n mount$.call(newChildren[i], parent, nextChild ? nextChild.l : null);\n }\n } else {\n for (let i = oldHead; i <= oldTail; ++i) {\n remove$.call(oldChildren[i]);\n }\n }\n }\n return parent;\n }\n m(parent, refNode = null) {\n if (this._t)\n return this._t;\n for (let i = 0, j = this.b.length; i < j; ++i) {\n const block = this.b[i];\n mount$.call(block, parent, refNode);\n }\n this._t = parent;\n return parent;\n }\n x() {\n const parent = this.t();\n if (parent) {\n setTextContent$.call(parent, \"\");\n } else {\n for (let i = 0, j = this.b.length; i < j; ++i) {\n remove$.call(this.b[i]);\n }\n }\n this.b = [];\n }\n u() {\n return true;\n }\n s() {\n return this.b.map((block) => block.s()).join(\"\");\n }\n t() {\n if (!this._t)\n this._t = this.b[0].t();\n return this._t;\n }\n}\nconst array$ = ArrayBlock.prototype;\nconst arrayMount$ = array$.m;\nconst arrayPatch$ = array$.p;\nconst arrayRemove$ = array$.x;\n\nconst HOLE_PROXY = new Proxy(\n {},\n {\n // A universal getter will return a Hole instance if props[any] is accessed\n // Allows code to identify holes in virtual nodes (\"digs\" them out)\n get(_, key) {\n return { $: key };\n }\n }\n);\nconst block = (fn, unwrap, shouldUpdate, svg) => {\n const vnode = fn(HOLE_PROXY);\n const edits = [];\n const root = stringToDOM(\n renderToTemplate(unwrap ? unwrap(vnode) : vnode, edits),\n svg\n );\n removeComments(root);\n return (props, key, shouldUpdateCurrentBlock) => {\n return new Block(\n root,\n edits,\n props,\n key ?? props?.key ?? null,\n shouldUpdateCurrentBlock ?? shouldUpdate ?? null,\n null\n );\n };\n};\nconst mount = (block2, parent, hydrateNode) => {\n if (\"b\" in block2 && parent) {\n return arrayMount$.call(block2, parent, null);\n }\n return mount$.call(block2, parent, null, hydrateNode);\n};\nconst patch = (oldBlock, newBlock) => {\n if (\"b\" in oldBlock || \"b\" in newBlock) {\n arrayPatch$.call(oldBlock, newBlock);\n }\n if (!oldBlock.l)\n mount$.call(oldBlock, void 0, null, null);\n if (oldBlock.k && oldBlock.k === newBlock.k || oldBlock.r === newBlock.r) {\n return patch$.call(oldBlock, newBlock);\n }\n const el = mount$.call(newBlock, oldBlock.t(), oldBlock.l, null);\n remove$.call(oldBlock);\n oldBlock.k = newBlock.k;\n return el;\n};\nclass Block extends AbstractBlock {\n constructor(root, edits, props, key, shouldUpdate, getElements) {\n super();\n this.r = root;\n this.d = props;\n this.e = edits;\n this.k = key;\n this.c = Array(edits.length);\n if (shouldUpdate) {\n this._u = shouldUpdate;\n } else {\n this._u = null;\n }\n if (getElements) {\n this.g = getElements;\n } else {\n this.g = null;\n }\n }\n m(parent, refNode = null, hydrateNode) {\n if (this.l)\n return this.l;\n const root = hydrateNode ?? cloneNode$.call(this.r, true);\n const elements = this.g?.(root);\n if (elements)\n this.c = elements;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = elements?.[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const value = this.d[edit.h];\n if (edit.t & ChildFlag) {\n if (value instanceof AbstractBlock) {\n const child = childAt(el, edit.i);\n if (hydrateNode) {\n value.m(el, child, child);\n } else {\n value.m(el, child);\n }\n continue;\n }\n if (!el[TEXT_NODE_CACHE])\n el[TEXT_NODE_CACHE] = new Array(l);\n if (value && typeof value === \"object\" && \"foreign\" in value) {\n if (hydrateNode) {\n const child = childAt(el, edit.i);\n value.reset(child);\n }\n const targetEl = value.current;\n el[TEXT_NODE_CACHE][k] = targetEl;\n if (!hydrateNode) {\n insertBefore$.call(el, targetEl, childAt(el, edit.i));\n }\n continue;\n }\n if (hydrateNode) {\n el[TEXT_NODE_CACHE][k] = childAt(el, edit.i);\n continue;\n }\n el[TEXT_NODE_CACHE][k] = insertText(\n el,\n // eslint-disable-next-line eqeqeq\n value == null || value === false ? \"\" : String(value),\n edit.i\n );\n } else if (edit.t & EventFlag) {\n const patch2 = createEventListener(el, edit.n, value);\n el[EVENT_PATCH + edit.n] = patch2;\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, value);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof value === \"string\" || typeof value === \"number\") {\n setStyleAttribute(el, edit.n, value);\n } else {\n for (const style in value) {\n setStyleAttribute(el, style, value[style]);\n }\n }\n } else {\n setSvgAttribute(el, edit.n, value);\n }\n }\n const initsLength = current.i?.length;\n if (!initsLength)\n continue;\n for (let k = 0; k < initsLength; ++k) {\n const init = current.i[k];\n if (init.t & ChildFlag) {\n if (init.v && !hydrateNode)\n insertText(el, init.v, init.i);\n } else if (init.t & EventFlag) {\n createEventListener(el, init.n, init.l);\n } else {\n const child = childAt(el, init.i);\n if (hydrateNode) {\n init.b.m(el, child, child);\n } else {\n init.b.m(el, child);\n }\n }\n }\n }\n if (parent && !hydrateNode) {\n insertBefore$.call(parent, root, refNode);\n }\n this.l = root;\n return root;\n }\n p(newBlock) {\n const root = this.l;\n if (!newBlock.d)\n return root;\n const props = this.d;\n if (!shouldUpdate$.call(this, props, newBlock.d))\n return root;\n this.d = newBlock.d;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = this.c[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const oldValue = props[edit.h];\n const newValue = newBlock.d[edit.h];\n if (newValue === oldValue)\n continue;\n if (edit.t & EventFlag) {\n el[EVENT_PATCH + edit.n](newValue);\n continue;\n }\n if (edit.t & ChildFlag) {\n if (oldValue instanceof AbstractBlock) {\n const firstEdit = newBlock.e?.[i]?.e[k];\n const newChildBlock = newBlock.d[firstEdit.h];\n oldValue.p(newChildBlock);\n continue;\n }\n if (newValue && typeof newValue === \"object\" && \"foreign\" in newValue) {\n const targetEl = el[TEXT_NODE_CACHE][k];\n if (newValue.unstable && oldValue !== newValue) {\n const newTargetEl = newValue.current;\n el[TEXT_NODE_CACHE][k] = newTargetEl;\n replaceChild$.call(el, newTargetEl, targetEl);\n } else {\n newValue.current = targetEl;\n }\n continue;\n }\n setText(\n el[TEXT_NODE_CACHE][k],\n // eslint-disable-next-line eqeqeq\n newValue == null || newValue === false ? \"\" : String(newValue)\n );\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, newValue);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof newValue === \"string\" || typeof newValue === \"number\") {\n setStyleAttribute(el, edit.n, newValue);\n } else {\n for (const style in newValue) {\n if (newValue[style] !== oldValue[style]) {\n setStyleAttribute(el, style, newValue[style]);\n }\n }\n }\n } else {\n setSvgAttribute(el, edit.n, newValue);\n }\n }\n }\n return root;\n }\n v(block2 = null, refNode = null) {\n insertBefore$.call(this.t(), this.l, block2 ? block2.l : refNode);\n }\n x() {\n remove$$1.call(this.l);\n this.l = null;\n }\n u(_oldProps, _newProps) {\n if (!this._u)\n return true;\n return this._u(_oldProps, _newProps);\n }\n s() {\n return String(this.l?.outerHTML);\n }\n t() {\n if (!this._t)\n this._t = this.l?.parentElement;\n return this._t;\n }\n}\nconst getCurrentElement = (path, root, cache, key) => {\n const pathLength = path.length;\n if (!pathLength)\n return root;\n const isCacheAndKeyExists = cache && key !== void 0;\n if (isCacheAndKeyExists && cache[key]) {\n return cache[key];\n }\n for (let i = 0; i < pathLength; ++i) {\n const siblings = path[i];\n root = childAt(root, siblings);\n }\n if (isCacheAndKeyExists)\n cache[key] = root;\n return root;\n};\nconst withKey = (value, key) => {\n value.key = key;\n return value;\n};\nconst block$ = Block.prototype;\nconst mount$ = block$.m;\nconst patch$ = block$.p;\nconst move$ = block$.v;\nconst remove$ = block$.x;\nconst shouldUpdate$ = block$.u;\n\nexport { ArrayBlock as A, Block as B, MapHas$ as M, MapSet$ as a, block as b, cloneNode$ as c, arrayPatch$ as d, mapArray as e, arrayMount$ as f, MapGet$ as g, mount as h, removeComments as i, renderToTemplate as j, AbstractBlock as k, firstChild$ as l, mount$ as m, nextSibling$ as n, patch as p, remove$ as r, stringToDOM as s, withKey as w };\n","'use client';\nconst experimental_options = {\n noSlot: false\n};\n\nexport { experimental_options };\n","'use client';\nimport { useEffect, createContext, isValidElement, createElement, Fragment, useRef, useLayoutEffect as useLayoutEffect$1, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nconst RENDER_SCOPE = \"slot\";\nconst SVG_RENDER_SCOPE = \"g\";\nconst Effect = ({\n effect,\n deps\n}) => {\n useEffect(effect, deps || []);\n return null;\n};\nconst REGISTRY = /* @__PURE__ */ new Map();\n\nconst scopedContext = createContext(false);\nconst processProps = (props, ref, portals) => {\n const processedProps = { ref };\n let currentIndex = 0;\n for (const key in props) {\n const value = props[key];\n if (isValidElement(value) || Array.isArray(value) && value.length && isValidElement(value[0])) {\n processedProps[key] = renderReactScope(\n value,\n false,\n portals,\n currentIndex++\n );\n continue;\n }\n processedProps[key] = props[key];\n }\n return processedProps;\n};\nconst wrap = (vnode, key) => {\n return createElement(\n RENDER_SCOPE,\n { suppressHydrationWarning: true, id: key },\n vnode\n );\n};\nconst renderReactScope = (vnode, unstable, portals, currentIndex, key) => {\n const el = portals?.[currentIndex]?.current;\n const isBlock = isValidElement(vnode) && typeof vnode.type === \"function\" && \"_c\" in vnode.type;\n const isCallable = isBlock && vnode.type._c;\n if (typeof window === \"undefined\") {\n if (isBlock) {\n if (isCallable) {\n return vnode;\n }\n return wrap(wrap(vnode), key);\n }\n return wrap(vnode, key);\n }\n if (isCallable) {\n const puppetComponent = vnode.type(vnode.props);\n if (REGISTRY.has(puppetComponent.type)) {\n const puppetBlock = REGISTRY.get(puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n return puppetBlock(puppetComponent.props);\n }\n }\n }\n const current = el ?? (key ? document.getElementById(key) : null) ?? document.createElement(RENDER_SCOPE);\n const reactPortal = createPortal(\n createElement(Fragment, { children: vnode }),\n current,\n key\n );\n const millionPortal = {\n foreign: true,\n current,\n portal: reactPortal,\n reset: (child) => {\n child.childNodes.forEach((cn) => child.removeChild(cn));\n },\n unstable\n };\n if (portals) {\n portals[currentIndex] = millionPortal;\n }\n return millionPortal;\n};\nconst unwrap = (vnode) => {\n if (typeof vnode !== \"object\" || vnode === null || !(\"type\" in vnode)) {\n if (typeof vnode === \"number\") {\n return String(vnode);\n }\n return vnode;\n }\n let type = vnode.type;\n if (typeof type === \"function\") {\n return unwrap(type(vnode.props ?? {}));\n }\n if (typeof type === \"object\" && \"$\" in type)\n return type;\n const props = { ...vnode.props };\n if (\"css\" in props && \"__EMOTION_TYPE_PLEASE_DO_NOT_USE__\" in props) {\n props.style = props.css.styles;\n type = props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.css;\n }\n const children = vnode.props?.children;\n if (children !== void 0 && children !== null) {\n props.children = flatten(vnode.props.children).map(\n (child) => unwrap(child)\n );\n }\n return {\n type,\n // lets pretend no function go through\n props\n };\n};\nconst flatten = (rawChildren) => {\n if (rawChildren === void 0 || rawChildren === null)\n return [];\n if (typeof rawChildren === \"object\" && \"type\" in rawChildren && rawChildren.type === Fragment) {\n return flatten(rawChildren.props.children);\n }\n if (!Array.isArray(rawChildren) || typeof rawChildren === \"object\" && \"$\" in rawChildren) {\n return [rawChildren];\n }\n const flattenedChildren = rawChildren.flat(Infinity);\n const children = [];\n for (let i = 0, l = flattenedChildren.length; i < l; ++i) {\n children.push(...flatten(flattenedChildren[i]));\n }\n return children;\n};\n\nconst useLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect$1;\nfunction traverse(fiber, selector, ascending) {\n if (!fiber || selector(fiber))\n return fiber;\n let child = ascending ? fiber.return : fiber.child;\n while (child) {\n const match = traverse(child, selector, ascending);\n if (match)\n return match;\n child = ascending ? null : child.sibling;\n }\n}\nfunction useFiber() {\n const fiber = useRef();\n useState(() => {\n const bind = Function.prototype.bind;\n Function.prototype.bind = function(self, maybeFiber) {\n if (self === null && typeof maybeFiber?.type === \"function\") {\n fiber.current = maybeFiber;\n Function.prototype.bind = bind;\n }\n return bind.apply(this, arguments);\n };\n });\n return fiber.current;\n}\nfunction useNearestParent(type) {\n const fiber = useFiber();\n const parentRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n parentRef.current.el = traverse(\n fiber,\n (node) => {\n parentRef.current.depth++;\n return typeof node.type === \"string\" && (type === void 0 || node.type === type);\n },\n true\n )?.stateNode;\n }, [fiber]);\n return parentRef;\n}\nfunction useContainer() {\n const fiber = useFiber();\n const rootRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n rootRef.current.el = traverse(\n fiber,\n (node) => {\n rootRef.current.depth++;\n return node.stateNode?.containerInfo != null;\n },\n true\n )?.stateNode.containerInfo;\n }, [fiber]);\n return rootRef;\n}\n\nexport { Effect as E, RENDER_SCOPE as R, SVG_RENDER_SCOPE as S, REGISTRY as a, useContainer as b, useNearestParent as c, processProps as p, renderReactScope as r, scopedContext as s, unwrap as u };\n","'use client';\nimport { b as block$1, M as MapHas$, a as MapSet$, c as cloneNode$, m as mount$, p as patch, r as remove$, d as arrayPatch$, e as mapArray, f as arrayMount$, g as MapGet$, h as mount } from '../shared/million.fb41761f.mjs';\nexport { i as removeComments } from '../shared/million.fb41761f.mjs';\nimport { useRef, useCallback, useMemo, createElement, Fragment, useState, useEffect, memo, useContext } from 'react';\nimport { experimental_options } from './experimental.mjs';\nimport { S as SVG_RENDER_SCOPE, R as RENDER_SCOPE, u as unwrap, a as REGISTRY, b as useContainer, c as useNearestParent, p as processProps, E as Effect, r as renderReactScope, s as scopedContext } from '../shared/million.9efd57f2.mjs';\nimport 'react-dom';\n\nconst block = (fn, options = {}) => {\n const noSlot = options?.experimental_noSlot ?? experimental_options.noSlot;\n let blockTarget = options?.block;\n const defaultType = options?.svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n if (fn) {\n blockTarget = block$1(\n fn,\n unwrap,\n options?.shouldUpdate,\n options?.svg\n );\n }\n const MillionBlock = (props, forwardedRef) => {\n const container = useContainer();\n const parentRef = useNearestParent();\n const hmrTimestamp = props._hmr;\n const ref = useRef(null);\n const patch$1 = useRef(null);\n const portalRef = useRef([]);\n props = processProps(props, forwardedRef, portalRef.current);\n patch$1.current?.(props);\n const effect = useCallback(() => {\n if (!ref.current && !noSlot)\n return;\n const currentBlock = blockTarget(props, props.key);\n if (hmrTimestamp && ref.current?.textContent) {\n ref.current.textContent = \"\";\n }\n if (noSlot) {\n ref.current = parentRef.current?.el ?? container.current?.el;\n if (props.scoped || parentRef.current && container.current && parentRef.current.depth > container.current.depth) {\n ref.current = container.current.el;\n }\n if (ref.current.childNodes.length) {\n console.error(\n new Error(`\\`experimental_options.noSlot\\` does not support having siblings at the moment.\nThe block element should be the only child of the \\`${cloneNode$.call(ref.current).outerHTML}\\` element.\nTo avoid this error, \\`experimental_options.noSlot\\` should be false`)\n );\n }\n }\n if (patch$1.current === null || hmrTimestamp) {\n mount$.call(currentBlock, ref.current, null);\n patch$1.current = (props2) => {\n patch(\n currentBlock,\n blockTarget(\n props2,\n props2.key,\n options?.shouldUpdate\n )\n );\n };\n }\n return () => {\n remove$.call(currentBlock);\n };\n }, []);\n const marker = useMemo(() => {\n if (noSlot) {\n return null;\n }\n return createElement(options?.as ?? defaultType, { ref });\n }, []);\n const childrenSize = portalRef.current.length;\n const children = new Array(childrenSize);\n for (let i = 0; i < childrenSize; ++i) {\n children[i] = portalRef.current[i]?.portal;\n }\n const vnode = createElement(\n Fragment,\n {},\n marker,\n createElement(Effect, {\n effect,\n deps: hmrTimestamp ? [hmrTimestamp] : []\n }),\n children\n );\n return vnode;\n };\n if (!MapHas$.call(REGISTRY, MillionBlock)) {\n MapSet$.call(REGISTRY, MillionBlock, block);\n }\n if (options?.name) {\n if (fn) {\n fn.displayName = `Million(Render(${options.name}))`;\n }\n MillionBlock.displayName = `Million(Block(${options.name}))`;\n }\n return MillionBlock;\n};\n\nconst MillionArray = ({\n each,\n children,\n memo: memo2,\n svg,\n as,\n ...rest\n}) => {\n const ref = useRef(null);\n const [portals] = useState(() => ({\n current: Array(each.length)\n }));\n const fragmentRef = useRef(null);\n const cache = useRef({\n each: null,\n children: null,\n mounted: false\n });\n const [, setMountPortals] = useState(false);\n if (fragmentRef.current && (each !== cache.current.each || !memo2)) {\n const newChildren = createChildren(each, children, cache, portals, memo2);\n arrayPatch$.call(fragmentRef.current, mapArray(newChildren));\n }\n const defaultType = svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n const MillionFor = createElement(\n Fragment,\n null,\n createElement(as ?? defaultType, { ...rest, ref }),\n ...portals.current.map((p) => p.portal)\n );\n useEffect(() => {\n if (!ref.current || fragmentRef.current)\n return;\n if (cache.current.mounted)\n return;\n const newChildren = createChildren(each, children, cache, portals, memo2);\n fragmentRef.current = mapArray(newChildren);\n if (!MapHas$.call(REGISTRY, MillionFor)) {\n MapSet$.call(REGISTRY, MillionFor, fragmentRef.current);\n }\n arrayMount$.call(fragmentRef.current, ref.current);\n cache.current.mounted = true;\n setMountPortals(true);\n }, [ref.current]);\n return MillionFor;\n};\nconst typedMemo = memo;\nconst For = typedMemo(MillionArray);\nconst createChildren = (each, getComponent, cache, portals, memo2) => {\n const children = Array(each.length);\n const currentCache = cache.current;\n for (let i = 0, l = each.length; i < l; ++i) {\n if (memo2 && currentCache.each && currentCache.each[i] === each[i]) {\n children[i] = currentCache.children?.[i];\n continue;\n }\n const vnode = getComponent(each[i], i);\n if (MapHas$.call(REGISTRY, vnode.type)) {\n if (!currentCache.block) {\n currentCache.block = MapGet$.call(REGISTRY, vnode.type);\n }\n children[i] = currentCache.block(vnode.props, portals, i);\n continue;\n }\n if (typeof vnode.type === \"function\" && \"_c\" in vnode.type) {\n const puppetComponent = vnode.type(vnode.props);\n if (MapHas$.call(REGISTRY, puppetComponent.type)) {\n const puppetBlock = MapGet$.call(REGISTRY, puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n children[i] = puppetBlock(puppetComponent.props);\n continue;\n }\n }\n }\n const block = block$1((props) => props?.scope);\n const currentBlock = (props, portals2, index) => {\n return block(\n {\n scope: renderReactScope(\n createElement(vnode.type, props),\n false,\n portals2.current,\n index\n )\n },\n vnode.key ? String(vnode.key) : void 0\n );\n };\n MapSet$.call(REGISTRY, vnode.type, currentBlock);\n currentCache.block = currentBlock;\n children[i] = currentBlock(vnode.props, portals, i);\n }\n currentCache.each = each;\n currentCache.children = children;\n return children;\n};\n\nfunction isEqual(a, b) {\n return a === b || a !== a && b !== b;\n}\nfunction shouldCompiledBlockUpdate(prev, next) {\n for (const key in prev) {\n if (!isEqual(prev[key], next[key])) {\n return true;\n }\n }\n return false;\n}\nfunction compiledBlock(render, { portals, ...options }) {\n const blockName = `CompiledBlock(Inner(${options.name}))`;\n const RenderBlock = block((props) => render(props), {\n ...options,\n scoped: void 0,\n name: blockName,\n shouldUpdate: shouldCompiledBlockUpdate\n });\n const portalCount = portals?.length || 0;\n const Component = portals && portalCount > 0 ? (props) => {\n const scoped = useContext(scopedContext);\n const [current] = useState(() => []);\n const derived = { ...props, scoped };\n for (let i = 0; i < portalCount; i++) {\n const index = portals[i];\n const scope = renderReactScope(\n derived[index],\n false,\n current,\n i\n );\n derived[index] = scope;\n }\n const targets = [];\n for (let i = 0, len = current.length; i < len; i++) {\n targets[i] = current[i].portal;\n }\n return createElement(\n Fragment,\n null,\n createElement(RenderBlock, derived),\n targets\n );\n } : (props) => createElement(RenderBlock, props);\n if (options.name) {\n Component.displayName = `Million(CompiledBlock(Outer(${options.name})))`;\n }\n return Component;\n}\n\nconst INTERNALS = {\n block: block$1,\n patch,\n mount\n};\nif (typeof window !== \"undefined\") {\n window.__MILLION_DATA__ = {\n version: \"3.0.6\"\n };\n}\n\nexport { For, INTERNALS, REGISTRY, block, compiledBlock, renderReactScope, unwrap };\n","export const EVENTS_SOCKET = {\r\n MESSAGE: 'message',\r\n TYPING: 'typing',\r\n STOP_TYPING: 'stop-typing',\r\n AGENT_MESSAGE: 'agent-message',\r\n}\r\n\r\nexport const USER_ID_KEY = 'user-bot-id'\r\n\r\nexport const API_URL = import.meta.env.DEV\r\n ? 'http://localhost:8080'\r\n : 'https://api.dialoguebot.tech'\r\n\r\nconsole.log('API_URL', API_URL)\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = exports.isBytes = void 0;\nfunction number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`positive integer expected, not ${n}`);\n}\nexports.number = number;\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`boolean expected, not ${b}`);\n}\nexports.bool = bool;\n// copied from utils\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\nfunction bytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);\n}\nexports.bytes = bytes;\nfunction hash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(h.outputLen);\n number(h.blockLen);\n}\nexports.hash = hash;\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexports.exists = exists;\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexports.output = output;\nconst assert = { number, bool, bytes, hash, exists, output };\nexports.default = assert;\n//# sourceMappingURL=_assert.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.add = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = exports.split = exports.fromBig = void 0;\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nexports.fromBig = fromBig;\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nexports.split = split;\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\nexports.toBig = toBig;\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nexports.shrSH = shrSH;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.shrSL = shrSL;\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nexports.rotrSH = rotrSH;\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.rotrSL = rotrSL;\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nexports.rotrBH = rotrBH;\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\nexports.rotrBL = rotrBL;\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nexports.rotr32H = rotr32H;\nconst rotr32L = (h, _l) => h;\nexports.rotr32L = rotr32L;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nexports.rotlSH = rotlSH;\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nexports.rotlSL = rotlSL;\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nexports.rotlBH = rotlBH;\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nexports.rotlBL = rotlBL;\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\nexports.add = add;\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nexports.add3L = add3L;\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nexports.add3H = add3H;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nexports.add4L = add4L;\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nexports.add4H = add4H;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nexports.add5L = add5L;\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\nexports.add5H = add5H;\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexports.default = u64;\n//# sourceMappingURL=_u64.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.crypto = void 0;\nexports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","\"use strict\";\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.byteSwap32 = exports.byteSwapIfBE = exports.byteSwap = exports.isLE = exports.rotl = exports.rotr = exports.createView = exports.u32 = exports.u8 = exports.isBytes = void 0;\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nconst crypto_1 = require(\"@noble/hashes/crypto\");\nconst _assert_js_1 = require(\"./_assert.js\");\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\n// Cast array to different type\nconst u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.u8 = u8;\nconst u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\nexports.u32 = u32;\n// Cast array to view\nconst createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.createView = createView;\n// The rotate right (circular right shift) operation for uint32\nconst rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\nexports.rotr = rotr;\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0);\nexports.rotl = rotl;\nexports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\n// The byte swap operation for uint32\nconst byteSwap = (word) => ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff);\nexports.byteSwap = byteSwap;\n// Conditionally byte swap if on a big-endian platform\nexports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => (0, exports.byteSwap)(n);\n// In place byte swap for Uint32Array\nfunction byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = (0, exports.byteSwap)(arr[i]);\n }\n}\nexports.byteSwap32 = byteSwap32;\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nfunction bytesToHex(bytes) {\n (0, _assert_js_1.bytes)(bytes);\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexports.bytesToHex = bytesToHex;\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 };\nfunction asciiToBase16(char) {\n if (char >= asciis._0 && char <= asciis._9)\n return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F)\n return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f)\n return char - (asciis._a - 10);\n return;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nfunction hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2;\n }\n return array;\n}\nexports.hexToBytes = hexToBytes;\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nconst nextTick = async () => { };\nexports.nextTick = nextTick;\n// Returns control to thread each 'tick' ms to avoid blocking\nasync function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await (0, exports.nextTick)();\n ts += diff;\n }\n}\nexports.asyncLoop = asyncLoop;\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nexports.utf8ToBytes = utf8ToBytes;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n (0, _assert_js_1.bytes)(data);\n return data;\n}\nexports.toBytes = toBytes;\n/**\n * Copies several Uint8Arrays into one.\n */\nfunction concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n (0, _assert_js_1.bytes)(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\nexports.concatBytes = concatBytes;\n// For runtime check if class implements interface\nclass Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nexports.Hash = Hash;\nconst toStr = {}.toString;\nfunction checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexports.checkOpts = checkOpts;\nfunction wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexports.wrapConstructor = wrapConstructor;\nfunction wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapConstructorWithOpts = wrapConstructorWithOpts;\nfunction wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nfunction randomBytes(bytesLength = 32) {\n if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') {\n return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\nexports.randomBytes = randomBytes;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = exports.keccakP = void 0;\nconst _assert_js_1 = require(\"./_assert.js\");\nconst _u64_js_1 = require(\"./_u64.js\");\nconst utils_js_1 = require(\"./utils.js\");\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ (0, _u64_js_1.split)(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBH)(h, l, s) : (0, _u64_js_1.rotlSH)(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBL)(h, l, s) : (0, _u64_js_1.rotlSL)(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nfunction keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexports.keccakP = keccakP;\nclass Keccak extends utils_js_1.Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n (0, _assert_js_1.number)(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = (0, utils_js_1.u32)(this.state);\n }\n keccak() {\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n keccakP(this.state32, this.rounds);\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n (0, _assert_js_1.exists)(this);\n const { blockLen, state } = this;\n data = (0, utils_js_1.toBytes)(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n (0, _assert_js_1.exists)(this, false);\n (0, _assert_js_1.bytes)(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n (0, _assert_js_1.number)(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n (0, _assert_js_1.output)(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nexports.Keccak = Keccak;\nconst gen = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructor)(() => new Keccak(blockLen, suffix, outputLen));\nexports.sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexports.sha3_256 = gen(0x06, 136, 256 / 8);\nexports.sha3_384 = gen(0x06, 104, 384 / 8);\nexports.sha3_512 = gen(0x06, 72, 512 / 8);\nexports.keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexports.keccak_256 = gen(0x01, 136, 256 / 8);\nexports.keccak_384 = gen(0x01, 104, 384 / 8);\nexports.keccak_512 = gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapXOFConstructorWithOpts)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexports.shake128 = genShake(0x1f, 168, 128 / 8);\nexports.shake256 = genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/* global global, window, module */\nconst { sha3_512: sha3 } = require(\"@noble/hashes/sha3\");\n\nconst defaultLength = 24;\nconst bigLength = 32;\n\nconst createEntropy = (length = 4, random = Math.random) => {\n let entropy = \"\";\n\n while (entropy.length < length) {\n entropy = entropy + Math.floor(random() * 36).toString(36);\n }\n return entropy;\n};\n\n/*\n * Adapted from https://github.com/juanelas/bigint-conversion\n * MIT License Copyright (c) 2018 Juan Hernández Serrano\n */\nfunction bufToBigInt(buf) {\n let bits = 8n;\n\n let value = 0n;\n for (const i of buf.values()) {\n const bi = BigInt(i);\n value = (value << bits) + bi;\n }\n return value;\n}\n\nconst hash = (input = \"\") => {\n // Drop the first character because it will bias the histogram\n // to the left.\n return bufToBigInt(sha3(input)).toString(36).slice(1);\n};\n\nconst alphabet = Array.from({ length: 26 }, (x, i) =>\n String.fromCharCode(i + 97)\n);\n\nconst randomLetter = (random) =>\n alphabet[Math.floor(random() * alphabet.length)];\n\n/*\nThis is a fingerprint of the host environment. It is used to help\nprevent collisions when generating ids in a distributed system.\nIf no global object is available, you can pass in your own, or fall back\non a random string.\n*/\nconst createFingerprint = ({\n globalObj = typeof global !== \"undefined\"\n ? global\n : typeof window !== \"undefined\"\n ? window\n : {},\n random = Math.random,\n} = {}) => {\n const globals = Object.keys(globalObj).toString();\n const sourceString = globals.length\n ? globals + createEntropy(bigLength, random)\n : createEntropy(bigLength, random);\n\n return hash(sourceString).substring(0, bigLength);\n};\n\nconst createCounter = (count) => () => {\n return count++;\n};\n\n// ~22k hosts before 50% chance of initial counter collision\n// with a remaining counter range of 9.0e+15 in JavaScript.\nconst initialCountMax = 476782367;\n\nconst init = ({\n // Fallback if the user does not pass in a CSPRNG. This should be OK\n // because we don't rely solely on the random number generator for entropy.\n // We also use the host fingerprint, current time, and a session counter.\n random = Math.random,\n counter = createCounter(Math.floor(random() * initialCountMax)),\n length = defaultLength,\n fingerprint = createFingerprint({ random }),\n} = {}) => {\n return function cuid2() {\n const firstLetter = randomLetter(random);\n\n // If we're lucky, the `.toString(36)` calls may reduce hashing rounds\n // by shortening the input to the hash function a little.\n const time = Date.now().toString(36);\n const count = counter().toString(36);\n\n // The salt should be long enough to be globally unique across the full\n // length of the hash. For simplicity, we use the same length as the\n // intended id output.\n const salt = createEntropy(length, random);\n const hashInput = `${time + salt + count + fingerprint}`;\n\n return `${firstLetter + hash(hashInput).substring(1, length)}`;\n };\n};\n\nconst createId = init();\n\nconst isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => {\n const length = id.length;\n const regex = /^[0-9a-z]+$/;\n\n try {\n if (\n typeof id === \"string\" &&\n length >= minLength &&\n length <= maxLength &&\n regex.test(id)\n )\n return true;\n } finally {\n }\n\n return false;\n};\n\nmodule.exports.getConstants = () => ({ defaultLength, bigLength });\nmodule.exports.init = init;\nmodule.exports.createId = createId;\nmodule.exports.bufToBigInt = bufToBigInt;\nmodule.exports.createCounter = createCounter;\nmodule.exports.createFingerprint = createFingerprint;\nmodule.exports.isCuid = isCuid;\n","const { createId, init, getConstants, isCuid } = require(\"./src/index\");\n\nmodule.exports.createId = createId;\nmodule.exports.init = init;\nmodule.exports.getConstants = getConstants;\nmodule.exports.isCuid = isCuid;\n","import { USER_ID_KEY } from '@/constants'\r\nimport { createId } from '@paralleldrive/cuid2'\r\n\r\n/**\r\n * Generates a unique ID for the user.\r\n * If a user ID is already stored in the local storage, it returns that ID.\r\n * Otherwise, it generates a new ID, stores it in the local storage, and returns it.\r\n * @returns The generated or stored user ID.\r\n */\r\nexport const genId = () => {\r\n const generatedId = createId()\r\n\r\n const userIdFromLocalStorage = localStorage.getItem(USER_ID_KEY)\r\n\r\n if (!userIdFromLocalStorage) {\r\n localStorage.setItem(USER_ID_KEY, generatedId)\r\n\r\n return generatedId\r\n }\r\n\r\n return userIdFromLocalStorage\r\n}\r\n\r\n/**\r\n * Generates a unique address based on the provided channelId.\r\n * @param channelId - The ID of the channel.\r\n * @returns The generated address.\r\n */\r\nexport const getAddress = (channelId: string, incomeUserId?: string) => {\r\n const userId = incomeUserId ? incomeUserId : genId()\r\n\r\n return `${channelId}_${userId}`\r\n}\r\n\r\nexport const openInNewTab = (url: string) => {\r\n window.open(url, '_blank')?.focus()\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color code to HSL (Hue, Saturation, Lightness) format.\r\n * @param hex - The hexadecimal color code to convert.\r\n * @returns An object containing the HSL values.\r\n */\r\nexport const hexToHSL = (hex: string) => {\r\n hex = hex.replace(/^#/, '')\r\n\r\n // Convert hex to RGB\r\n const bigint = parseInt(hex, 16)\r\n let r = (bigint >> 16) & 255\r\n let g = (bigint >> 8) & 255\r\n let b = bigint & 255\r\n\r\n // Normalize RGB values\r\n r /= 255\r\n g /= 255\r\n b /= 255\r\n\r\n // Find the maximum and minimum values of R, G, B\r\n const max = Math.max(r, g, b)\r\n const min = Math.min(r, g, b)\r\n let h = 0,\r\n s\r\n const l = (max + min) / 2\r\n\r\n if (max === min) {\r\n h = s = 0 // achromatic\r\n } else {\r\n const d = max - min\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0)\r\n break\r\n case g:\r\n h = (b - r) / d + 2\r\n break\r\n case b:\r\n h = (r - g) / d + 4\r\n break\r\n }\r\n h /= 6\r\n }\r\n\r\n h *= 360\r\n\r\n return {\r\n h: Math.round(h),\r\n s: Math.round(s * 100),\r\n l: Math.round(l * 100),\r\n }\r\n}\r\n","// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n return void 0;\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if (!array && a[key] === void 0 && b[key] === void 0 && aItems.includes(key)) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nexport {\n addToEnd,\n addToStart,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class {\n constructor(options) {\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n let promiseResolve;\n let promiseReject;\n const promise = new Promise((outerResolve, outerReject) => {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const shouldPause = () => !focusManager.isFocused() || config.networkMode !== \"always\" && !onlineManager.isOnline();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n promiseResolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n promiseReject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n const canContinue = isResolved || !shouldPause();\n if (canContinue) {\n continueResolve(value);\n }\n return canContinue;\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n if (shouldPause()) {\n return pause();\n }\n return;\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n if (canFetch(config.networkMode)) {\n run();\n } else {\n pause().then(run);\n }\n return {\n promise,\n cancel,\n continue: () => {\n const didContinue = continueFn?.();\n return didContinue ? promise : Promise.resolve();\n },\n cancelRetry,\n continueRetry\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const setScheduler = (fn) => {\n scheduleFn = fn;\n };\n const batch = (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n };\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const batchCalls = (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n const setNotifyFunction = (fn) => {\n notifyFn = fn;\n };\n const setBatchNotifyFunction = (fn) => {\n batchNotifyFn = fn;\n };\n return {\n batch,\n batchCalls,\n schedule,\n setNotifyFunction,\n setBatchNotifyFunction,\n setScheduler\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport { noop, replaceData, skipToken, timeUntilStale } from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #retryer;\n #observers;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.#observers = [];\n this.#cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = config.state || getDefaultState(this.options);\n this.state = this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.#observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.#observers.some(\n (observer) => observer.options.enabled !== false\n );\n }\n isDisabled() {\n return this.getObserversCount() > 0 && !this.isActive();\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.#observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.#observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.#observers.includes(observer)) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n if (!this.#observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.#observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.#observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const queryFnContext = {\n queryKey: this.queryKey,\n meta: this.meta\n };\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n addSignalProperty(queryFnContext);\n const fetchFn = () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (this.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'`\n );\n }\n }\n if (!this.options.queryFn || this.options.queryFn === skipToken) {\n return Promise.reject(\n new Error(`Missing queryFn: '${this.options.queryHash}'`)\n );\n }\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n this.options.queryFn,\n queryFnContext,\n this\n );\n }\n return this.options.queryFn(\n queryFnContext\n );\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n };\n this.#retryer = createRetryer({\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode\n });\n return this.#retryer.promise;\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { canFetch, createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #defaultOptions;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#defaultOptions = config.defaultOptions;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const executeMutation = () => {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode\n });\n return this.#retryer.promise;\n };\n const restored = this.state.status === \"pending\";\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables\n });\n }\n }\n const data = await executeMutation();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: !canFetch(this.options.networkMode),\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = [];\n this.#mutationId = 0;\n }\n #mutations;\n #mutationId;\n #resuming;\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n this.#mutations.push(mutation);\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n this.#mutations = this.#mutations.filter((x) => x !== mutation);\n this.notify({ type: \"removed\", mutation });\n }\n clear() {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.remove(mutation);\n });\n });\n }\n getAll() {\n return this.#mutations;\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.#mutations.find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.#mutations.filter(\n (mutation) => matchMutation(filters, mutation)\n );\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n this.#resuming = (this.#resuming ?? Promise.resolve()).then(() => {\n const pausedMutations = this.#mutations.filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => pausedMutations.reduce(\n (promise, mutation) => promise.then(() => mutation.continue().catch(noop)),\n Promise.resolve()\n )\n );\n }).then(() => {\n this.#resuming = void 0;\n });\n return this.#resuming;\n }\n};\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/infiniteQueryBehavior.ts\nimport { addToEnd, addToStart, skipToken } from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const fetchFn = async () => {\n const options = context.options;\n const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n const oldPages = context.state.data?.pages || [];\n const oldPageParams = context.state.data?.pageParams || [];\n const empty = { pages: [], pageParams: [] };\n let cancelled = false;\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true;\n } else {\n context.signal.addEventListener(\"abort\", () => {\n cancelled = true;\n });\n }\n return context.signal;\n }\n });\n };\n const queryFn = context.options.queryFn && context.options.queryFn !== skipToken ? context.options.queryFn : () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (context.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${context.options.queryHash}'`\n );\n }\n }\n return Promise.reject(\n new Error(`Missing queryFn: '${context.options.queryHash}'`)\n );\n };\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject();\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const page = await queryFn(\n queryFnContext\n );\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\n let result;\n if (direction && oldPages.length) {\n const previous = direction === \"backward\";\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams\n };\n const param = pageParamFn(options, oldData);\n result = await fetchPage(oldData, param, previous);\n } else {\n result = await fetchPage(\n empty,\n oldPageParams[0] ?? options.initialPageParam\n );\n const remainingPages = pages ?? oldPages.length;\n for (let i = 1; i < remainingPages; i++) {\n const param = getNextPageParam(options, result);\n result = await fetchPage(result, param);\n }\n }\n return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal\n },\n query\n );\n };\n } else {\n context.fetchFn = fetchFn;\n }\n }\n };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n );\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return options.getPreviousPageParam?.(\n pages[0],\n pages,\n pageParams[0],\n pageParams\n );\n}\nfunction hasNextPage(options, data) {\n if (!data)\n return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam)\n return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1)\n return;\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations();\n this.#queryCache.onFocus();\n }\n });\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations();\n this.#queryCache.onOnline();\n }\n });\n }\n unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0)\n return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const cachedData = this.getQueryData(options.queryKey);\n if (cachedData === void 0)\n return this.fetchQuery(options);\n else {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n if (options.revalidateIfStale && query.isStaleByTime(defaultedOptions.staleTime)) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n const refetchFilters = {\n type: \"active\",\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n cancelQueries(filters = {}, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters = {}, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? \"active\"\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n refetchQueries(filters = {}, options) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","// src/queryObserver.ts\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { fetchState } from \"./query.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options, notifyOptions) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\") {\n throw new Error(\"Expected enabled to be a boolean\");\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult(notifyOptions);\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n const trackedResult = {};\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key);\n onPropTracked?.(key);\n return result[key];\n }\n });\n });\n return trackedResult;\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n query.isFetchingOptimistic = true;\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n if (isServer || this.#currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n const time = timeUntilStale(\n this.#currentResult.dataUpdatedAt,\n this.options.staleTime\n );\n const timeout = time + 1;\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || this.options.enabled === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n if (options.select && newState.data !== void 0) {\n if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(newState.data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n } else {\n data = newState.data;\n }\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n if (options.select && placeholderData !== void 0) {\n try {\n placeholderData = options.select(placeholderData);\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch\n };\n return result;\n }\n updateResult(notifyOptions) {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const defaultNotifyOptions = {};\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true;\n }\n this.#notify({ ...defaultNotifyOptions, ...notifyOptions });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (options.enabled !== false) {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return options.enabled !== false && query.isStaleByTime(options.staleTime);\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\n\n// src/isRestoring.ts\nimport * as React from \"react\";\nvar IsRestoringContext = React.createContext(false);\nvar useIsRestoring = () => React.useContext(IsRestoringContext);\nvar IsRestoringProvider = IsRestoringContext.Provider;\nexport {\n IsRestoringProvider,\n useIsRestoring\n};\n//# sourceMappingURL=isRestoring.js.map","\"use client\";\n\n// src/QueryErrorResetBoundary.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createValue() {\n let isReset = false;\n return {\n clearReset: () => {\n isReset = false;\n },\n reset: () => {\n isReset = true;\n },\n isReset: () => {\n return isReset;\n }\n };\n}\nvar QueryErrorResetBoundaryContext = React.createContext(createValue());\nvar useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\nvar QueryErrorResetBoundary = ({\n children\n}) => {\n const [value] = React.useState(() => createValue());\n return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === \"function\" ? children(value) : children });\n};\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary\n};\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","// src/utils.ts\nfunction shouldThrowError(throwError, params) {\n if (typeof throwError === \"function\") {\n return throwError(...params);\n }\n return !!throwError;\n}\nfunction noop() {\n}\nexport {\n noop,\n shouldThrowError\n};\n//# sourceMappingURL=utils.js.map","\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"./utils.js\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\nvar defaultThrowOnError = (_error, query) => query.state.data === void 0;\nvar ensureStaleTime = (defaultedOptions) => {\n if (defaultedOptions.suspense) {\n if (typeof defaultedOptions.staleTime !== \"number\") {\n defaultedOptions.staleTime = 1e3;\n }\n }\n};\nvar willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nvar shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nvar fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset();\n});\nexport {\n defaultThrowOnError,\n ensureStaleTime,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n};\n//# sourceMappingURL=suspense.js.map","\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { notifyManager } from \"@tanstack/query-core\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./isRestoring.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { ensureStaleTime, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const client = useQueryClient(queryClient);\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const defaultedOptions = client.defaultQueryOptions(options);\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureStaleTime(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n useClearResetErrorBoundary(errorResetBoundary);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange));\n observer.updateResult();\n return unsubscribe;\n },\n [observer, isRestoring]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions, { listeners: false });\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: client.getQueryCache().get(defaultedOptions.queryHash)\n })) {\n throw result.error;\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\n\n// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(options, QueryObserver, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n","import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n","// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n","import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n","import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n // @ts-expect-error\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n // @ts-expect-error\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* READ_PAYLOAD */;\n }\n else if (state === 2 /* READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n","/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","export const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\n","import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n","// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n","import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n","// imported from https://github.com/unshiftio/yeast\n'use strict';\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''), length = 64, map = {};\nlet seed = 0, i = 0, prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nexport function encode(num) {\n let encoded = '';\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nexport function decode(str) {\n let decoded = 0;\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nexport function yeast() {\n const now = encode(+new Date());\n if (now !== prev)\n return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n}\n//\n// Map each character to its index.\n//\nfor (; i < length; i++)\n map[alphabet[i]] = i;\n","// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n","// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\nexport function createCookieJar() { }\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n","import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { nextTick, usingBrowserWebSocket, WebSocket, } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @param {Object} opts - connection options\n * @protected\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n get name() {\n return \"websocket\";\n }\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @private\n */\n check() {\n return !!WebSocket;\n }\n}\n","import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n","import { Polling } from \"./polling.js\";\nimport { WS } from \"./websocket.js\";\nimport { WT } from \"./webtransport.js\";\nexport const transports = {\n websocket: WS,\n webtransport: WT,\n polling: Polling,\n};\n","// imported from https://github.com/galkn/parseuri\n/**\n * Parses a URI\n *\n * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.\n *\n * See:\n * - https://developer.mozilla.org/en-US/docs/Web/API/URL\n * - https://caniuse.com/url\n * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B\n *\n * History of the parse() method:\n * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c\n * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3\n * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242\n *\n * @author Steven Levithan (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n if (str.length > 2000) {\n throw \"URI too long\";\n }\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n","import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n","import { parse } from \"engine.io-client\";\n/**\n * URL parser.\n *\n * @param uri - url\n * @param path - the request path of the connection\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nexport function url(uri, path = \"\", loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n obj = parse(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port + path;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\n","const withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj.buffer instanceof ArrayBuffer;\n};\nconst toString = Object.prototype.toString;\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeFile = typeof File === \"function\" ||\n (typeof File !== \"undefined\" &&\n toString.call(File) === \"[object FileConstructor]\");\n/**\n * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.\n *\n * @private\n */\nexport function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}\nexport function hasBinary(obj, toJSON) {\n if (!obj || typeof obj !== \"object\") {\n return false;\n }\n if (Array.isArray(obj)) {\n for (let i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n return false;\n }\n if (isBinary(obj)) {\n return true;\n }\n if (obj.toJSON &&\n typeof obj.toJSON === \"function\" &&\n arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n return false;\n}\n","import { isBinary } from \"./is-binary.js\";\n/**\n * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @public\n */\nexport function deconstructPacket(packet) {\n const buffers = [];\n const packetData = packet.data;\n const pack = packet;\n pack.data = _deconstructPacket(packetData, buffers);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return { packet: pack, buffers: buffers };\n}\nfunction _deconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (isBinary(data)) {\n const placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n }\n else if (Array.isArray(data)) {\n const newData = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i], buffers);\n }\n return newData;\n }\n else if (typeof data === \"object\" && !(data instanceof Date)) {\n const newData = {};\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n newData[key] = _deconstructPacket(data[key], buffers);\n }\n }\n return newData;\n }\n return data;\n}\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @public\n */\nexport function reconstructPacket(packet, buffers) {\n packet.data = _reconstructPacket(packet.data, buffers);\n delete packet.attachments; // no longer useful\n return packet;\n}\nfunction _reconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (data && data._placeholder === true) {\n const isIndexValid = typeof data.num === \"number\" &&\n data.num >= 0 &&\n data.num < buffers.length;\n if (isIndexValid) {\n return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n }\n else {\n throw new Error(\"illegal attachments\");\n }\n }\n else if (Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i], buffers);\n }\n }\n else if (typeof data === \"object\") {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n data[key] = _reconstructPacket(data[key], buffers);\n }\n }\n }\n return data;\n}\n","import { Emitter } from \"@socket.io/component-emitter\";\nimport { deconstructPacket, reconstructPacket } from \"./binary.js\";\nimport { isBinary, hasBinary } from \"./is-binary.js\";\n/**\n * These strings must not be used as event names, as they have a special meaning.\n */\nconst RESERVED_EVENTS = [\n \"connect\",\n \"connect_error\",\n \"disconnect\",\n \"disconnecting\",\n \"newListener\",\n \"removeListener\", // used by the Node.js EventEmitter\n];\n/**\n * Protocol version.\n *\n * @public\n */\nexport const protocol = 5;\nexport var PacketType;\n(function (PacketType) {\n PacketType[PacketType[\"CONNECT\"] = 0] = \"CONNECT\";\n PacketType[PacketType[\"DISCONNECT\"] = 1] = \"DISCONNECT\";\n PacketType[PacketType[\"EVENT\"] = 2] = \"EVENT\";\n PacketType[PacketType[\"ACK\"] = 3] = \"ACK\";\n PacketType[PacketType[\"CONNECT_ERROR\"] = 4] = \"CONNECT_ERROR\";\n PacketType[PacketType[\"BINARY_EVENT\"] = 5] = \"BINARY_EVENT\";\n PacketType[PacketType[\"BINARY_ACK\"] = 6] = \"BINARY_ACK\";\n})(PacketType || (PacketType = {}));\n/**\n * A socket.io Encoder instance\n */\nexport class Encoder {\n /**\n * Encoder constructor\n *\n * @param {function} replacer - custom replacer to pass down to JSON.parse\n */\n constructor(replacer) {\n this.replacer = replacer;\n }\n /**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n */\n encode(obj) {\n if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {\n if (hasBinary(obj)) {\n return this.encodeAsBinary({\n type: obj.type === PacketType.EVENT\n ? PacketType.BINARY_EVENT\n : PacketType.BINARY_ACK,\n nsp: obj.nsp,\n data: obj.data,\n id: obj.id,\n });\n }\n }\n return [this.encodeAsString(obj)];\n }\n /**\n * Encode packet as string.\n */\n encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }\n /**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n */\n encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }\n}\n// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n */\nexport class Decoder extends Emitter {\n /**\n * Decoder constructor\n *\n * @param {function} reviver - custom reviver to pass down to JSON.stringify\n */\n constructor(reviver) {\n super();\n this.reviver = reviver;\n }\n /**\n * Decodes an encoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n */\n add(obj) {\n let packet;\n if (typeof obj === \"string\") {\n if (this.reconstructor) {\n throw new Error(\"got plaintext data when reconstructing a packet\");\n }\n packet = this.decodeString(obj);\n const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;\n if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {\n packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;\n // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n // no attachments, labeled binary but no binary data to follow\n if (packet.attachments === 0) {\n super.emitReserved(\"decoded\", packet);\n }\n }\n else {\n // non-binary full packet\n super.emitReserved(\"decoded\", packet);\n }\n }\n else if (isBinary(obj) || obj.base64) {\n // raw binary data\n if (!this.reconstructor) {\n throw new Error(\"got binary data when not reconstructing a packet\");\n }\n else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) {\n // received final buffer\n this.reconstructor = null;\n super.emitReserved(\"decoded\", packet);\n }\n }\n }\n else {\n throw new Error(\"Unknown type: \" + obj);\n }\n }\n /**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n */\n decodeString(str) {\n let i = 0;\n // look up type\n const p = {\n type: Number(str.charAt(0)),\n };\n if (PacketType[p.type] === undefined) {\n throw new Error(\"unknown packet type \" + p.type);\n }\n // look up attachments if type binary\n if (p.type === PacketType.BINARY_EVENT ||\n p.type === PacketType.BINARY_ACK) {\n const start = i + 1;\n while (str.charAt(++i) !== \"-\" && i != str.length) { }\n const buf = str.substring(start, i);\n if (buf != Number(buf) || str.charAt(i) !== \"-\") {\n throw new Error(\"Illegal attachments\");\n }\n p.attachments = Number(buf);\n }\n // look up namespace (if any)\n if (\"/\" === str.charAt(i + 1)) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (\",\" === c)\n break;\n if (i === str.length)\n break;\n }\n p.nsp = str.substring(start, i);\n }\n else {\n p.nsp = \"/\";\n }\n // look up id\n const next = str.charAt(i + 1);\n if (\"\" !== next && Number(next) == next) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n if (i === str.length)\n break;\n }\n p.id = Number(str.substring(start, i + 1));\n }\n // look up json data\n if (str.charAt(++i)) {\n const payload = this.tryParse(str.substr(i));\n if (Decoder.isPayloadValid(p.type, payload)) {\n p.data = payload;\n }\n else {\n throw new Error(\"invalid payload\");\n }\n }\n return p;\n }\n tryParse(str) {\n try {\n return JSON.parse(str, this.reviver);\n }\n catch (e) {\n return false;\n }\n }\n static isPayloadValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n return Array.isArray(payload);\n }\n }\n /**\n * Deallocates a parser's resources\n */\n destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n this.reconstructor = null;\n }\n }\n}\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n */\nclass BinaryReconstructor {\n constructor(packet) {\n this.packet = packet;\n this.buffers = [];\n this.reconPack = packet;\n }\n /**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n */\n takeBinaryData(binData) {\n this.buffers.push(binData);\n if (this.buffers.length === this.reconPack.attachments) {\n // done with buffer list\n const packet = reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n }\n /**\n * Cleans up binary packet reconstruction variables.\n */\n finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }\n}\n","export function on(obj, ev, fn) {\n obj.on(ev, fn);\n return function subDestroy() {\n obj.off(ev, fn);\n };\n}\n","import { PacketType } from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\n/**\n * A Socket is the fundamental class for interacting with the server.\n *\n * A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(\"connected\");\n * });\n *\n * // send an event to the server\n * socket.emit(\"foo\", \"bar\");\n *\n * socket.on(\"foobar\", () => {\n * // an event was received from the server\n * });\n *\n * // upon disconnection\n * socket.on(\"disconnect\", (reason) => {\n * console.log(`disconnected due to ${reason}`);\n * });\n */\nexport class Socket extends Emitter {\n /**\n * `Socket` constructor.\n */\n constructor(io, nsp, opts) {\n super();\n /**\n * Whether the socket is currently connected to the server.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.connected); // true\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.connected); // false\n * });\n */\n this.connected = false;\n /**\n * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will\n * be transmitted by the server.\n */\n this.recovered = false;\n /**\n * Buffer for packets received before the CONNECT packet\n */\n this.receiveBuffer = [];\n /**\n * Buffer for packets that will be sent once the socket is connected\n */\n this.sendBuffer = [];\n /**\n * The queue of packets to be sent with retry in case of failure.\n *\n * Packets are sent one by one, each waiting for the server acknowledgement, in order to guarantee the delivery order.\n * @private\n */\n this._queue = [];\n /**\n * A sequence to generate the ID of the {@link QueuedPacket}.\n * @private\n */\n this._queueSeq = 0;\n this.ids = 0;\n /**\n * A map containing acknowledgement handlers.\n *\n * The `withError` attribute is used to differentiate handlers that accept an error as first argument:\n *\n * - `socket.emit(\"test\", (err, value) => { ... })` with `ackTimeout` option\n * - `socket.timeout(5000).emit(\"test\", (err, value) => { ... })`\n * - `const value = await socket.emitWithAck(\"test\")`\n *\n * From those that don't:\n *\n * - `socket.emit(\"test\", (value) => { ... });`\n *\n * In the first case, the handlers will be called with an error when:\n *\n * - the timeout is reached\n * - the socket gets disconnected\n *\n * In the second case, the handlers will be simply discarded upon disconnection, since the client will never receive\n * an acknowledgement from the server.\n *\n * @private\n */\n this.acks = {};\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n this._opts = Object.assign({}, opts);\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Whether the socket is currently disconnected\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.disconnected); // false\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.disconnected); // true\n * });\n */\n get disconnected() {\n return !this.connected;\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects.\n *\n * @example\n * const socket = io();\n *\n * console.log(socket.active); // true\n *\n * socket.on(\"disconnect\", (reason) => {\n * if (reason === \"io server disconnect\") {\n * // the disconnection was initiated by the server, you need to manually reconnect\n * console.log(socket.active); // false\n * }\n * // else the socket will automatically try to reconnect\n * console.log(socket.active); // true\n * });\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @example\n * const socket = io({\n * autoConnect: false\n * });\n *\n * socket.connect();\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for {@link connect()}.\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * This method mimics the WebSocket.send() method.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n *\n * @example\n * socket.send(\"hello\");\n *\n * // this is equivalent to\n * socket.emit(\"message\", \"hello\");\n *\n * @return self\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @example\n * socket.emit(\"hello\", \"world\");\n *\n * // all serializable datastructures are supported (no need to call JSON.stringify)\n * socket.emit(\"hello\", 1, \"2\", { 3: [\"4\"], 5: Uint8Array.from([6]) });\n *\n * // with an acknowledgement from the server\n * socket.emit(\"hello\", \"world\", (val) => {\n * // ...\n * });\n *\n * @return self\n */\n emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev.toString() + '\" is a reserved event name');\n }\n args.unshift(ev);\n if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {\n this._addToQueue(args);\n return this;\n }\n const packet = {\n type: PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n }\n else if (this.connected) {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * @private\n */\n _registerAckCallback(id, ack) {\n var _a;\n const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;\n if (timeout === undefined) {\n this.acks[id] = ack;\n return;\n }\n // @ts-ignore\n const timer = this.io.setTimeoutFn(() => {\n delete this.acks[id];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n if (this.sendBuffer[i].id === id) {\n this.sendBuffer.splice(i, 1);\n }\n }\n ack.call(this, new Error(\"operation has timed out\"));\n }, timeout);\n const fn = (...args) => {\n // @ts-ignore\n this.io.clearTimeoutFn(timer);\n ack.apply(this, args);\n };\n fn.withError = true;\n this.acks[id] = fn;\n }\n /**\n * Emits an event and waits for an acknowledgement\n *\n * @example\n * // without timeout\n * const response = await socket.emitWithAck(\"hello\", \"world\");\n *\n * // with a specific timeout\n * try {\n * const response = await socket.timeout(1000).emitWithAck(\"hello\", \"world\");\n * } catch (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n *\n * @return a Promise that will be fulfilled when the server acknowledges the event\n */\n emitWithAck(ev, ...args) {\n return new Promise((resolve, reject) => {\n const fn = (arg1, arg2) => {\n return arg1 ? reject(arg1) : resolve(arg2);\n };\n fn.withError = true;\n args.push(fn);\n this.emit(ev, ...args);\n });\n }\n /**\n * Add the packet to the queue.\n * @param args\n * @private\n */\n _addToQueue(args) {\n let ack;\n if (typeof args[args.length - 1] === \"function\") {\n ack = args.pop();\n }\n const packet = {\n id: this._queueSeq++,\n tryCount: 0,\n pending: false,\n args,\n flags: Object.assign({ fromQueue: true }, this.flags),\n };\n args.push((err, ...responseArgs) => {\n if (packet !== this._queue[0]) {\n // the packet has already been acknowledged\n return;\n }\n const hasError = err !== null;\n if (hasError) {\n if (packet.tryCount > this._opts.retries) {\n this._queue.shift();\n if (ack) {\n ack(err);\n }\n }\n }\n else {\n this._queue.shift();\n if (ack) {\n ack(null, ...responseArgs);\n }\n }\n packet.pending = false;\n return this._drainQueue();\n });\n this._queue.push(packet);\n this._drainQueue();\n }\n /**\n * Send the first packet of the queue, and wait for an acknowledgement from the server.\n * @param force - whether to resend a packet that has not been acknowledged yet\n *\n * @private\n */\n _drainQueue(force = false) {\n if (!this.connected || this._queue.length === 0) {\n return;\n }\n const packet = this._queue[0];\n if (packet.pending && !force) {\n return;\n }\n packet.pending = true;\n packet.tryCount++;\n this.flags = packet.flags;\n this.emit.apply(this, packet.args);\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this._sendConnectPacket(data);\n });\n }\n else {\n this._sendConnectPacket(this.auth);\n }\n }\n /**\n * Sends a CONNECT packet to initiate the Socket.IO session.\n *\n * @param data\n * @private\n */\n _sendConnectPacket(data) {\n this.packet({\n type: PacketType.CONNECT,\n data: this._pid\n ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data)\n : data,\n });\n }\n /**\n * Called upon engine or manager `error`.\n *\n * @param err\n * @private\n */\n onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @param description\n * @private\n */\n onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n this._clearAcks();\n }\n /**\n * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from\n * the server.\n *\n * @private\n */\n _clearAcks() {\n Object.keys(this.acks).forEach((id) => {\n const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id);\n if (!isBuffered) {\n // note: handlers that do not accept an error as first argument are ignored here\n const ack = this.acks[id];\n delete this.acks[id];\n if (ack.withError) {\n ack.call(this, new Error(\"socket has been disconnected\"));\n }\n }\n });\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n this.onconnect(packet.data.sid, packet.data.pid);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n if (this._pid && args.length && typeof args[args.length - 1] === \"string\") {\n this._lastOffset = args[args.length - 1];\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowledgement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (typeof ack !== \"function\") {\n return;\n }\n delete this.acks[packet.id];\n // @ts-ignore FIXME ack is incorrectly inferred as 'never'\n if (ack.withError) {\n packet.data.unshift(null);\n }\n // @ts-ignore\n ack.apply(this, packet.data);\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id, pid) {\n this.id = id;\n this.recovered = pid && this._pid === pid;\n this._pid = pid; // defined only if connection state recovery is enabled\n this.connected = true;\n this.emitBuffered();\n this.emitReserved(\"connect\");\n this._drainQueue(true);\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually. In that case, the socket will not try to reconnect.\n *\n * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"disconnect\", (reason) => {\n * // console.log(reason); prints \"io client disconnect\"\n * });\n *\n * socket.disconnect();\n *\n * @return self\n */\n disconnect() {\n if (this.connected) {\n this.packet({ type: PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for {@link disconnect()}.\n *\n * @return self\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @example\n * socket.compress(false).emit(\"hello\");\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @example\n * socket.volatile.emit(\"hello\"); // the server may or may not receive it\n *\n * @returns self\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the callback will be called with an error when the\n * given number of milliseconds have elapsed without an acknowledgement from the server:\n *\n * @example\n * socket.timeout(5000).emit(\"my-event\", (err) => {\n * if (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n * });\n *\n * @returns self\n */\n timeout(timeout) {\n this.flags.timeout = timeout;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @example\n * socket.onAny((event, ...args) => {\n * console.log(`got ${event}`);\n * });\n *\n * @param listener\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @example\n * socket.prependAny((event, ...args) => {\n * console.log(`got event ${event}`);\n * });\n *\n * @param listener\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`got event ${event}`);\n * }\n *\n * socket.onAny(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAny(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAny();\n *\n * @param listener\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.onAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n onAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.prependAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n prependAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`sent event ${event}`);\n * }\n *\n * socket.onAnyOutgoing(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAnyOutgoing(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAnyOutgoing();\n *\n * @param [listener] - the catch-all listener (optional)\n */\n offAnyOutgoing(listener) {\n if (!this._anyOutgoingListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyOutgoingListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyOutgoingListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }\n /**\n * Notify the listeners for each packet sent\n *\n * @param packet\n *\n * @private\n */\n notifyOutgoingListeners(packet) {\n if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {\n const listeners = this._anyOutgoingListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, packet.data);\n }\n }\n }\n}\n","/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\nexport function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\nBackoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\nBackoff.prototype.reset = function () {\n this.attempts = 0;\n};\n/**\n * Set the minimum duration\n *\n * @api public\n */\nBackoff.prototype.setMin = function (min) {\n this.ms = min;\n};\n/**\n * Set the maximum duration\n *\n * @api public\n */\nBackoff.prototype.setMax = function (max) {\n this.max = max;\n};\n/**\n * Set the jitter\n *\n * @api public\n */\nBackoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n};\n","import { Socket as Engine, installTimerFunctions, nextTick, } from \"engine.io-client\";\nimport { Socket } from \"./socket.js\";\nimport * as parser from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Backoff } from \"./contrib/backo2.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\nexport class Manager extends Emitter {\n constructor(uri, opts) {\n var _a;\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n installTimerFunctions(this, opts);\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n if (~this._readyState.indexOf(\"open\"))\n return this;\n this.engine = new Engine(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSubDestroy = on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n const onError = (err) => {\n this.cleanup();\n this._readyState = \"closed\";\n this.emitReserved(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n this.maybeReconnectOnOpen();\n }\n };\n // emit `error`\n const errorSub = on(socket, \"error\", onError);\n if (false !== this._timeout) {\n const timeout = this._timeout;\n // set timer\n const timer = this.setTimeoutFn(() => {\n openSubDestroy();\n onError(new Error(\"timeout\"));\n socket.close();\n }, timeout);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n this.subs.push(openSubDestroy);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n this.emitReserved(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n try {\n this.decoder.add(data);\n }\n catch (e) {\n this.onclose(\"parse error\", e);\n }\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n this.emitReserved(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n else if (this._autoConnect && !socket.active) {\n socket.connect();\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called upon engine close.\n *\n * @private\n */\n onclose(reason, description) {\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n this.emitReserved(\"close\", reason, description);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n this.backoff.reset();\n this.emitReserved(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n this._reconnecting = true;\n const timer = this.setTimeoutFn(() => {\n if (self.skipReconnect)\n return;\n this.emitReserved(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n self._reconnecting = false;\n self.reconnect();\n this.emitReserved(\"reconnect_error\", err);\n }\n else {\n self.onreconnect();\n }\n });\n }, delay);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }\n}\n","import { url } from \"./url.js\";\nimport { Manager } from \"./manager.js\";\nimport { Socket } from \"./socket.js\";\n/**\n * Managers cache.\n */\nconst cache = {};\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url(uri, opts.path || \"/socket.io\");\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n io = new Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n cache[id] = new Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.queryKey;\n }\n return io.socket(parsed.path, opts);\n}\n// so that \"lookup\" can be used both as a function (e.g. `io(...)`) and as a\n// namespace (e.g. `io.connect(...)`), for backward compatibility\nObject.assign(lookup, {\n Manager,\n Socket,\n io: lookup,\n connect: lookup,\n});\n/**\n * Protocol version.\n *\n * @public\n */\nexport { protocol } from \"socket.io-parser\";\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nexport { Manager, Socket, lookup as io, lookup as connect, lookup as default, };\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n","import { API_URL, EVENTS_SOCKET } from '@/constants'\r\nimport { TMessage, TTemplateType } from '@/types/chatbox'\r\nimport { genId, getAddress } from '@/utils'\r\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\r\nimport {\r\n createContext,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react'\r\nimport { Socket, io } from 'socket.io-client'\r\nimport { useUnmount } from 'usehooks-ts'\r\n\r\nexport type TSocketCtx = {\r\n socket: Socket\r\n messages: TMessage[]\r\n channelId: string\r\n onEndBot?: () => void\r\n isTest?: boolean\r\n handleSendMessage: (options: {\r\n message: string\r\n cb?: (data: TMessage) => void\r\n type?: TTemplateType\r\n extraData?: string\r\n }) => void\r\n handleClose: () => void\r\n disableInput?: boolean\r\n isShowClose?: boolean\r\n isLoadingMessages?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n handleReload: () => void\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n handleTyping?: () => void\r\n adminId?: string\r\n isForManager?: boolean\r\n}\r\n\r\nexport const SocketCtx = createContext({} as TSocketCtx)\r\n\r\nexport type Props = {\r\n children: React.ReactNode\r\n channelId?: string\r\n onEndBot?: () => void\r\n className?: string\r\n isTest?: boolean\r\n onClose?: () => void\r\n isShowClose?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n isForPreview?: boolean\r\n isForManager?: boolean\r\n adminId?: string\r\n}\r\n\r\nexport const SocketProvider = ({\r\n children,\r\n channelId,\r\n onEndBot,\r\n isTest = false,\r\n onClose,\r\n isShowClose = true,\r\n isForLiveChat,\r\n userId,\r\n customStyles: _customStyles,\r\n isForPreview,\r\n isForManager,\r\n adminId,\r\n}: Props) => {\r\n const [disableInput, setDisableInput] = useState(false)\r\n const [customStyles, setCustomStyles] = useState(\r\n isForManager ? undefined : _customStyles,\r\n )\r\n\r\n const queryClient = useQueryClient()\r\n\r\n const urlParams = useMemo(\r\n () => new URLSearchParams(window.location.search),\r\n [],\r\n )\r\n\r\n const _userId = useMemo(() => (userId ? userId : genId()), [userId])\r\n const _channelId = useMemo(\r\n () => channelId || urlParams.get('channelId') || '',\r\n [channelId, urlParams],\r\n )\r\n\r\n const socketRef = useRef(\r\n io(API_URL, {\r\n autoConnect: false,\r\n transports: ['websocket'],\r\n query: {\r\n userId: adminId ? `${_userId}_${adminId}` : _userId,\r\n },\r\n }),\r\n )\r\n\r\n const { data: messages, isLoading } = useQuery({\r\n queryKey: ['messages', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n if (isForPreview) {\r\n return [\r\n {\r\n isBot: true,\r\n message: 'Hello, how can I help you?',\r\n createdAt: new Date().toISOString(),\r\n },\r\n {\r\n isBot: false,\r\n message: 'I want to know more about your product',\r\n userId: genId(),\r\n createdAt: new Date().toISOString(),\r\n },\r\n ]\r\n }\r\n\r\n const res = await fetch(\r\n `${URL}/api/conversation-live-chat/${\r\n userId || genId()\r\n }/${_channelId}`,\r\n )\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Array\r\n } catch (error) {\r\n return []\r\n }\r\n },\r\n initialData: [],\r\n })\r\n\r\n const { data: custom } = useQuery({\r\n queryKey: ['custom-style', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n const res = await fetch(`${API_URL}/api/custom-chatbox/${_channelId}`)\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Record\r\n } catch (error) {\r\n return undefined\r\n }\r\n },\r\n enabled: !isTest && !isForPreview && !isForManager,\r\n })\r\n\r\n const handleSendMessage: TSocketCtx['handleSendMessage'] = useCallback(\r\n ({ message, cb, extraData, type }) => {\r\n const trimmedMessage = message.trim()\r\n if (trimmedMessage.length === 0) return\r\n\r\n const address = getAddress(_channelId, userId)\r\n\r\n const newMessage: TMessage = {\r\n message: type === 'list-button' ? extraData || '' : trimmedMessage,\r\n userId: adminId ? adminId : userId || genId(),\r\n template: {} as any,\r\n createdAt: new Date().toISOString(),\r\n isTest,\r\n }\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n message: trimmedMessage,\r\n address,\r\n isTest,\r\n createdAt: newMessage.createdAt,\r\n })\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, newMessage]\r\n },\r\n )\r\n\r\n cb && cb(newMessage)\r\n },\r\n [_channelId, adminId, isTest, queryClient, userId],\r\n )\r\n\r\n const handleClose = useCallback(() => {\r\n if (window.parent) {\r\n window.parent.postMessage(\r\n {\r\n type: 'TOGGLE_CHAT',\r\n },\r\n '*',\r\n )\r\n }\r\n onClose?.()\r\n }, [onClose])\r\n\r\n const handleReload = useCallback(() => {\r\n if (isForPreview) return\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n type: 'event',\r\n typeName: 'endConversation',\r\n address: getAddress(_channelId, userId),\r\n isTest,\r\n message: '',\r\n })\r\n setDisableInput(false)\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n () => {\r\n return []\r\n },\r\n )\r\n }, [_channelId, isForPreview, isTest, queryClient, userId])\r\n\r\n useUnmount(() => {\r\n socketRef.current.disconnect()\r\n })\r\n\r\n useEffect(() => {\r\n // if customStyles is set, don't connect to socket because it for preview\r\n if (isForPreview) return\r\n\r\n const socket = socketRef.current\r\n\r\n socket.connect()\r\n\r\n socket.on(EVENTS_SOCKET.MESSAGE, (data) => {\r\n if (data.template?.type === 'list-button') {\r\n setDisableInput(true)\r\n } else {\r\n setDisableInput(false)\r\n }\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, data].filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, { userId: 'typing' }]\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.STOP_TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return prev.filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n return () => {\r\n socket.disconnect()\r\n }\r\n }, [_channelId, queryClient, userId, isForPreview])\r\n\r\n useEffect(() => {\r\n if (isForPreview) {\r\n setDisableInput(true)\r\n }\r\n }, [isForPreview])\r\n\r\n useEffect(() => {\r\n if (custom && !isForManager) {\r\n setCustomStyles(custom as any)\r\n }\r\n }, [custom, isForManager])\r\n\r\n useEffect(() => {\r\n if (_customStyles && !isForManager) {\r\n setCustomStyles(_customStyles)\r\n }\r\n }, [_customStyles, isForManager])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n","import { SocketCtx } from '@/context/socket.ctx'\r\nimport { useContext } from 'react'\r\n\r\n/**\r\n * Custom hook that provides access to the socket context.\r\n * @returns The socket context.\r\n * @throws {Error} If used outside of the SocketProvider.\r\n */\r\nexport const useSocket = () => {\r\n const socketCtx = useContext(SocketCtx)\r\n\r\n if (!socketCtx) {\r\n throw new Error('useSocket must be used within SocketProvider')\r\n }\r\n\r\n return socketCtx\r\n}\r\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t validator(classRest))?.classGroupId;\n}\nconst arbitraryPropertyRegex = /^\\[(.+)\\]$/;\nfunction getGroupIdForArbitraryProperty(className) {\n if (arbitraryPropertyRegex.test(className)) {\n const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];\n const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));\n if (property) {\n // I use two dots here because one dot is used as prefix for class groups in plugins\n return 'arbitrary..' + property;\n }\n }\n}\n/**\n * Exported for testing only\n */\nfunction createClassMap(config) {\n const {\n theme,\n prefix\n } = config;\n const classMap = {\n nextPart: new Map(),\n validators: []\n };\n const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);\n prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {\n processClassesRecursively(classGroup, classMap, classGroupId, theme);\n });\n return classMap;\n}\nfunction processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {\n classGroup.forEach(classDefinition => {\n if (typeof classDefinition === 'string') {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n return;\n }\n if (typeof classDefinition === 'function') {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n classPartObject.validators.push({\n validator: classDefinition,\n classGroupId\n });\n return;\n }\n Object.entries(classDefinition).forEach(([key, classGroup]) => {\n processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);\n });\n });\n}\nfunction getPart(classPartObject, path) {\n let currentClassPartObject = classPartObject;\n path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {\n if (!currentClassPartObject.nextPart.has(pathPart)) {\n currentClassPartObject.nextPart.set(pathPart, {\n nextPart: new Map(),\n validators: []\n });\n }\n currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);\n });\n return currentClassPartObject;\n}\nfunction isThemeGetter(func) {\n return func.isThemeGetter;\n}\nfunction getPrefixedClassGroupEntries(classGroupEntries, prefix) {\n if (!prefix) {\n return classGroupEntries;\n }\n return classGroupEntries.map(([classGroupId, classGroup]) => {\n const prefixedClassGroup = classGroup.map(classDefinition => {\n if (typeof classDefinition === 'string') {\n return prefix + classDefinition;\n }\n if (typeof classDefinition === 'object') {\n return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));\n }\n return classDefinition;\n });\n return [classGroupId, prefixedClassGroup];\n });\n}\n\n// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance\nfunction createLruCache(maxCacheSize) {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = new Map();\n let previousCache = new Map();\n function update(key, value) {\n cache.set(key, value);\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = new Map();\n }\n }\n return {\n get(key) {\n let value = cache.get(key);\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache.get(key)) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (cache.has(key)) {\n cache.set(key, value);\n } else {\n update(key, value);\n }\n }\n };\n}\nconst IMPORTANT_MODIFIER = '!';\nfunction createSplitModifiers(config) {\n const separator = config.separator;\n const isSeparatorSingleCharacter = separator.length === 1;\n const firstSeparatorCharacter = separator[0];\n const separatorLength = separator.length;\n // splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n return function splitModifiers(className) {\n const modifiers = [];\n let bracketDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n for (let index = 0; index < className.length; index++) {\n let currentCharacter = className[index];\n if (bracketDepth === 0) {\n if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + separatorLength;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') {\n bracketDepth++;\n } else if (currentCharacter === ']') {\n bracketDepth--;\n }\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);\n const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);\n const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n };\n };\n}\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nfunction sortModifiers(modifiers) {\n if (modifiers.length <= 1) {\n return modifiers;\n }\n const sortedModifiers = [];\n let unsortedModifiers = [];\n modifiers.forEach(modifier => {\n const isArbitraryVariant = modifier[0] === '[';\n if (isArbitraryVariant) {\n sortedModifiers.push(...unsortedModifiers.sort(), modifier);\n unsortedModifiers = [];\n } else {\n unsortedModifiers.push(modifier);\n }\n });\n sortedModifiers.push(...unsortedModifiers.sort());\n return sortedModifiers;\n}\nfunction createConfigUtils(config) {\n return {\n cache: createLruCache(config.cacheSize),\n splitModifiers: createSplitModifiers(config),\n ...createClassUtils(config)\n };\n}\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nfunction mergeClassList(classList, configUtils) {\n const {\n splitModifiers,\n getClassGroupId,\n getConflictingClassGroupIds\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = new Set();\n return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName => {\n const {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = splitModifiers(originalClassName);\n let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n let hasPostfixModifier = Boolean(maybePostfixModifierPosition);\n if (!classGroupId) {\n if (!maybePostfixModifierPosition) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n hasPostfixModifier = false;\n }\n const variantModifier = sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n return {\n isTailwindClass: true,\n modifierId,\n classGroupId,\n originalClassName,\n hasPostfixModifier\n };\n }).reverse()\n // Last class in conflict wins, so we need to filter conflicting classes in reverse order.\n .filter(parsed => {\n if (!parsed.isTailwindClass) {\n return true;\n }\n const {\n modifierId,\n classGroupId,\n hasPostfixModifier\n } = parsed;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.has(classId)) {\n return false;\n }\n classGroupsInConflict.add(classId);\n getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(group => classGroupsInConflict.add(modifierId + group));\n return true;\n }).reverse().map(parsed => parsed.originalClassName).join(' ');\n}\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards (lukeed.com)\n */\nfunction twJoin() {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < arguments.length) {\n if (argument = arguments[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction toValue(mix) {\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction createTailwindMerge(createConfigFirst, ...createConfigRest) {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall = initTailwindMerge;\n function initTailwindMerge(classList) {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n }\n function tailwindMerge(classList) {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n }\n return function callTailwindMerge() {\n return functionToCall(twJoin.apply(null, arguments));\n };\n}\nfunction fromTheme(key) {\n const themeGetter = theme => theme[key] || [];\n themeGetter.isThemeGetter = true;\n return themeGetter;\n}\nconst arbitraryValueRegex = /^\\[(?:([a-z-]+):)?(.+)\\]$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nfunction isLength(value) {\n return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);\n}\nfunction isArbitraryLength(value) {\n return getIsArbitraryValue(value, 'length', isLengthOnly);\n}\nfunction isNumber(value) {\n return Boolean(value) && !Number.isNaN(Number(value));\n}\nfunction isArbitraryNumber(value) {\n return getIsArbitraryValue(value, 'number', isNumber);\n}\nfunction isInteger(value) {\n return Boolean(value) && Number.isInteger(Number(value));\n}\nfunction isPercent(value) {\n return value.endsWith('%') && isNumber(value.slice(0, -1));\n}\nfunction isArbitraryValue(value) {\n return arbitraryValueRegex.test(value);\n}\nfunction isTshirtSize(value) {\n return tshirtUnitRegex.test(value);\n}\nconst sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);\nfunction isArbitrarySize(value) {\n return getIsArbitraryValue(value, sizeLabels, isNever);\n}\nfunction isArbitraryPosition(value) {\n return getIsArbitraryValue(value, 'position', isNever);\n}\nconst imageLabels = /*#__PURE__*/new Set(['image', 'url']);\nfunction isArbitraryImage(value) {\n return getIsArbitraryValue(value, imageLabels, isImage);\n}\nfunction isArbitraryShadow(value) {\n return getIsArbitraryValue(value, '', isShadow);\n}\nfunction isAny() {\n return true;\n}\nfunction getIsArbitraryValue(value, label, testValue) {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return typeof label === 'string' ? result[1] === label : label.has(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n}\nfunction isLengthOnly(value) {\n // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n // For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\n return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\n}\nfunction isNever() {\n return false;\n}\nfunction isShadow(value) {\n return shadowRegex.test(value);\n}\nfunction isImage(value) {\n return imageRegex.test(value);\n}\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isInteger,\n isLength,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nfunction getDefaultConfig() {\n const colors = fromTheme('colors');\n const spacing = fromTheme('spacing');\n const blur = fromTheme('blur');\n const brightness = fromTheme('brightness');\n const borderColor = fromTheme('borderColor');\n const borderRadius = fromTheme('borderRadius');\n const borderSpacing = fromTheme('borderSpacing');\n const borderWidth = fromTheme('borderWidth');\n const contrast = fromTheme('contrast');\n const grayscale = fromTheme('grayscale');\n const hueRotate = fromTheme('hueRotate');\n const invert = fromTheme('invert');\n const gap = fromTheme('gap');\n const gradientColorStops = fromTheme('gradientColorStops');\n const gradientColorStopPositions = fromTheme('gradientColorStopPositions');\n const inset = fromTheme('inset');\n const margin = fromTheme('margin');\n const opacity = fromTheme('opacity');\n const padding = fromTheme('padding');\n const saturate = fromTheme('saturate');\n const scale = fromTheme('scale');\n const sepia = fromTheme('sepia');\n const skew = fromTheme('skew');\n const space = fromTheme('space');\n const translate = fromTheme('translate');\n const getOverscroll = () => ['auto', 'contain', 'none'];\n const getOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const getSpacingWithAutoAndArbitrary = () => ['auto', isArbitraryValue, spacing];\n const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];\n const getLengthWithEmptyAndArbitrary = () => ['', isLength, isArbitraryLength];\n const getNumberWithAutoAndArbitrary = () => ['auto', isNumber, isArbitraryValue];\n const getPositions = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];\n const getLineStyles = () => ['solid', 'dashed', 'dotted', 'double', 'none'];\n const getBlendModes = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];\n const getAlign = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];\n const getZeroAndEmpty = () => ['', '0', isArbitraryValue];\n const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const getNumber = () => [isNumber, isArbitraryNumber];\n const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];\n return {\n cacheSize: 500,\n separator: ':',\n theme: {\n colors: [isAny],\n spacing: [isLength, isArbitraryLength],\n blur: ['none', '', isTshirtSize, isArbitraryValue],\n brightness: getNumber(),\n borderColor: [colors],\n borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],\n borderSpacing: getSpacingWithArbitrary(),\n borderWidth: getLengthWithEmptyAndArbitrary(),\n contrast: getNumber(),\n grayscale: getZeroAndEmpty(),\n hueRotate: getNumberAndArbitrary(),\n invert: getZeroAndEmpty(),\n gap: getSpacingWithArbitrary(),\n gradientColorStops: [colors],\n gradientColorStopPositions: [isPercent, isArbitraryLength],\n inset: getSpacingWithAutoAndArbitrary(),\n margin: getSpacingWithAutoAndArbitrary(),\n opacity: getNumber(),\n padding: getSpacingWithArbitrary(),\n saturate: getNumber(),\n scale: getNumber(),\n sepia: getZeroAndEmpty(),\n skew: getNumberAndArbitrary(),\n space: getSpacingWithArbitrary(),\n translate: getSpacingWithArbitrary()\n },\n classGroups: {\n // Layout\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', 'video', isArbitraryValue]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isTshirtSize]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': getBreaks()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': getBreaks()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: [...getPositions(), isArbitraryValue]\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: getOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': getOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': getOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: getOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': getOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': getOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: [inset]\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': [inset]\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': [inset]\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: [inset]\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: [inset]\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: [inset]\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: [inset]\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: [inset]\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: [inset]\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: ['auto', isInteger, isArbitraryValue]\n }],\n // Flexbox and Grid\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: getSpacingWithAutoAndArbitrary()\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['wrap', 'wrap-reverse', 'nowrap']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: ['1', 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: getZeroAndEmpty()\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: getZeroAndEmpty()\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: ['first', 'last', 'none', isInteger, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': [isAny]\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: ['auto', {\n span: ['full', isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': [isAny]\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: ['auto', {\n span: [isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: [gap]\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': [gap]\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': [gap]\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: ['normal', ...getAlign()]\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': ['start', 'end', 'center', 'stretch']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...getAlign(), 'baseline']\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', 'start', 'end', 'center', 'stretch', 'baseline']\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': [...getAlign(), 'baseline']\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: [padding]\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: [padding]\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: [padding]\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: [padding]\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: [padding]\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: [padding]\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: [padding]\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: [padding]\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: [padding]\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: [margin]\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: [margin]\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: [margin]\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: [margin]\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: [margin]\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: [margin]\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: [margin]\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: [margin]\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: [margin]\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x': [{\n 'space-x': [space]\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y': [{\n 'space-y': [space]\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y-reverse': ['space-y-reverse'],\n // Sizing\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: ['auto', 'min', 'max', 'fit', 'svw', 'lvw', 'dvw', isArbitraryValue, spacing]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit']\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [isArbitraryValue, spacing, 'none', 'full', 'min', 'max', 'fit', 'prose', {\n screen: [isTshirtSize]\n }, isTshirtSize]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Size\n * @see https://tailwindcss.com/docs/size\n */\n size: [{\n size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']\n }],\n // Typography\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', isTshirtSize, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black', isArbitraryNumber]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isAny]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractons'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest', isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': ['none', isNumber, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryValue]\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['none', 'disc', 'decimal', isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: [colors]\n }],\n /**\n * Placeholder Opacity\n * @see https://tailwindcss.com/docs/placeholder-opacity\n */\n 'placeholder-opacity': [{\n 'placeholder-opacity': [opacity]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: [colors]\n }],\n /**\n * Text Opacity\n * @see https://tailwindcss.com/docs/text-opacity\n */\n 'text-opacity': [{\n 'text-opacity': [opacity]\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...getLineStyles(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: ['auto', 'from-font', isLength, isArbitraryLength]\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': ['auto', isLength, isArbitraryValue]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: [colors]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: getSpacingWithArbitrary()\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryValue]\n }],\n // Backgrounds\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Opacity\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/background-opacity\n */\n 'bg-opacity': [{\n 'bg-opacity': [opacity]\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: [...getPositions(), isArbitraryPosition]\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: ['no-repeat', {\n repeat: ['', 'x', 'y', 'round', 'space']\n }]\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: ['auto', 'cover', 'contain', isArbitrarySize]\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n 'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: [colors]\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: [gradientColorStops]\n }],\n // Borders\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: [borderRadius]\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': [borderRadius]\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': [borderRadius]\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': [borderRadius]\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': [borderRadius]\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': [borderRadius]\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': [borderRadius]\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': [borderRadius]\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': [borderRadius]\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': [borderRadius]\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': [borderRadius]\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': [borderRadius]\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': [borderRadius]\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': [borderRadius]\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': [borderRadius]\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: [borderWidth]\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': [borderWidth]\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': [borderWidth]\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': [borderWidth]\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': [borderWidth]\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': [borderWidth]\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': [borderWidth]\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': [borderWidth]\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': [borderWidth]\n }],\n /**\n * Border Opacity\n * @see https://tailwindcss.com/docs/border-opacity\n */\n 'border-opacity': [{\n 'border-opacity': [opacity]\n }],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...getLineStyles(), 'hidden']\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x': [{\n 'divide-x': [borderWidth]\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y': [{\n 'divide-y': [borderWidth]\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Divide Opacity\n * @see https://tailwindcss.com/docs/divide-opacity\n */\n 'divide-opacity': [{\n 'divide-opacity': [opacity]\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/divide-style\n */\n 'divide-style': [{\n divide: getLineStyles()\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: [borderColor]\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': [borderColor]\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': [borderColor]\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': [borderColor]\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': [borderColor]\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': [borderColor]\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': [borderColor]\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: [borderColor]\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: ['', ...getLineStyles()]\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isLength, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: [isLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: [colors]\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w': [{\n ring: getLengthWithEmptyAndArbitrary()\n }],\n /**\n * Ring Width Inset\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/ring-color\n */\n 'ring-color': [{\n ring: [colors]\n }],\n /**\n * Ring Opacity\n * @see https://tailwindcss.com/docs/ring-opacity\n */\n 'ring-opacity': [{\n 'ring-opacity': [opacity]\n }],\n /**\n * Ring Offset Width\n * @see https://tailwindcss.com/docs/ring-offset-width\n */\n 'ring-offset-w': [{\n 'ring-offset': [isLength, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://tailwindcss.com/docs/ring-offset-color\n */\n 'ring-offset-color': [{\n 'ring-offset': [colors]\n }],\n // Effects\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: ['', 'inner', 'none', isTshirtSize, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow-color\n */\n 'shadow-color': [{\n shadow: [isAny]\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [opacity]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': getBlendModes()\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': getBlendModes()\n }],\n // Filters\n /**\n * Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: ['', 'none']\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: [blur]\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [brightness]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [contrast]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': ['', 'none', isTshirtSize, isArbitraryValue]\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: [grayscale]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [hueRotate]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: [invert]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [saturate]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: [sepia]\n }],\n /**\n * Backdrop Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': ['', 'none']\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': [blur]\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [brightness]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [contrast]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': [grayscale]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [hueRotate]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': [invert]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [opacity]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [saturate]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': [sepia]\n }],\n // Tables\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': [borderSpacing]\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': [borderSpacing]\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': [borderSpacing]\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // Transitions and Animation\n /**\n * Tranisition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['none', 'all', '', 'colors', 'opacity', 'shadow', 'transform', isArbitraryValue]\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: getNumberAndArbitrary()\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'in', 'out', 'in-out', isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: getNumberAndArbitrary()\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', 'spin', 'ping', 'pulse', 'bounce', isArbitraryValue]\n }],\n // Transforms\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: ['', 'gpu', 'none']\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: [scale]\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': [scale]\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': [scale]\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: [isInteger, isArbitraryValue]\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': [translate]\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': [translate]\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': [skew]\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': [skew]\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryValue]\n }],\n // Interactivity\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: ['auto', colors]\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryValue]\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: [colors]\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['none', 'auto']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', 'y', 'x', '']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryValue]\n }],\n // SVG\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: [colors, 'none']\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: [colors, 'none']\n }],\n // Accessibility\n /**\n * Screen Readers\n * @see https://tailwindcss.com/docs/screen-readers\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n }\n };\n}\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nfunction mergeConfigs(baseConfig, {\n cacheSize,\n prefix,\n separator,\n extend = {},\n override = {}\n}) {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'separator', separator);\n for (const configKey in override) {\n overrideConfigProperties(baseConfig[configKey], override[configKey]);\n }\n for (const key in extend) {\n mergeConfigProperties(baseConfig[key], extend[key]);\n }\n return baseConfig;\n}\nfunction overrideProperty(baseObject, overrideKey, overrideValue) {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n}\nfunction overrideConfigProperties(baseObject, overrideObject) {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n}\nfunction mergeConfigProperties(baseObject, mergeObject) {\n if (mergeObject) {\n for (const key in mergeObject) {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = (baseObject[key] || []).concat(mergeValue);\n }\n }\n }\n}\nfunction extendTailwindMerge(configExtension, ...createConfig) {\n return typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\n}\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { toKebabCase } from './shared/src/utils.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n ...rest\n }, ref) => {\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: [\"lucide\", `lucide-${toKebabCase(iconName)}`, className].join(\" \"),\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n );\n Component.displayName = `${iconName}`;\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst LoaderCircle = createLucideIcon(\"LoaderCircle\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]\n]);\n\nexport { LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCcw = createLucideIcon(\"RefreshCcw\", [\n [\"path\", { d: \"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"14sxne\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }],\n [\"path\", { d: \"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16\", key: \"1hlbsb\" }],\n [\"path\", { d: \"M16 16h5v5\", key: \"ccwih5\" }]\n]);\n\nexport { RefreshCcw as default };\n//# sourceMappingURL=refresh-ccw.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Send = createLucideIcon(\"Send\", [\n [\"path\", { d: \"m22 2-7 20-4-9-9-4Z\", key: \"1q3vgg\" }],\n [\"path\", { d: \"M22 2 11 13\", key: \"nzbqef\" }]\n]);\n\nexport { Send as default };\n//# sourceMappingURL=send.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst X = createLucideIcon(\"X\", [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n]);\n\nexport { X as default };\n//# sourceMappingURL=x.js.map\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { TMessage } from '@/types/chatbox'\r\n\r\ntype Props = {\r\n message: TMessage\r\n children?: React.ReactNode\r\n}\r\n\r\n/**\r\n * Represents a message component.\r\n * @param {Object} props - The component props.\r\n * @param {boolean} props.isBot - Indicates whether the message is from a bot.\r\n * @param {string} props.message - The content of the message.\r\n *\r\n */\r\nconst Message = ({ message, children }: Props) => {\r\n const { customStyles, adminId: _adminId, isForManager } = useSocket()\r\n\r\n const isLeft = message.isBot\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {isForManager ? (message.isBot ? 'From bot' : 'From user') : null}\r\n \r\n \r\n {message.message}\r\n {children}\r\n
\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Message\r\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;ttypeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../lib/utils'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow hover:bg-primary/90',\n destructive:\n 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n message:\n 'bg-background shadow-sm border text-primary border-primary hover:bg-primary/10 !rounded-full',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes,\n VariantProps {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return (\n \n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TButtonsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TButtonsMessage\r\n}\r\n\r\nconst ButtonsMessage = ({ message }: Props) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n return (\r\n
\r\n \r\n
\r\n {message.template.data.map((button) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default ButtonsMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TCard, TCardsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TCardsMessage\r\n}\r\n\r\nconst Card = ({ card }: { card: TCard }) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n \r\n

{card.title}

\r\n

{card.subtitle}

\r\n {card.buttons && card.buttons.length > 0 && (\r\n
\r\n {card.buttons.map((button, index) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl\r\n ? `${hsl.h} ${hsl.s}% ${hsl.l}%`\r\n : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport const CardsMessage = ({ message }: Props) => {\r\n return (\r\n
\r\n {message.template.data.map((card, index) => {\r\n return (\r\n }\r\n />\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import Message from './message'\r\n\r\nexport const TypingMessage = () => {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n }\r\n />\r\n )\r\n}\r\n\r\nexport default TypingMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TMessage } from '@/types/chatbox'\r\nimport dayjs from 'dayjs'\r\nimport { Loader2 } from 'lucide-react'\r\nimport { Fragment, useEffect, useRef } from 'react'\r\nimport ButtonsMessage from './buttons-message'\r\nimport { CardsMessage } from './cards-message'\r\nimport Message from './message'\r\nimport TypingMessage from './typing-message'\r\n\r\n/**\r\n * Represents the body component of the chatbox.\r\n * This component displays the main content of the chatbox.\r\n */\r\n\r\nconst Body = () => {\r\n const endMessageRef = useRef(null)\r\n const { messages, isLoadingMessages } = useSocket()\r\n\r\n /**\r\n * Scrolls to the end of the messages when a new message is received.\r\n */\r\n useEffect(() => {\r\n if (!endMessageRef.current) return\r\n\r\n endMessageRef.current.scrollIntoView({ behavior: 'smooth' })\r\n }, [messages])\r\n\r\n const renderMessage = (msg: TMessage, index: number) => {\r\n if (msg?.userId === 'typing') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-button') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-card') {\r\n return \r\n }\r\n\r\n return \r\n }\r\n\r\n return (\r\n
\r\n {isLoadingMessages ? (\r\n
\r\n \r\n
\r\n ) : (\r\n
\r\n {messages.length > 0 && (\r\n
\r\n {dayjs(messages[0].createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {messages.map((msg, index) => {\r\n return (\r\n \r\n {index > 0 &&\r\n dayjs(msg.createdAt).diff(\r\n dayjs(messages[index - 1].createdAt),\r\n 'minutes',\r\n ) > 10 && (\r\n
\r\n {dayjs(msg.createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {renderMessage(msg, index)}\r\n
\r\n )\r\n })}\r\n\r\n
\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport default Body\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { RefreshCcw, X } from 'lucide-react'\r\n\r\n/**\r\n * Represents the header component of the chatbox.\r\n *\r\n */\r\nconst Header = () => {\r\n const { handleClose, isShowClose, handleReload, customStyles, isForManager } =\r\n useSocket()\r\n return (\r\n \r\n
\r\n
\r\n {customStyles?.logoUrl ? (\r\n \r\n ) : (\r\n \r\n \r\n B\r\n \r\n \r\n )}\r\n \r\n {customStyles?.name || 'DialogueBot'}\r\n \r\n
\r\n
\r\n {!isForManager && (\r\n \r\n \r\n
\r\n )}\r\n {isShowClose && (\r\n \r\n \r\n
\r\n )}\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default Header\r\n","import * as React from 'react'\n\nimport { cn } from '../../lib/utils'\nexport interface InputProps\n extends React.InputHTMLAttributes {}\n\nconst Input = React.forwardRef(\n ({ className, type, ...props }, ref) => {\n return (\n \n )\n },\n)\nInput.displayName = 'Input'\n\nexport { Input }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { hexToHSL } from '@/utils'\r\nimport { Send } from 'lucide-react'\r\nimport { useState } from 'react'\r\nimport { Button } from './ui/button'\r\nimport { Input } from './ui/input'\r\n\r\n/**\r\n * Represents the send area component.\r\n */\r\nconst SendArea = () => {\r\n const { handleSendMessage, disableInput, customStyles } = useSocket()\r\n const [message, setMessage] = useState('')\r\n\r\n const handleEnter = (e: React.KeyboardEvent) => {\r\n if (e.key === 'Enter') {\r\n e.preventDefault()\r\n handleSendMessage({\r\n message,\r\n })\r\n\r\n setMessage('')\r\n }\r\n }\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n setMessage(e.target.value)}\r\n onKeyDown={handleEnter}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n />\r\n {\r\n handleSendMessage({\r\n message,\r\n cb: () => setMessage(''),\r\n })\r\n }}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nexport default SendArea\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\r\nimport { Body, Header, SendArea } from '../components'\r\nimport { Props, SocketProvider } from '../context/socket.ctx'\r\n\r\nconst queryClient = new QueryClient()\r\n\r\n/**\r\n * Represents the ChatBox component.\r\n * This component displays a chat box with a header, body, and send area.\r\n */\r\n\r\nconst ChatBox = ({ className }: { className?: string }) => {\r\n const { customStyles, isForManager } = useSocket()\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n {!isForManager && }\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Wrapper component for the chat box.\r\n *\r\n * @returns The rendered chat box wrapped in a SocketProvider.\r\n */\r\nconst ChatBoxWrapper = (props: Omit) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default ChatBoxWrapper\r\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","Object$","Map$","Set$","SetHas$","SetAdd$","MapHas$","MapGet$","MapSet$","ChildFlag","AttributeFlag","EventFlag","StyleAttributeFlag","SvgAttributeFlag","BlockFlag","TEXT_NODE_CACHE","EVENT_PATCH","EVENTS_REGISTRY","IS_NON_DIMENSIONAL","XLINK_NS","XML_NS","X_CHAR","NON_PROPS","VOID_ELEMENTS","document$","HTM_TEMPLATE","HTM_TEMPLATE_CONTENT","SVG_TEMPLATE","node$","element$","characterData$","getOwnPropertyDescriptor$","insertBefore$","cloneNode$","replaceChild$","remove$$1","addEventListener$","removeAttribute$","setAttribute$","setAttributeNS$","setTextContent$","firstChild$","nextSibling$","characterDataSet$","stringToDOM","content","svg","template","createEventListener","el","event","capture","nativeEvent","el2","handler","patch","newValue","_a","childAt","index","j","visitedNodes","removeComments","insertText","setText","setStyleAttribute","setSvgAttribute","setAttribute","isValueNully","isInput","isSelect","isTextArea","__defProp$1","__defNormalProp$1","obj","__publicField$1","AbstractBlock","renderToTemplate","vnode","edits","path","current","style","kebabKey","char","canMergeString","_b","newPath","__defProp","__defNormalProp","__publicField","mapArray","ArrayBlock","oldChildren","newChildren","oldChildrenLength","newChildrenLength","parent","arrayRemove$","arrayMount$","oldHead","newHead","oldTail","newTail","oldHeadChild","newHeadChild","oldTailChild","newTailChild","oldKeyMap","oldHeadKey","newHeadKey","patch$","oldTailKey","newTailKey","nextChild","move$","oldIndex","mount$","oldChild","remove$","refNode","block","array$","arrayPatch$","HOLE_PROXY","_","unwrap","shouldUpdate","root","shouldUpdateCurrentBlock","Block","oldBlock","newBlock","getElements","hydrateNode","elements","getCurrentElement","edit","targetEl","patch2","initsLength","shouldUpdate$","oldValue","firstEdit","newChildBlock","newTargetEl","block2","_oldProps","_newProps","cache","pathLength","isCacheAndKeyExists","siblings","block$","experimental_options","RENDER_SCOPE","SVG_RENDER_SCOPE","Effect","effect","deps","useEffect","REGISTRY","scopedContext","createContext","processProps","portals","processedProps","currentIndex","renderReactScope","wrap","createElement","unstable","isBlock","isCallable","puppetComponent","puppetBlock","reactPortal","createPortal","Fragment","millionPortal","cn","flatten","rawChildren","flattenedChildren","useLayoutEffect","useLayoutEffect$1","traverse","fiber","selector","ascending","useFiber","useRef","useState","bind","maybeFiber","useNearestParent","parentRef","useContainer","rootRef","options","noSlot","blockTarget","defaultType","block$1","MillionBlock","forwardedRef","container","hmrTimestamp","patch$1","portalRef","useCallback","currentBlock","_c","props2","marker","useMemo","childrenSize","MillionArray","each","memo2","as","rest","fragmentRef","setMountPortals","createChildren","MillionFor","typedMemo","memo","getComponent","currentCache","portals2","isEqual","shouldCompiledBlockUpdate","prev","next","compiledBlock","render","blockName","RenderBlock","portalCount","scoped","useContext","derived","scope","targets","len","EVENTS_SOCKET","USER_ID_KEY","API_URL","_assert","number","bool","isBytes","bytes","lengths","hash","exists","instance","checkFinished","output","out","min","assert","_u64","U32_MASK64","_32n","fromBig","le","split","lst","Ah","Al","toBig","shrSH","_l","shrSL","rotrSH","rotrSL","rotrBH","rotrBL","rotr32H","_h","rotr32L","rotlSH","rotlSL","rotlBH","rotlBL","add","Bh","Bl","add3L","Cl","add3H","low","Ch","add4L","Dl","add4H","Dh","add5L","El","add5H","Eh","u64","crypto","exports","crypto_1","_assert_js_1","u8","arr","u32","createView","rotr","word","shift","rotl","byteSwap","byteSwap32","hexes","bytesToHex","hex","asciis","asciiToBase16","hexToBytes","hl","al","array","ai","hi","n1","n2","nextTick","asyncLoop","iters","tick","cb","ts","diff","utf8ToBytes","str","toBytes","data","concatBytes","arrays","sum","res","pad","Hash","toStr","checkOpts","defaults","opts","wrapConstructor","hashCons","hashC","msg","tmp","wrapConstructorWithOpts","wrapXOFConstructorWithOpts","randomBytes","bytesLength","sha3","_u64_js_1","utils_js_1","require$$2","SHA3_PI","SHA3_ROTL","_SHA3_IOTA","_0n","_1n","_2n","_7n","_256n","_0x71n","round","R","y","t","SHA3_IOTA_H","SHA3_IOTA_L","rotlH","rotlL","keccakP","rounds","B","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","Keccak","blockLen","suffix","outputLen","enableXOF","state","pos","take","bufferOut","to","gen","genShake","defaultLength","bigLength","createEntropy","length","random","entropy","bufToBigInt","buf","bits","bi","input","alphabet","randomLetter","createFingerprint","globalObj","global","globals","sourceString","createCounter","count","initialCountMax","counter","fingerprint","firstLetter","time","salt","hashInput","createId","isCuid","id","minLength","maxLength","regex","src","getConstants","createId_1","genId","generatedId","userIdFromLocalStorage","getAddress","channelId","incomeUserId","userId","openInNewTab","url","hexToHSL","bigint","max","Subscribable","listener","isServer","noop","functionalUpdate","updater","isValidTimeout","timeUntilStale","updatedAt","staleTime","matchQuery","filters","query","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","status","mutationKey","hashKey","val","isPlainObject","result","replaceEqualDeep","isPlainArray","aItems","aSize","bItems","bSize","copy","equalItems","shallowEqualObjects","o","hasObjectPrototype","ctor","prot","sleep","ms","resolve","replaceData","prevData","addToEnd","items","newItems","addToStart","skipToken","FocusManager","__privateAdd","_focused","_cleanup","_setup","__privateSet","onFocus","__privateGet","setup","focused","isFocused","focusManager","OnlineManager","_online","onOnline","onlineListener","offlineListener","online","onlineManager","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","isRetryCancelled","isResolved","continueFn","promiseResolve","promiseReject","promise","outerResolve","outerReject","cancel","cancelOptions","reject","cancelRetry","continueRetry","shouldPause","pause","continueResolve","canContinue","run","promiseOrValue","retry","retryDelay","delay","shouldRetry","createNotifyManager","queue","transactions","notifyFn","callback","batchNotifyFn","scheduleFn","setScheduler","batch","flush","schedule","batchCalls","originalQueue","notifyManager","Removable","_gcTimeout","newGcTime","Query","_dispatch","_initialState","_revertState","_cache","_retryer","_observers","_defaultOptions","_abortSignalConsumed","getDefaultState","newData","__privateMethod","dispatch_fn","setStateOptions","observer","fetchOptions","abortController","queryFnContext","addSignalProperty","fetchFn","onError","_d","action","reducer","fetchState","hasData","initialDataUpdatedAt","QueryCache","_queries","client","queryHash","queryInMap","defaultedFilters","queries","Mutation","_mutationCache","variables","executeMutation","restored","_f","_e","_g","_j","_i","_k","_n","_m","_p","_o","_r","_q","_t","_s","MutationCache","_mutations","_mutationId","_resuming","__privateWrapper","pausedMutations","infiniteQueryBehavior","pages","direction","oldPages","oldPageParams","empty","cancelled","queryFn","fetchPage","param","previous","page","maxPages","addTo","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pageParams","lastIndex","QueryClient","_queryCache","_queryDefaults","_mutationDefaults","_mountCount","_unsubscribeFocus","_unsubscribeOnline","cachedData","defaultedOptions","queryCache","refetchFilters","defaultedCancelOptions","promises","queryDefault","QueryObserver","_executeFetch","_updateStaleTimeout","_computeRefetchInterval","_updateRefetchInterval","_updateTimers","_clearStaleTimeout","_clearRefetchInterval","_updateQuery","_notify","_client","_currentQuery","_currentQueryInitialState","_currentResult","_currentResultState","_currentResultOptions","_selectError","_selectFn","_selectResult","_lastQueryWithDefinedData","_staleTimeoutId","_refetchIntervalId","_currentRefetchInterval","_trackedProps","shouldFetchOnMount","executeFetch_fn","updateTimers_fn","shouldFetchOn","clearStaleTimeout_fn","clearRefetchInterval_fn","notifyOptions","prevOptions","prevQuery","updateQuery_fn","mounted","shouldFetchOptionally","updateStaleTimeout_fn","nextRefetchInterval","computeRefetchInterval_fn","updateRefetchInterval_fn","shouldAssignObserverCurrentProperties","onPropTracked","trackedResult","prevResult","prevResultState","prevResultOptions","queryInitialState","newState","isPlaceholderData","fetchOnMount","fetchOptionally","errorUpdatedAt","selectError","placeholderData","isFetching","isPending","isError","isLoading","isStale","nextResult","defaultNotifyOptions","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","typedKey","notify_fn","timeout","nextInterval","shouldLoadOnMount","field","optimisticResult","QueryClientContext","useQueryClient","queryClient","QueryClientProvider","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","shouldThrowError","throwError","params","ensurePreventErrorBoundaryRetry","errorResetBoundary","useClearResetErrorBoundary","getHasError","throwOnError","ensureStaleTime","shouldSuspend","fetchOptimistic","useBaseQuery","Observer","isRestoring","onStoreChange","unsubscribe","useQuery","PACKET_TYPES","PACKET_TYPES_REVERSE","ERROR_PACKET","withNativeBlob","withNativeArrayBuffer","isView","encodePacket","supportsBinary","encodeBlobAsBase64","fileReader","toArray","TEXT_ENCODER","encodePacketToBinary","packet","encoded","chars","lookup","decode","base64","bufferLength","encoded1","encoded2","encoded3","encoded4","arraybuffer","decodePacket","encodedPacket","binaryType","mapBinary","decodeBase64Packet","decoded","SEPARATOR","encodePayload","packets","encodedPackets","decodePayload","encodedPayload","decodedPacket","createPacketEncoderStream","controller","payloadLength","header","view","TEXT_DECODER","totalLength","chunks","acc","chunk","concatChunks","size","buffer","createPacketDecoderStream","maxPayload","expectedLength","isBinary","headerArray","protocol","Emitter","mixin","on","callbacks","globalThisShim","pick","attr","NATIVE_SET_TIMEOUT","globalThis","NATIVE_CLEAR_TIMEOUT","installTimerFunctions","BASE64_OVERHEAD","byteLength","utf8Length","encode","qs","qry","pairs","pair","TransportError","reason","description","Transport","details","onPause","schema","hostname","encodedQuery","map","seed","num","yeast","now","hasCORS","XHR","xdomain","hasXHR2","XMLHttpRequest","Polling","isSSL","port","forceBase64","total","close","Request","req","xhrStatus","uri","xhr","fromError","unloadHandler","terminationEvent","setTimeoutFn","WebSocket","usingBrowserWebSocket","defaultBinaryType","isReactNative","WS","protocols","closeEvent","ev","lastPacket","WT","stream","decoderStream","reader","encoderStream","read","done","transports","re","parts","parse","pathNames","regx","names","$0","$1","$2","Socket","transport","failed","onTransportOpen","cleanup","freezeTransport","onerror","onTransportClose","onclose","onupgrade","payloadSize","cleanupAndClose","waitForUpgrade","upgrades","filteredUpgrades","loc","host","toString","withNativeFile","hasBinary","toJSON","deconstructPacket","buffers","packetData","pack","_deconstructPacket","placeholder","reconstructPacket","_reconstructPacket","RESERVED_EVENTS","PacketType","Encoder","replacer","deconstruction","isObject","Decoder","reviver","isBinaryEvent","BinaryReconstructor","start","binData","io","nsp","ack","isTransportWritable","timer","arg1","arg2","responseArgs","force","listeners","sent","pid","subDestroy","compress","Backoff","rand","deviation","jitter","Manager","_parser","parser","v","Engine","socket","openSubDestroy","errorSub","nsps","attempt","parsed","sameNamespace","newConnection","freeGlobal","freeSelf","useUnmount","func","funcRef","SocketCtx","SocketProvider","onEndBot","isTest","onClose","isShowClose","isForLiveChat","customStyles","_customStyles","isForPreview","isForManager","adminId","disableInput","setDisableInput","setCustomStyles","undefined","urlParams","URLSearchParams","window","search","_userId","_channelId","get","socketRef","autoConnect","messages","isBot","message","createdAt","Date","toISOString","fetch","URL","json","initialData","custom","enabled","handleSendMessage","extraData","trimmedMessage","trim","address","newMessage","emit","MESSAGE","setQueryData","handleClose","postMessage","handleReload","disconnect","connect","filter","TYPING","STOP_TYPING","isLoadingMessages","useSocket","socketCtx","r","clsx","CLASS_PART_SEPARATOR","createClassUtils","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","getClassGroupId","className","classParts","getGroupRecursive","getGroupIdForArbitraryProperty","getConflictingClassGroupIds","classGroupId","hasPostfixModifier","conflicts","classPartObject","currentClassPart","nextClassPartObject","classGroupFromNextClassPart","classRest","validator","arbitraryPropertyRegex","arbitraryPropertyClassName","property","theme","getPrefixedClassGroupEntries","classGroup","processClassesRecursively","classDefinition","classPartObjectToEdit","getPart","isThemeGetter","currentClassPartObject","pathPart","classGroupEntries","prefixedClassGroup","createLruCache","maxCacheSize","cacheSize","previousCache","update","IMPORTANT_MODIFIER","createSplitModifiers","separator","isSeparatorSingleCharacter","firstSeparatorCharacter","separatorLength","modifiers","bracketDepth","modifierStart","postfixModifierPosition","currentCharacter","baseClassNameWithImportantModifier","hasImportantModifier","baseClassName","maybePostfixModifierPosition","sortModifiers","sortedModifiers","unsortedModifiers","modifier","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","splitModifiers","classGroupsInConflict","originalClassName","variantModifier","modifierId","classId","group","twJoin","argument","resolvedValue","string","toValue","mix","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","fromTheme","themeGetter","arbitraryValueRegex","fractionRegex","stringLengths","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isLength","isNumber","isArbitraryLength","getIsArbitraryValue","isLengthOnly","isArbitraryNumber","isInteger","isPercent","isArbitraryValue","isTshirtSize","sizeLabels","isArbitrarySize","isNever","isArbitraryPosition","imageLabels","isArbitraryImage","isImage","isArbitraryShadow","isShadow","isAny","label","testValue","getDefaultConfig","colors","spacing","blur","brightness","borderColor","borderRadius","borderSpacing","borderWidth","contrast","grayscale","hueRotate","invert","gap","gradientColorStops","gradientColorStopPositions","inset","margin","opacity","padding","saturate","scale","sepia","skew","space","translate","getOverscroll","getOverflow","getSpacingWithAutoAndArbitrary","getSpacingWithArbitrary","getLengthWithEmptyAndArbitrary","getNumberWithAutoAndArbitrary","getPositions","getLineStyles","getBlendModes","getAlign","getZeroAndEmpty","getBreaks","getNumber","getNumberAndArbitrary","twMerge","inputs","module","this","u","$","D","S","w","O","M","defaultAttributes","toKebabCase","createLucideIcon","iconName","iconNode","forwardRef","color","strokeWidth","absoluteStrokeWidth","tag","attrs","LoaderCircle","RefreshCcw","Send","X","Message_1","_compiledBlock","_props","v0","v1","v2","v3","v4","v5","v6","v7","Message","_adminId","isLeft","wordBreak","backgroundColor","_extends","target","$6ed0406888f73fc4$var$setRef","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","slotPropValue","childPropValue","falsyToString","cx","cva","base","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","getCompoundVariantClassNames","param1","cvClass","cvClassName","compoundVariantOptions","buttonVariants","default","destructive","outline","secondary","ghost","link","sm","lg","icon","Button","asChild","Comp","Slot","ButtonsMessage","hsl","button","title","Card_1","Card","card","image_url","subtitle","buttons","CardsMessage","TypingMessage","Body","endMessageRef","scrollIntoView","behavior","renderMessage","Loader2","dayjs","Header_1","Header","logoUrl","Input","SendArea","setMessage","handleEnter","preventDefault","ChatBox_1","ChatBox","width","windowSize","height","ChatBoxWrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASa,MAAIA,IAAEC,IAAiBC,IAAE,OAAO,IAAI,eAAe,GAAEC,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAeC,IAAEL,EAAE,mDAAmD,mBAAkBM,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,QAAIC,GAAEC,IAAE,IAAGC,IAAE,MAAKC,IAAE;AAAK,IAASJ,MAAT,WAAaG,IAAE,KAAGH,IAAYD,EAAE,QAAX,WAAiBI,IAAE,KAAGJ,EAAE,MAAcA,EAAE,QAAX,WAAiBK,IAAEL,EAAE;AAAK,SAAIE,KAAKF;AAAE,MAAAL,EAAE,KAAKK,GAAEE,CAAC,KAAG,CAACL,EAAE,eAAeK,CAAC,MAAIC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,QAAGH,KAAGA,EAAE;AAAa,WAAIG,KAAKF,IAAED,EAAE,cAAaC;AAAE,QAASG,EAAED,CAAC,MAAZ,WAAgBC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,WAAM,EAAC,UAAST,GAAE,MAAKM,GAAE,KAAIK,GAAE,KAAIC,GAAE,OAAMF,GAAE,QAAOP,EAAE,QAAO;AAAA,EAAC;AAAC,SAAAU,cAAiBZ,GAAEY,GAA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,WAAWr6C,EAAM4oC,UAAa,CAAA,GACzC,EACF,CAAA;","x_google_ignoreList":[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,74,75,76,77,78,79,80,81,83,84,85,86,87]} \ No newline at end of file +{"version":3,"file":"index.es.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../node_modules/million/dist/shared/million.fb41761f.mjs","../node_modules/million/dist/packages/experimental.mjs","../node_modules/million/dist/shared/million.9efd57f2.mjs","../node_modules/million/dist/packages/react.mjs","../src/constants/index.ts","../node_modules/@noble/hashes/_assert.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/crypto.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/sha3.js","../node_modules/@paralleldrive/cuid2/src/index.js","../node_modules/@paralleldrive/cuid2/index.js","../src/utils/index.ts","../node_modules/@tanstack/query-core/build/modern/subscribable.js","../node_modules/@tanstack/query-core/build/modern/utils.js","../node_modules/@tanstack/query-core/build/modern/focusManager.js","../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../node_modules/@tanstack/query-core/build/modern/retryer.js","../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../node_modules/@tanstack/query-core/build/modern/removable.js","../node_modules/@tanstack/query-core/build/modern/query.js","../node_modules/@tanstack/query-core/build/modern/queryCache.js","../node_modules/@tanstack/query-core/build/modern/mutation.js","../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../node_modules/@tanstack/query-core/build/modern/queryClient.js","../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../node_modules/@tanstack/react-query/build/modern/isRestoring.js","../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../node_modules/@tanstack/react-query/build/modern/utils.js","../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../node_modules/@tanstack/react-query/build/modern/suspense.js","../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../node_modules/@tanstack/react-query/build/modern/useQuery.js","../node_modules/engine.io-parser/build/esm/commons.js","../node_modules/engine.io-parser/build/esm/encodePacket.browser.js","../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js","../node_modules/engine.io-parser/build/esm/decodePacket.browser.js","../node_modules/engine.io-parser/build/esm/index.js","../node_modules/@socket.io/component-emitter/index.mjs","../node_modules/engine.io-client/build/esm/globalThis.browser.js","../node_modules/engine.io-client/build/esm/util.js","../node_modules/engine.io-client/build/esm/contrib/parseqs.js","../node_modules/engine.io-client/build/esm/transport.js","../node_modules/engine.io-client/build/esm/contrib/yeast.js","../node_modules/engine.io-client/build/esm/contrib/has-cors.js","../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js","../node_modules/engine.io-client/build/esm/transports/polling.js","../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js","../node_modules/engine.io-client/build/esm/transports/websocket.js","../node_modules/engine.io-client/build/esm/transports/webtransport.js","../node_modules/engine.io-client/build/esm/transports/index.js","../node_modules/engine.io-client/build/esm/contrib/parseuri.js","../node_modules/engine.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/url.js","../node_modules/socket.io-parser/build/esm/is-binary.js","../node_modules/socket.io-parser/build/esm/binary.js","../node_modules/socket.io-parser/build/esm/index.js","../node_modules/socket.io-client/build/esm/on.js","../node_modules/socket.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/contrib/backo2.js","../node_modules/socket.io-client/build/esm/manager.js","../node_modules/socket.io-client/build/esm/index.js","../node_modules/lodash.debounce/index.js","../node_modules/usehooks-ts/dist/index.js","../src/context/socket.ctx.tsx","../src/hooks/useSocket.ts","../node_modules/clsx/dist/clsx.mjs","../node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/lib/utils.ts","../node_modules/dayjs/dayjs.min.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/loader-circle.js","../node_modules/lucide-react/dist/esm/icons/refresh-ccw.js","../node_modules/lucide-react/dist/esm/icons/send.js","../node_modules/lucide-react/dist/esm/icons/x.js","../src/components/message.tsx","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/components/ui/button.tsx","../src/components/buttons-message.tsx","../src/components/cards-message.tsx","../src/components/typing-message.tsx","../src/components/body.tsx","../src/components/header.tsx","../src/components/ui/input.tsx","../src/components/send-area.tsx","../src/chatbox/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use client';\nconst Object$ = Object;\nconst Map$ = Map;\nconst Set$ = Set;\nconst SetHas$ = Set$.prototype.has;\nconst SetAdd$ = Set$.prototype.add;\nconst MapHas$ = Map$.prototype.has;\nconst MapGet$ = Map$.prototype.get;\nconst MapSet$ = Map$.prototype.set;\nconst ChildFlag = 1;\nconst AttributeFlag = 2;\nconst EventFlag = 4;\nconst StyleAttributeFlag = 8;\nconst SvgAttributeFlag = 16;\nconst BlockFlag = 32;\nconst TEXT_NODE_CACHE = \"__t\";\nconst EVENT_PATCH = \"__p\";\nconst EVENTS_REGISTRY = \"__e\";\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\nconst XLINK_NS = \"http://www.w3.org/1999/xlink\";\nconst XML_NS = \"http://www.w3.org/2000/xmlns/\";\nconst X_CHAR = 120;\nconst NON_PROPS = new Set$([\"href\", \"list\", \"form\", \"tabIndex\", \"download\"]);\nconst VOID_ELEMENTS = new Set$([\"area\", \"base\", \"basefont\", \"bgsound\", \"br\", \"col\", \"command\", \"embed\", \"frame\", \"hr\", \"image\", \"img\", \"input\", \"isindex\", \"keygen\", \"link\", \"menuitem\", \"meta\", \"nextid\", \"param\", \"source\", \"track\", \"wbr\"]);\n\nif (typeof window === \"undefined\") {\n throw new Error(\n \"See http://million.dev/docs/install to install the compiler.\"\n );\n}\nconst document$ = document;\ndocument$.createElement(\"template\");\nconst HTM_TEMPLATE = /* @__PURE__ */ document$.createElement(\"template\");\nconst HTM_TEMPLATE_CONTENT = HTM_TEMPLATE.content;\nconst SVG_TEMPLATE = /* @__PURE__ */ document$.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"svg\"\n);\nconst node$ = Node.prototype;\nconst element$ = Element.prototype;\nconst characterData$ = CharacterData.prototype;\nconst getOwnPropertyDescriptor$ = Object$.getOwnPropertyDescriptor;\nconst insertBefore$ = node$.insertBefore;\nconst cloneNode$ = node$.cloneNode;\nconst replaceChild$ = node$.replaceChild;\nconst remove$$1 = element$.remove;\nconst addEventListener$ = node$.addEventListener;\nconst removeAttribute$ = element$.removeAttribute;\nconst setAttribute$ = element$.setAttribute;\nconst setAttributeNS$ = element$.setAttributeNS;\nconst setTextContent$ = getOwnPropertyDescriptor$(node$, \"textContent\").set;\nconst firstChild$ = getOwnPropertyDescriptor$(node$, \"firstChild\").get;\nconst nextSibling$ = getOwnPropertyDescriptor$(node$, \"nextSibling\").get;\nconst characterDataSet$ = getOwnPropertyDescriptor$(\n characterData$,\n \"data\"\n).set;\nconst stringToDOM = (content, svg) => {\n const template = svg ? SVG_TEMPLATE : HTM_TEMPLATE;\n template.innerHTML = content;\n const dom = svg ? SVG_TEMPLATE : HTM_TEMPLATE_CONTENT;\n return dom.firstChild;\n};\ndocument$[EVENTS_REGISTRY] = new Set$();\nconst createEventListener = (el, name, value) => {\n let event = name.toLowerCase();\n let capture = false;\n if (event.endsWith(\"capture\")) {\n event = event.slice(0, -7);\n capture = true;\n }\n const key = `$$${event}`;\n if (!SetHas$.call(document$[EVENTS_REGISTRY], event)) {\n addEventListener$.call(\n document$,\n event,\n (nativeEvent) => {\n let el2 = nativeEvent.target;\n while (el2) {\n const handler = el2[key];\n if (handler) {\n Object$.defineProperty(nativeEvent, \"currentTarget\", {\n configurable: true,\n get() {\n return el2;\n }\n });\n handler(nativeEvent);\n }\n el2 = el2.parentNode;\n }\n },\n { capture }\n );\n SetAdd$.call(document$[EVENTS_REGISTRY], event);\n }\n const patch = (newValue) => {\n if (!newValue) {\n el[key] = null;\n } else if (!(\"key\" in newValue && newValue.key === el[key]?.key)) {\n el[key] = newValue;\n }\n };\n patch(value);\n return patch;\n};\nconst childAt = (el, index) => {\n let child = firstChild$.call(el);\n if (index) {\n for (let j = 0; j < index; ++j) {\n if (!child)\n break;\n child = nextSibling$.call(child);\n }\n }\n return child;\n};\nconst visitedNodes = /* @__PURE__ */ new WeakSet();\nconst removeComments = (el) => {\n if (visitedNodes.has(el)) {\n return;\n }\n if (el.nodeType === 8) {\n el.parentNode?.removeChild(el);\n }\n let child = firstChild$.call(el);\n while (child) {\n removeComments(child);\n child = child.nextSibling;\n }\n visitedNodes.add(el);\n};\nconst insertText = (el, value, index) => {\n const node = document$.createTextNode(value);\n const child = childAt(el, index);\n insertBefore$.call(el, node, child);\n return node;\n};\nconst setText = (el, value) => {\n characterDataSet$.call(el, value);\n};\nconst setStyleAttribute = (el, name, value) => {\n if (typeof value !== \"number\" || IS_NON_DIMENSIONAL.test(name)) {\n el.style[name] = value;\n } else if (typeof value === \"string\") {\n el.style.cssText = value;\n } else if (name.startsWith(\"-\")) {\n el.style.setProperty(name, String(value));\n } else if (value === void 0 || value === null) {\n el.style[name] = \"\";\n } else {\n el.style[name] = `${String(value)}px`;\n }\n};\nconst setSvgAttribute = (el, name, value) => {\n name = name.replace(/xlink(?:H|:h)/, \"h\").replace(/sName$/, \"s\");\n if (name.startsWith(\"xmlns\")) {\n setAttributeNS$.call(el, XML_NS, name, String(value));\n } else if (name.startsWith(\"xlink\")) {\n setAttributeNS$.call(el, XLINK_NS, \"href\", String(value));\n }\n};\nconst setAttribute = (el, name, value) => {\n const isValueNully = value === void 0 || value === null;\n value = isValueNully ? \"\" : value;\n if (name in el && el[name] !== void 0 && el[name] !== null && !(el instanceof SVGElement) && SetHas$.call(NON_PROPS, name)) {\n try {\n el[name] = value;\n } catch (_err) {\n }\n } else if (!isValueNully && value !== \"\" && (value !== false || name.includes(\"-\"))) {\n setAttribute$.call(el, name, String(value));\n } else {\n removeAttribute$.call(el, name);\n }\n const isInput = el instanceof HTMLInputElement;\n const isSelect = el instanceof HTMLSelectElement;\n const isTextArea = el instanceof HTMLTextAreaElement;\n if (name === \"value\" && (isInput || isSelect || isTextArea)) {\n setAttribute$.call(el, name, String(value));\n el.value = value;\n }\n};\n\nvar __defProp$1 = Object.defineProperty;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField$1 = (obj, key, value) => {\n __defNormalProp$1(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass AbstractBlock {\n constructor() {\n /* root */\n __publicField$1(this, \"r\");\n /* edits */\n __publicField$1(this, \"e\");\n /* el */\n __publicField$1(this, \"l\");\n /* getElements */\n __publicField$1(this, \"g\");\n /* _shouldUpdate */\n __publicField$1(this, \"_u\");\n /* _parent */\n __publicField$1(this, \"_t\");\n /* props */\n __publicField$1(this, \"d\");\n /* key */\n __publicField$1(this, \"k\");\n /* cache */\n __publicField$1(this, \"c\");\n }\n}\n\nconst renderToTemplate = (vnode, edits = [], path = []) => {\n if (typeof vnode === \"string\")\n return vnode;\n if (typeof vnode === \"number\" || typeof vnode === \"bigint\" || vnode === true) {\n return String(vnode);\n }\n if (vnode === null || vnode === void 0 || vnode === false)\n return \"\";\n if (typeof vnode === \"object\" && \"$\" in vnode) {\n edits.push({\n p: path,\n e: [\n {\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: vnode.$,\n /* index */\n i: 0,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n }\n ],\n i: []\n });\n return \"\";\n }\n let props = \"\";\n let children = \"\";\n const current = {\n p: path,\n // The location of the edit in in the virtual node tree\n e: [],\n // Occur on mount + patch\n i: []\n // Occur before mount\n };\n for (let name in vnode.props) {\n const value = vnode.props[name];\n if (name === \"key\" || name === \"ref\" || name === \"children\") {\n continue;\n }\n if (name === \"className\")\n name = \"class\";\n if (name === \"htmlFor\")\n name = \"for\";\n if (name.startsWith(\"on\")) {\n const isValueHole = \"$\" in value;\n if (isValueHole) {\n current.e.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.i.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i: null,\n /* listener */\n l: value,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (value) {\n if (typeof value === \"object\" && \"$\" in value) {\n if (name === \"style\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else if (name.charCodeAt(0) === X_CHAR) {\n current.e.push({\n /* type */\n t: SvgAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.e.push({\n /* type */\n t: AttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (name === \"style\" && typeof value === \"object\") {\n let style = \"\";\n for (const key in value) {\n if (typeof value[key] === \"object\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: key,\n /* value */\n v: null,\n /* hole */\n h: value[key].$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n let kebabKey = \"\";\n for (let i = 0, j = key.length; i < j; ++i) {\n const char = key.charCodeAt(i);\n if (char < 97) {\n kebabKey += `-${String.fromCharCode(char + 32)}`;\n } else {\n kebabKey += key[i];\n }\n }\n style += `${kebabKey}:${String(value[key])};`;\n }\n props += ` style=\"${style}\"`;\n continue;\n }\n props += ` ${name}=\"${String(value)}\"`;\n }\n }\n if (SetHas$.call(VOID_ELEMENTS, vnode.type)) {\n if (current.e.length)\n edits.push(current);\n return `<${vnode.type}${props} />`;\n }\n let canMergeString = false;\n for (let i = 0, j = vnode.props.children?.length || 0, k = 0; i < j; ++i) {\n const child = vnode.props.children?.[i];\n if (child === null || child === void 0 || child === false)\n continue;\n if (typeof child === \"object\" && \"$\" in child) {\n current.e.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: child.$,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n if (child instanceof AbstractBlock) {\n current.i.push({\n /* type */\n t: BlockFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: child\n });\n continue;\n }\n if (typeof child === \"string\" || typeof child === \"number\" || typeof child === \"bigint\") {\n const value = typeof child === \"number\" || typeof child === \"bigint\" ? String(child) : child;\n if (canMergeString) {\n current.i.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: value,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n canMergeString = true;\n children += value;\n k++;\n continue;\n }\n canMergeString = false;\n const newPath = path.slice();\n newPath.push(k++);\n children += renderToTemplate(child, edits, newPath);\n }\n if (current.i.length || current.e.length)\n edits.push(current);\n return `<${vnode.type}${props}>${children}`;\n};\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nconst mapArray = (children) => {\n return new ArrayBlock(children);\n};\nclass ArrayBlock extends AbstractBlock {\n constructor(children) {\n super();\n __publicField(this, \"b\");\n this.b = children;\n }\n v() {\n }\n p(fragment) {\n const oldChildren = this.b;\n const newChildren = fragment.b;\n const oldChildrenLength = oldChildren.length;\n const newChildrenLength = newChildren.length;\n const parent = this.t();\n if (this === fragment)\n return parent;\n if (newChildrenLength === 0 && oldChildrenLength === 0)\n return parent;\n this.b = newChildren;\n if (newChildrenLength === 0) {\n arrayRemove$.call(this);\n return parent;\n }\n if (oldChildrenLength === 0) {\n arrayMount$.call(fragment, parent);\n return parent;\n }\n let oldHead = 0;\n let newHead = 0;\n let oldTail = oldChildrenLength - 1;\n let newTail = newChildrenLength - 1;\n let oldHeadChild = oldChildren[0];\n let newHeadChild = newChildren[0];\n let oldTailChild = oldChildren[oldTail];\n let newTailChild = newChildren[newTail];\n let oldKeyMap;\n while (oldHead <= oldTail && newHead <= newTail) {\n if (!oldHeadChild) {\n oldHeadChild = oldChildren[++oldHead];\n continue;\n }\n if (!oldTailChild) {\n oldTailChild = oldChildren[--oldTail];\n continue;\n }\n const oldHeadKey = oldHeadChild.k;\n const newHeadKey = newHeadChild.k;\n if (oldHeadKey === newHeadKey) {\n patch$.call(oldHeadChild, newHeadChild);\n newChildren[newHead] = oldHeadChild;\n oldHeadChild = oldChildren[++oldHead];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n const oldTailKey = oldTailChild.k;\n const newTailKey = newTailChild.k;\n if (oldTailKey === newTailKey) {\n patch$.call(oldTailChild, newTailChild);\n newChildren[newTail] = oldTailChild;\n oldTailChild = oldChildren[--oldTail];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldHeadKey === newTailKey) {\n patch$.call(oldHeadChild, newTailChild);\n newChildren[newTail] = oldHeadChild;\n const nextChild = newChildren[newTail + 1];\n move$.call(oldHeadChild, nextChild, nextChild?.l || null);\n oldHeadChild = oldChildren[++oldHead];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldTailKey === newHeadKey) {\n patch$.call(oldTailChild, newHeadChild);\n newChildren[newHead] = oldTailChild;\n const nextChild = oldChildren[oldHead];\n move$.call(oldTailChild, nextChild, nextChild?.l || null);\n oldTailChild = oldChildren[--oldTail];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n if (!oldKeyMap) {\n oldKeyMap = new Map$();\n for (let i = oldHead; i <= oldTail; i++) {\n MapSet$.call(oldKeyMap, oldChildren[i].k, i);\n }\n }\n const oldIndex = oldKeyMap.get(newHeadKey);\n if (oldIndex === void 0) {\n mount$.call(newHeadChild, parent, oldHeadChild.l || null);\n } else {\n const oldChild = oldChildren[oldIndex];\n move$.call(oldChild, oldHeadChild, null);\n patch$.call(oldChild, newHeadChild);\n newChildren[newHead] = oldChild;\n oldChildren[oldIndex] = null;\n }\n newHeadChild = newChildren[++newHead];\n }\n if (oldHead <= oldTail || newHead <= newTail) {\n if (oldHead > oldTail) {\n const nextChild = newChildren[newTail + 1];\n for (let i = newHead; i <= newTail; ++i) {\n mount$.call(newChildren[i], parent, nextChild ? nextChild.l : null);\n }\n } else {\n for (let i = oldHead; i <= oldTail; ++i) {\n remove$.call(oldChildren[i]);\n }\n }\n }\n return parent;\n }\n m(parent, refNode = null) {\n if (this._t)\n return this._t;\n for (let i = 0, j = this.b.length; i < j; ++i) {\n const block = this.b[i];\n mount$.call(block, parent, refNode);\n }\n this._t = parent;\n return parent;\n }\n x() {\n const parent = this.t();\n if (parent) {\n setTextContent$.call(parent, \"\");\n } else {\n for (let i = 0, j = this.b.length; i < j; ++i) {\n remove$.call(this.b[i]);\n }\n }\n this.b = [];\n }\n u() {\n return true;\n }\n s() {\n return this.b.map((block) => block.s()).join(\"\");\n }\n t() {\n if (!this._t)\n this._t = this.b[0].t();\n return this._t;\n }\n}\nconst array$ = ArrayBlock.prototype;\nconst arrayMount$ = array$.m;\nconst arrayPatch$ = array$.p;\nconst arrayRemove$ = array$.x;\n\nconst HOLE_PROXY = new Proxy(\n {},\n {\n // A universal getter will return a Hole instance if props[any] is accessed\n // Allows code to identify holes in virtual nodes (\"digs\" them out)\n get(_, key) {\n return { $: key };\n }\n }\n);\nconst block = (fn, unwrap, shouldUpdate, svg) => {\n const vnode = fn(HOLE_PROXY);\n const edits = [];\n const root = stringToDOM(\n renderToTemplate(unwrap ? unwrap(vnode) : vnode, edits),\n svg\n );\n removeComments(root);\n return (props, key, shouldUpdateCurrentBlock) => {\n return new Block(\n root,\n edits,\n props,\n key ?? props?.key ?? null,\n shouldUpdateCurrentBlock ?? shouldUpdate ?? null,\n null\n );\n };\n};\nconst mount = (block2, parent, hydrateNode) => {\n if (\"b\" in block2 && parent) {\n return arrayMount$.call(block2, parent, null);\n }\n return mount$.call(block2, parent, null, hydrateNode);\n};\nconst patch = (oldBlock, newBlock) => {\n if (\"b\" in oldBlock || \"b\" in newBlock) {\n arrayPatch$.call(oldBlock, newBlock);\n }\n if (!oldBlock.l)\n mount$.call(oldBlock, void 0, null, null);\n if (oldBlock.k && oldBlock.k === newBlock.k || oldBlock.r === newBlock.r) {\n return patch$.call(oldBlock, newBlock);\n }\n const el = mount$.call(newBlock, oldBlock.t(), oldBlock.l, null);\n remove$.call(oldBlock);\n oldBlock.k = newBlock.k;\n return el;\n};\nclass Block extends AbstractBlock {\n constructor(root, edits, props, key, shouldUpdate, getElements) {\n super();\n this.r = root;\n this.d = props;\n this.e = edits;\n this.k = key;\n this.c = Array(edits.length);\n if (shouldUpdate) {\n this._u = shouldUpdate;\n } else {\n this._u = null;\n }\n if (getElements) {\n this.g = getElements;\n } else {\n this.g = null;\n }\n }\n m(parent, refNode = null, hydrateNode) {\n if (this.l)\n return this.l;\n const root = hydrateNode ?? cloneNode$.call(this.r, true);\n const elements = this.g?.(root);\n if (elements)\n this.c = elements;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = elements?.[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const value = this.d[edit.h];\n if (edit.t & ChildFlag) {\n if (value instanceof AbstractBlock) {\n const child = childAt(el, edit.i);\n if (hydrateNode) {\n value.m(el, child, child);\n } else {\n value.m(el, child);\n }\n continue;\n }\n if (!el[TEXT_NODE_CACHE])\n el[TEXT_NODE_CACHE] = new Array(l);\n if (value && typeof value === \"object\" && \"foreign\" in value) {\n if (hydrateNode) {\n const child = childAt(el, edit.i);\n value.reset(child);\n }\n const targetEl = value.current;\n el[TEXT_NODE_CACHE][k] = targetEl;\n if (!hydrateNode) {\n insertBefore$.call(el, targetEl, childAt(el, edit.i));\n }\n continue;\n }\n if (hydrateNode) {\n el[TEXT_NODE_CACHE][k] = childAt(el, edit.i);\n continue;\n }\n el[TEXT_NODE_CACHE][k] = insertText(\n el,\n // eslint-disable-next-line eqeqeq\n value == null || value === false ? \"\" : String(value),\n edit.i\n );\n } else if (edit.t & EventFlag) {\n const patch2 = createEventListener(el, edit.n, value);\n el[EVENT_PATCH + edit.n] = patch2;\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, value);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof value === \"string\" || typeof value === \"number\") {\n setStyleAttribute(el, edit.n, value);\n } else {\n for (const style in value) {\n setStyleAttribute(el, style, value[style]);\n }\n }\n } else {\n setSvgAttribute(el, edit.n, value);\n }\n }\n const initsLength = current.i?.length;\n if (!initsLength)\n continue;\n for (let k = 0; k < initsLength; ++k) {\n const init = current.i[k];\n if (init.t & ChildFlag) {\n if (init.v && !hydrateNode)\n insertText(el, init.v, init.i);\n } else if (init.t & EventFlag) {\n createEventListener(el, init.n, init.l);\n } else {\n const child = childAt(el, init.i);\n if (hydrateNode) {\n init.b.m(el, child, child);\n } else {\n init.b.m(el, child);\n }\n }\n }\n }\n if (parent && !hydrateNode) {\n insertBefore$.call(parent, root, refNode);\n }\n this.l = root;\n return root;\n }\n p(newBlock) {\n const root = this.l;\n if (!newBlock.d)\n return root;\n const props = this.d;\n if (!shouldUpdate$.call(this, props, newBlock.d))\n return root;\n this.d = newBlock.d;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = this.c[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const oldValue = props[edit.h];\n const newValue = newBlock.d[edit.h];\n if (newValue === oldValue)\n continue;\n if (edit.t & EventFlag) {\n el[EVENT_PATCH + edit.n](newValue);\n continue;\n }\n if (edit.t & ChildFlag) {\n if (oldValue instanceof AbstractBlock) {\n const firstEdit = newBlock.e?.[i]?.e[k];\n const newChildBlock = newBlock.d[firstEdit.h];\n oldValue.p(newChildBlock);\n continue;\n }\n if (newValue && typeof newValue === \"object\" && \"foreign\" in newValue) {\n const targetEl = el[TEXT_NODE_CACHE][k];\n if (newValue.unstable && oldValue !== newValue) {\n const newTargetEl = newValue.current;\n el[TEXT_NODE_CACHE][k] = newTargetEl;\n replaceChild$.call(el, newTargetEl, targetEl);\n } else {\n newValue.current = targetEl;\n }\n continue;\n }\n setText(\n el[TEXT_NODE_CACHE][k],\n // eslint-disable-next-line eqeqeq\n newValue == null || newValue === false ? \"\" : String(newValue)\n );\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, newValue);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof newValue === \"string\" || typeof newValue === \"number\") {\n setStyleAttribute(el, edit.n, newValue);\n } else {\n for (const style in newValue) {\n if (newValue[style] !== oldValue[style]) {\n setStyleAttribute(el, style, newValue[style]);\n }\n }\n }\n } else {\n setSvgAttribute(el, edit.n, newValue);\n }\n }\n }\n return root;\n }\n v(block2 = null, refNode = null) {\n insertBefore$.call(this.t(), this.l, block2 ? block2.l : refNode);\n }\n x() {\n remove$$1.call(this.l);\n this.l = null;\n }\n u(_oldProps, _newProps) {\n if (!this._u)\n return true;\n return this._u(_oldProps, _newProps);\n }\n s() {\n return String(this.l?.outerHTML);\n }\n t() {\n if (!this._t)\n this._t = this.l?.parentElement;\n return this._t;\n }\n}\nconst getCurrentElement = (path, root, cache, key) => {\n const pathLength = path.length;\n if (!pathLength)\n return root;\n const isCacheAndKeyExists = cache && key !== void 0;\n if (isCacheAndKeyExists && cache[key]) {\n return cache[key];\n }\n for (let i = 0; i < pathLength; ++i) {\n const siblings = path[i];\n root = childAt(root, siblings);\n }\n if (isCacheAndKeyExists)\n cache[key] = root;\n return root;\n};\nconst withKey = (value, key) => {\n value.key = key;\n return value;\n};\nconst block$ = Block.prototype;\nconst mount$ = block$.m;\nconst patch$ = block$.p;\nconst move$ = block$.v;\nconst remove$ = block$.x;\nconst shouldUpdate$ = block$.u;\n\nexport { ArrayBlock as A, Block as B, MapHas$ as M, MapSet$ as a, block as b, cloneNode$ as c, arrayPatch$ as d, mapArray as e, arrayMount$ as f, MapGet$ as g, mount as h, removeComments as i, renderToTemplate as j, AbstractBlock as k, firstChild$ as l, mount$ as m, nextSibling$ as n, patch as p, remove$ as r, stringToDOM as s, withKey as w };\n","'use client';\nconst experimental_options = {\n noSlot: false\n};\n\nexport { experimental_options };\n","'use client';\nimport { useEffect, createContext, isValidElement, createElement, Fragment, useRef, useLayoutEffect as useLayoutEffect$1, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nconst RENDER_SCOPE = \"slot\";\nconst SVG_RENDER_SCOPE = \"g\";\nconst Effect = ({\n effect,\n deps\n}) => {\n useEffect(effect, deps || []);\n return null;\n};\nconst REGISTRY = /* @__PURE__ */ new Map();\n\nconst scopedContext = createContext(false);\nconst processProps = (props, ref, portals) => {\n const processedProps = { ref };\n let currentIndex = 0;\n for (const key in props) {\n const value = props[key];\n if (isValidElement(value) || Array.isArray(value) && value.length && isValidElement(value[0])) {\n processedProps[key] = renderReactScope(\n value,\n false,\n portals,\n currentIndex++\n );\n continue;\n }\n processedProps[key] = props[key];\n }\n return processedProps;\n};\nconst wrap = (vnode, key) => {\n return createElement(\n RENDER_SCOPE,\n { suppressHydrationWarning: true, id: key },\n vnode\n );\n};\nconst renderReactScope = (vnode, unstable, portals, currentIndex, key) => {\n const el = portals?.[currentIndex]?.current;\n const isBlock = isValidElement(vnode) && typeof vnode.type === \"function\" && \"_c\" in vnode.type;\n const isCallable = isBlock && vnode.type._c;\n if (typeof window === \"undefined\") {\n if (isBlock) {\n if (isCallable) {\n return vnode;\n }\n return wrap(wrap(vnode), key);\n }\n return wrap(vnode, key);\n }\n if (isCallable) {\n const puppetComponent = vnode.type(vnode.props);\n if (REGISTRY.has(puppetComponent.type)) {\n const puppetBlock = REGISTRY.get(puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n return puppetBlock(puppetComponent.props);\n }\n }\n }\n const current = el ?? (key ? document.getElementById(key) : null) ?? document.createElement(RENDER_SCOPE);\n const reactPortal = createPortal(\n createElement(Fragment, { children: vnode }),\n current,\n key\n );\n const millionPortal = {\n foreign: true,\n current,\n portal: reactPortal,\n reset: (child) => {\n child.childNodes.forEach((cn) => child.removeChild(cn));\n },\n unstable\n };\n if (portals) {\n portals[currentIndex] = millionPortal;\n }\n return millionPortal;\n};\nconst unwrap = (vnode) => {\n if (typeof vnode !== \"object\" || vnode === null || !(\"type\" in vnode)) {\n if (typeof vnode === \"number\") {\n return String(vnode);\n }\n return vnode;\n }\n let type = vnode.type;\n if (typeof type === \"function\") {\n return unwrap(type(vnode.props ?? {}));\n }\n if (typeof type === \"object\" && \"$\" in type)\n return type;\n const props = { ...vnode.props };\n if (\"css\" in props && \"__EMOTION_TYPE_PLEASE_DO_NOT_USE__\" in props) {\n props.style = props.css.styles;\n type = props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.css;\n }\n const children = vnode.props?.children;\n if (children !== void 0 && children !== null) {\n props.children = flatten(vnode.props.children).map(\n (child) => unwrap(child)\n );\n }\n return {\n type,\n // lets pretend no function go through\n props\n };\n};\nconst flatten = (rawChildren) => {\n if (rawChildren === void 0 || rawChildren === null)\n return [];\n if (typeof rawChildren === \"object\" && \"type\" in rawChildren && rawChildren.type === Fragment) {\n return flatten(rawChildren.props.children);\n }\n if (!Array.isArray(rawChildren) || typeof rawChildren === \"object\" && \"$\" in rawChildren) {\n return [rawChildren];\n }\n const flattenedChildren = rawChildren.flat(Infinity);\n const children = [];\n for (let i = 0, l = flattenedChildren.length; i < l; ++i) {\n children.push(...flatten(flattenedChildren[i]));\n }\n return children;\n};\n\nconst useLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect$1;\nfunction traverse(fiber, selector, ascending) {\n if (!fiber || selector(fiber))\n return fiber;\n let child = ascending ? fiber.return : fiber.child;\n while (child) {\n const match = traverse(child, selector, ascending);\n if (match)\n return match;\n child = ascending ? null : child.sibling;\n }\n}\nfunction useFiber() {\n const fiber = useRef();\n useState(() => {\n const bind = Function.prototype.bind;\n Function.prototype.bind = function(self, maybeFiber) {\n if (self === null && typeof maybeFiber?.type === \"function\") {\n fiber.current = maybeFiber;\n Function.prototype.bind = bind;\n }\n return bind.apply(this, arguments);\n };\n });\n return fiber.current;\n}\nfunction useNearestParent(type) {\n const fiber = useFiber();\n const parentRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n parentRef.current.el = traverse(\n fiber,\n (node) => {\n parentRef.current.depth++;\n return typeof node.type === \"string\" && (type === void 0 || node.type === type);\n },\n true\n )?.stateNode;\n }, [fiber]);\n return parentRef;\n}\nfunction useContainer() {\n const fiber = useFiber();\n const rootRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n rootRef.current.el = traverse(\n fiber,\n (node) => {\n rootRef.current.depth++;\n return node.stateNode?.containerInfo != null;\n },\n true\n )?.stateNode.containerInfo;\n }, [fiber]);\n return rootRef;\n}\n\nexport { Effect as E, RENDER_SCOPE as R, SVG_RENDER_SCOPE as S, REGISTRY as a, useContainer as b, useNearestParent as c, processProps as p, renderReactScope as r, scopedContext as s, unwrap as u };\n","'use client';\nimport { b as block$1, M as MapHas$, a as MapSet$, c as cloneNode$, m as mount$, p as patch, r as remove$, d as arrayPatch$, e as mapArray, f as arrayMount$, g as MapGet$, h as mount } from '../shared/million.fb41761f.mjs';\nexport { i as removeComments } from '../shared/million.fb41761f.mjs';\nimport { useRef, useCallback, useMemo, createElement, Fragment, useState, useEffect, memo, useContext } from 'react';\nimport { experimental_options } from './experimental.mjs';\nimport { S as SVG_RENDER_SCOPE, R as RENDER_SCOPE, u as unwrap, a as REGISTRY, b as useContainer, c as useNearestParent, p as processProps, E as Effect, r as renderReactScope, s as scopedContext } from '../shared/million.9efd57f2.mjs';\nimport 'react-dom';\n\nconst block = (fn, options = {}) => {\n const noSlot = options?.experimental_noSlot ?? experimental_options.noSlot;\n let blockTarget = options?.block;\n const defaultType = options?.svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n if (fn) {\n blockTarget = block$1(\n fn,\n unwrap,\n options?.shouldUpdate,\n options?.svg\n );\n }\n const MillionBlock = (props, forwardedRef) => {\n const container = useContainer();\n const parentRef = useNearestParent();\n const hmrTimestamp = props._hmr;\n const ref = useRef(null);\n const patch$1 = useRef(null);\n const portalRef = useRef([]);\n props = processProps(props, forwardedRef, portalRef.current);\n patch$1.current?.(props);\n const effect = useCallback(() => {\n if (!ref.current && !noSlot)\n return;\n const currentBlock = blockTarget(props, props.key);\n if (hmrTimestamp && ref.current?.textContent) {\n ref.current.textContent = \"\";\n }\n if (noSlot) {\n ref.current = parentRef.current?.el ?? container.current?.el;\n if (props.scoped || parentRef.current && container.current && parentRef.current.depth > container.current.depth) {\n ref.current = container.current.el;\n }\n if (ref.current.childNodes.length) {\n console.error(\n new Error(`\\`experimental_options.noSlot\\` does not support having siblings at the moment.\nThe block element should be the only child of the \\`${cloneNode$.call(ref.current).outerHTML}\\` element.\nTo avoid this error, \\`experimental_options.noSlot\\` should be false`)\n );\n }\n }\n if (patch$1.current === null || hmrTimestamp) {\n mount$.call(currentBlock, ref.current, null);\n patch$1.current = (props2) => {\n patch(\n currentBlock,\n blockTarget(\n props2,\n props2.key,\n options?.shouldUpdate\n )\n );\n };\n }\n return () => {\n remove$.call(currentBlock);\n };\n }, []);\n const marker = useMemo(() => {\n if (noSlot) {\n return null;\n }\n return createElement(options?.as ?? defaultType, { ref });\n }, []);\n const childrenSize = portalRef.current.length;\n const children = new Array(childrenSize);\n for (let i = 0; i < childrenSize; ++i) {\n children[i] = portalRef.current[i]?.portal;\n }\n const vnode = createElement(\n Fragment,\n {},\n marker,\n createElement(Effect, {\n effect,\n deps: hmrTimestamp ? [hmrTimestamp] : []\n }),\n children\n );\n return vnode;\n };\n if (!MapHas$.call(REGISTRY, MillionBlock)) {\n MapSet$.call(REGISTRY, MillionBlock, block);\n }\n if (options?.name) {\n if (fn) {\n fn.displayName = `Million(Render(${options.name}))`;\n }\n MillionBlock.displayName = `Million(Block(${options.name}))`;\n }\n return MillionBlock;\n};\n\nconst MillionArray = ({\n each,\n children,\n memo: memo2,\n svg,\n as,\n ...rest\n}) => {\n const ref = useRef(null);\n const [portals] = useState(() => ({\n current: Array(each.length)\n }));\n const fragmentRef = useRef(null);\n const cache = useRef({\n each: null,\n children: null,\n mounted: false\n });\n const [, setMountPortals] = useState(false);\n if (fragmentRef.current && (each !== cache.current.each || !memo2)) {\n const newChildren = createChildren(each, children, cache, portals, memo2);\n arrayPatch$.call(fragmentRef.current, mapArray(newChildren));\n }\n const defaultType = svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n const MillionFor = createElement(\n Fragment,\n null,\n createElement(as ?? defaultType, { ...rest, ref }),\n ...portals.current.map((p) => p.portal)\n );\n useEffect(() => {\n if (!ref.current || fragmentRef.current)\n return;\n if (cache.current.mounted)\n return;\n const newChildren = createChildren(each, children, cache, portals, memo2);\n fragmentRef.current = mapArray(newChildren);\n if (!MapHas$.call(REGISTRY, MillionFor)) {\n MapSet$.call(REGISTRY, MillionFor, fragmentRef.current);\n }\n arrayMount$.call(fragmentRef.current, ref.current);\n cache.current.mounted = true;\n setMountPortals(true);\n }, [ref.current]);\n return MillionFor;\n};\nconst typedMemo = memo;\nconst For = typedMemo(MillionArray);\nconst createChildren = (each, getComponent, cache, portals, memo2) => {\n const children = Array(each.length);\n const currentCache = cache.current;\n for (let i = 0, l = each.length; i < l; ++i) {\n if (memo2 && currentCache.each && currentCache.each[i] === each[i]) {\n children[i] = currentCache.children?.[i];\n continue;\n }\n const vnode = getComponent(each[i], i);\n if (MapHas$.call(REGISTRY, vnode.type)) {\n if (!currentCache.block) {\n currentCache.block = MapGet$.call(REGISTRY, vnode.type);\n }\n children[i] = currentCache.block(vnode.props, portals, i);\n continue;\n }\n if (typeof vnode.type === \"function\" && \"_c\" in vnode.type) {\n const puppetComponent = vnode.type(vnode.props);\n if (MapHas$.call(REGISTRY, puppetComponent.type)) {\n const puppetBlock = MapGet$.call(REGISTRY, puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n children[i] = puppetBlock(puppetComponent.props);\n continue;\n }\n }\n }\n const block = block$1((props) => props?.scope);\n const currentBlock = (props, portals2, index) => {\n return block(\n {\n scope: renderReactScope(\n createElement(vnode.type, props),\n false,\n portals2.current,\n index\n )\n },\n vnode.key ? String(vnode.key) : void 0\n );\n };\n MapSet$.call(REGISTRY, vnode.type, currentBlock);\n currentCache.block = currentBlock;\n children[i] = currentBlock(vnode.props, portals, i);\n }\n currentCache.each = each;\n currentCache.children = children;\n return children;\n};\n\nfunction isEqual(a, b) {\n return a === b || a !== a && b !== b;\n}\nfunction shouldCompiledBlockUpdate(prev, next) {\n for (const key in prev) {\n if (!isEqual(prev[key], next[key])) {\n return true;\n }\n }\n return false;\n}\nfunction compiledBlock(render, { portals, ...options }) {\n const blockName = `CompiledBlock(Inner(${options.name}))`;\n const RenderBlock = block((props) => render(props), {\n ...options,\n scoped: void 0,\n name: blockName,\n shouldUpdate: shouldCompiledBlockUpdate\n });\n const portalCount = portals?.length || 0;\n const Component = portals && portalCount > 0 ? (props) => {\n const scoped = useContext(scopedContext);\n const [current] = useState(() => []);\n const derived = { ...props, scoped };\n for (let i = 0; i < portalCount; i++) {\n const index = portals[i];\n const scope = renderReactScope(\n derived[index],\n false,\n current,\n i\n );\n derived[index] = scope;\n }\n const targets = [];\n for (let i = 0, len = current.length; i < len; i++) {\n targets[i] = current[i].portal;\n }\n return createElement(\n Fragment,\n null,\n createElement(RenderBlock, derived),\n targets\n );\n } : (props) => createElement(RenderBlock, props);\n if (options.name) {\n Component.displayName = `Million(CompiledBlock(Outer(${options.name})))`;\n }\n return Component;\n}\n\nconst INTERNALS = {\n block: block$1,\n patch,\n mount\n};\nif (typeof window !== \"undefined\") {\n window.__MILLION_DATA__ = {\n version: \"3.0.6\"\n };\n}\n\nexport { For, INTERNALS, REGISTRY, block, compiledBlock, renderReactScope, unwrap };\n","export const EVENTS_SOCKET = {\r\n MESSAGE: 'message',\r\n TYPING: 'typing',\r\n STOP_TYPING: 'stop-typing',\r\n AGENT_MESSAGE: 'agent-message',\r\n}\r\n\r\nexport const USER_ID_KEY = 'user-bot-id'\r\n\r\nexport const API_URL = import.meta.env.DEV\r\n ? 'http://localhost:8080'\r\n : 'https://api.dialoguebot.tech'\r\n\r\nconsole.log('API_URL', API_URL)\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = exports.isBytes = void 0;\nfunction number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`positive integer expected, not ${n}`);\n}\nexports.number = number;\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`boolean expected, not ${b}`);\n}\nexports.bool = bool;\n// copied from utils\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\nfunction bytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);\n}\nexports.bytes = bytes;\nfunction hash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(h.outputLen);\n number(h.blockLen);\n}\nexports.hash = hash;\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexports.exists = exists;\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexports.output = output;\nconst assert = { number, bool, bytes, hash, exists, output };\nexports.default = assert;\n//# sourceMappingURL=_assert.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.add = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = exports.split = exports.fromBig = void 0;\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nexports.fromBig = fromBig;\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nexports.split = split;\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\nexports.toBig = toBig;\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nexports.shrSH = shrSH;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.shrSL = shrSL;\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nexports.rotrSH = rotrSH;\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.rotrSL = rotrSL;\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nexports.rotrBH = rotrBH;\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\nexports.rotrBL = rotrBL;\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nexports.rotr32H = rotr32H;\nconst rotr32L = (h, _l) => h;\nexports.rotr32L = rotr32L;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nexports.rotlSH = rotlSH;\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nexports.rotlSL = rotlSL;\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nexports.rotlBH = rotlBH;\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nexports.rotlBL = rotlBL;\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\nexports.add = add;\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nexports.add3L = add3L;\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nexports.add3H = add3H;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nexports.add4L = add4L;\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nexports.add4H = add4H;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nexports.add5L = add5L;\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\nexports.add5H = add5H;\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexports.default = u64;\n//# sourceMappingURL=_u64.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.crypto = void 0;\nexports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","\"use strict\";\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.byteSwap32 = exports.byteSwapIfBE = exports.byteSwap = exports.isLE = exports.rotl = exports.rotr = exports.createView = exports.u32 = exports.u8 = exports.isBytes = void 0;\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nconst crypto_1 = require(\"@noble/hashes/crypto\");\nconst _assert_js_1 = require(\"./_assert.js\");\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\n// Cast array to different type\nconst u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.u8 = u8;\nconst u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\nexports.u32 = u32;\n// Cast array to view\nconst createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.createView = createView;\n// The rotate right (circular right shift) operation for uint32\nconst rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\nexports.rotr = rotr;\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0);\nexports.rotl = rotl;\nexports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\n// The byte swap operation for uint32\nconst byteSwap = (word) => ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff);\nexports.byteSwap = byteSwap;\n// Conditionally byte swap if on a big-endian platform\nexports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => (0, exports.byteSwap)(n);\n// In place byte swap for Uint32Array\nfunction byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = (0, exports.byteSwap)(arr[i]);\n }\n}\nexports.byteSwap32 = byteSwap32;\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nfunction bytesToHex(bytes) {\n (0, _assert_js_1.bytes)(bytes);\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexports.bytesToHex = bytesToHex;\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 };\nfunction asciiToBase16(char) {\n if (char >= asciis._0 && char <= asciis._9)\n return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F)\n return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f)\n return char - (asciis._a - 10);\n return;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nfunction hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2;\n }\n return array;\n}\nexports.hexToBytes = hexToBytes;\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nconst nextTick = async () => { };\nexports.nextTick = nextTick;\n// Returns control to thread each 'tick' ms to avoid blocking\nasync function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await (0, exports.nextTick)();\n ts += diff;\n }\n}\nexports.asyncLoop = asyncLoop;\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nexports.utf8ToBytes = utf8ToBytes;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n (0, _assert_js_1.bytes)(data);\n return data;\n}\nexports.toBytes = toBytes;\n/**\n * Copies several Uint8Arrays into one.\n */\nfunction concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n (0, _assert_js_1.bytes)(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\nexports.concatBytes = concatBytes;\n// For runtime check if class implements interface\nclass Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nexports.Hash = Hash;\nconst toStr = {}.toString;\nfunction checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexports.checkOpts = checkOpts;\nfunction wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexports.wrapConstructor = wrapConstructor;\nfunction wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapConstructorWithOpts = wrapConstructorWithOpts;\nfunction wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nfunction randomBytes(bytesLength = 32) {\n if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') {\n return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\nexports.randomBytes = randomBytes;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = exports.keccakP = void 0;\nconst _assert_js_1 = require(\"./_assert.js\");\nconst _u64_js_1 = require(\"./_u64.js\");\nconst utils_js_1 = require(\"./utils.js\");\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ (0, _u64_js_1.split)(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBH)(h, l, s) : (0, _u64_js_1.rotlSH)(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBL)(h, l, s) : (0, _u64_js_1.rotlSL)(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nfunction keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexports.keccakP = keccakP;\nclass Keccak extends utils_js_1.Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n (0, _assert_js_1.number)(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = (0, utils_js_1.u32)(this.state);\n }\n keccak() {\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n keccakP(this.state32, this.rounds);\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n (0, _assert_js_1.exists)(this);\n const { blockLen, state } = this;\n data = (0, utils_js_1.toBytes)(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n (0, _assert_js_1.exists)(this, false);\n (0, _assert_js_1.bytes)(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n (0, _assert_js_1.number)(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n (0, _assert_js_1.output)(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nexports.Keccak = Keccak;\nconst gen = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructor)(() => new Keccak(blockLen, suffix, outputLen));\nexports.sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexports.sha3_256 = gen(0x06, 136, 256 / 8);\nexports.sha3_384 = gen(0x06, 104, 384 / 8);\nexports.sha3_512 = gen(0x06, 72, 512 / 8);\nexports.keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexports.keccak_256 = gen(0x01, 136, 256 / 8);\nexports.keccak_384 = gen(0x01, 104, 384 / 8);\nexports.keccak_512 = gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapXOFConstructorWithOpts)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexports.shake128 = genShake(0x1f, 168, 128 / 8);\nexports.shake256 = genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/* global global, window, module */\nconst { sha3_512: sha3 } = require(\"@noble/hashes/sha3\");\n\nconst defaultLength = 24;\nconst bigLength = 32;\n\nconst createEntropy = (length = 4, random = Math.random) => {\n let entropy = \"\";\n\n while (entropy.length < length) {\n entropy = entropy + Math.floor(random() * 36).toString(36);\n }\n return entropy;\n};\n\n/*\n * Adapted from https://github.com/juanelas/bigint-conversion\n * MIT License Copyright (c) 2018 Juan Hernández Serrano\n */\nfunction bufToBigInt(buf) {\n let bits = 8n;\n\n let value = 0n;\n for (const i of buf.values()) {\n const bi = BigInt(i);\n value = (value << bits) + bi;\n }\n return value;\n}\n\nconst hash = (input = \"\") => {\n // Drop the first character because it will bias the histogram\n // to the left.\n return bufToBigInt(sha3(input)).toString(36).slice(1);\n};\n\nconst alphabet = Array.from({ length: 26 }, (x, i) =>\n String.fromCharCode(i + 97)\n);\n\nconst randomLetter = (random) =>\n alphabet[Math.floor(random() * alphabet.length)];\n\n/*\nThis is a fingerprint of the host environment. It is used to help\nprevent collisions when generating ids in a distributed system.\nIf no global object is available, you can pass in your own, or fall back\non a random string.\n*/\nconst createFingerprint = ({\n globalObj = typeof global !== \"undefined\"\n ? global\n : typeof window !== \"undefined\"\n ? window\n : {},\n random = Math.random,\n} = {}) => {\n const globals = Object.keys(globalObj).toString();\n const sourceString = globals.length\n ? globals + createEntropy(bigLength, random)\n : createEntropy(bigLength, random);\n\n return hash(sourceString).substring(0, bigLength);\n};\n\nconst createCounter = (count) => () => {\n return count++;\n};\n\n// ~22k hosts before 50% chance of initial counter collision\n// with a remaining counter range of 9.0e+15 in JavaScript.\nconst initialCountMax = 476782367;\n\nconst init = ({\n // Fallback if the user does not pass in a CSPRNG. This should be OK\n // because we don't rely solely on the random number generator for entropy.\n // We also use the host fingerprint, current time, and a session counter.\n random = Math.random,\n counter = createCounter(Math.floor(random() * initialCountMax)),\n length = defaultLength,\n fingerprint = createFingerprint({ random }),\n} = {}) => {\n return function cuid2() {\n const firstLetter = randomLetter(random);\n\n // If we're lucky, the `.toString(36)` calls may reduce hashing rounds\n // by shortening the input to the hash function a little.\n const time = Date.now().toString(36);\n const count = counter().toString(36);\n\n // The salt should be long enough to be globally unique across the full\n // length of the hash. For simplicity, we use the same length as the\n // intended id output.\n const salt = createEntropy(length, random);\n const hashInput = `${time + salt + count + fingerprint}`;\n\n return `${firstLetter + hash(hashInput).substring(1, length)}`;\n };\n};\n\nconst createId = init();\n\nconst isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => {\n const length = id.length;\n const regex = /^[0-9a-z]+$/;\n\n try {\n if (\n typeof id === \"string\" &&\n length >= minLength &&\n length <= maxLength &&\n regex.test(id)\n )\n return true;\n } finally {\n }\n\n return false;\n};\n\nmodule.exports.getConstants = () => ({ defaultLength, bigLength });\nmodule.exports.init = init;\nmodule.exports.createId = createId;\nmodule.exports.bufToBigInt = bufToBigInt;\nmodule.exports.createCounter = createCounter;\nmodule.exports.createFingerprint = createFingerprint;\nmodule.exports.isCuid = isCuid;\n","const { createId, init, getConstants, isCuid } = require(\"./src/index\");\n\nmodule.exports.createId = createId;\nmodule.exports.init = init;\nmodule.exports.getConstants = getConstants;\nmodule.exports.isCuid = isCuid;\n","import { USER_ID_KEY } from '@/constants'\r\nimport { createId } from '@paralleldrive/cuid2'\r\n\r\n/**\r\n * Generates a unique ID for the user.\r\n * If a user ID is already stored in the local storage, it returns that ID.\r\n * Otherwise, it generates a new ID, stores it in the local storage, and returns it.\r\n * @returns The generated or stored user ID.\r\n */\r\nexport const genId = () => {\r\n const generatedId = createId()\r\n\r\n const userIdFromLocalStorage = localStorage.getItem(USER_ID_KEY)\r\n\r\n if (!userIdFromLocalStorage) {\r\n localStorage.setItem(USER_ID_KEY, generatedId)\r\n\r\n return generatedId\r\n }\r\n\r\n return userIdFromLocalStorage\r\n}\r\n\r\n/**\r\n * Generates a unique address based on the provided channelId.\r\n * @param channelId - The ID of the channel.\r\n * @returns The generated address.\r\n */\r\nexport const getAddress = (channelId: string, incomeUserId?: string) => {\r\n const userId = incomeUserId ? incomeUserId : genId()\r\n\r\n return `${channelId}_${userId}`\r\n}\r\n\r\nexport const openInNewTab = (url: string) => {\r\n window.open(url, '_blank')?.focus()\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color code to HSL (Hue, Saturation, Lightness) format.\r\n * @param hex - The hexadecimal color code to convert.\r\n * @returns An object containing the HSL values.\r\n */\r\nexport const hexToHSL = (hex: string) => {\r\n hex = hex.replace(/^#/, '')\r\n\r\n // Convert hex to RGB\r\n const bigint = parseInt(hex, 16)\r\n let r = (bigint >> 16) & 255\r\n let g = (bigint >> 8) & 255\r\n let b = bigint & 255\r\n\r\n // Normalize RGB values\r\n r /= 255\r\n g /= 255\r\n b /= 255\r\n\r\n // Find the maximum and minimum values of R, G, B\r\n const max = Math.max(r, g, b)\r\n const min = Math.min(r, g, b)\r\n let h = 0,\r\n s\r\n const l = (max + min) / 2\r\n\r\n if (max === min) {\r\n h = s = 0 // achromatic\r\n } else {\r\n const d = max - min\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0)\r\n break\r\n case g:\r\n h = (b - r) / d + 2\r\n break\r\n case b:\r\n h = (r - g) / d + 4\r\n break\r\n }\r\n h /= 6\r\n }\r\n\r\n h *= 360\r\n\r\n return {\r\n h: Math.round(h),\r\n s: Math.round(s * 100),\r\n l: Math.round(l * 100),\r\n }\r\n}\r\n","// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n return void 0;\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if (!array && a[key] === void 0 && b[key] === void 0 && aItems.includes(key)) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nexport {\n addToEnd,\n addToStart,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class {\n constructor(options) {\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n let promiseResolve;\n let promiseReject;\n const promise = new Promise((outerResolve, outerReject) => {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const shouldPause = () => !focusManager.isFocused() || config.networkMode !== \"always\" && !onlineManager.isOnline();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n promiseResolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n promiseReject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n const canContinue = isResolved || !shouldPause();\n if (canContinue) {\n continueResolve(value);\n }\n return canContinue;\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n if (shouldPause()) {\n return pause();\n }\n return;\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n if (canFetch(config.networkMode)) {\n run();\n } else {\n pause().then(run);\n }\n return {\n promise,\n cancel,\n continue: () => {\n const didContinue = continueFn?.();\n return didContinue ? promise : Promise.resolve();\n },\n cancelRetry,\n continueRetry\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const setScheduler = (fn) => {\n scheduleFn = fn;\n };\n const batch = (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n };\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const batchCalls = (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n const setNotifyFunction = (fn) => {\n notifyFn = fn;\n };\n const setBatchNotifyFunction = (fn) => {\n batchNotifyFn = fn;\n };\n return {\n batch,\n batchCalls,\n schedule,\n setNotifyFunction,\n setBatchNotifyFunction,\n setScheduler\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport { noop, replaceData, skipToken, timeUntilStale } from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #retryer;\n #observers;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.#observers = [];\n this.#cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = config.state || getDefaultState(this.options);\n this.state = this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.#observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.#observers.some(\n (observer) => observer.options.enabled !== false\n );\n }\n isDisabled() {\n return this.getObserversCount() > 0 && !this.isActive();\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.#observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.#observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.#observers.includes(observer)) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n if (!this.#observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.#observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.#observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const queryFnContext = {\n queryKey: this.queryKey,\n meta: this.meta\n };\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n addSignalProperty(queryFnContext);\n const fetchFn = () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (this.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'`\n );\n }\n }\n if (!this.options.queryFn || this.options.queryFn === skipToken) {\n return Promise.reject(\n new Error(`Missing queryFn: '${this.options.queryHash}'`)\n );\n }\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n this.options.queryFn,\n queryFnContext,\n this\n );\n }\n return this.options.queryFn(\n queryFnContext\n );\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n };\n this.#retryer = createRetryer({\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode\n });\n return this.#retryer.promise;\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { canFetch, createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #defaultOptions;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#defaultOptions = config.defaultOptions;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const executeMutation = () => {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode\n });\n return this.#retryer.promise;\n };\n const restored = this.state.status === \"pending\";\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables\n });\n }\n }\n const data = await executeMutation();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: !canFetch(this.options.networkMode),\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = [];\n this.#mutationId = 0;\n }\n #mutations;\n #mutationId;\n #resuming;\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n this.#mutations.push(mutation);\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n this.#mutations = this.#mutations.filter((x) => x !== mutation);\n this.notify({ type: \"removed\", mutation });\n }\n clear() {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.remove(mutation);\n });\n });\n }\n getAll() {\n return this.#mutations;\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.#mutations.find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.#mutations.filter(\n (mutation) => matchMutation(filters, mutation)\n );\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n this.#resuming = (this.#resuming ?? Promise.resolve()).then(() => {\n const pausedMutations = this.#mutations.filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => pausedMutations.reduce(\n (promise, mutation) => promise.then(() => mutation.continue().catch(noop)),\n Promise.resolve()\n )\n );\n }).then(() => {\n this.#resuming = void 0;\n });\n return this.#resuming;\n }\n};\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/infiniteQueryBehavior.ts\nimport { addToEnd, addToStart, skipToken } from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const fetchFn = async () => {\n const options = context.options;\n const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n const oldPages = context.state.data?.pages || [];\n const oldPageParams = context.state.data?.pageParams || [];\n const empty = { pages: [], pageParams: [] };\n let cancelled = false;\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true;\n } else {\n context.signal.addEventListener(\"abort\", () => {\n cancelled = true;\n });\n }\n return context.signal;\n }\n });\n };\n const queryFn = context.options.queryFn && context.options.queryFn !== skipToken ? context.options.queryFn : () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (context.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${context.options.queryHash}'`\n );\n }\n }\n return Promise.reject(\n new Error(`Missing queryFn: '${context.options.queryHash}'`)\n );\n };\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject();\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const page = await queryFn(\n queryFnContext\n );\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\n let result;\n if (direction && oldPages.length) {\n const previous = direction === \"backward\";\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams\n };\n const param = pageParamFn(options, oldData);\n result = await fetchPage(oldData, param, previous);\n } else {\n result = await fetchPage(\n empty,\n oldPageParams[0] ?? options.initialPageParam\n );\n const remainingPages = pages ?? oldPages.length;\n for (let i = 1; i < remainingPages; i++) {\n const param = getNextPageParam(options, result);\n result = await fetchPage(result, param);\n }\n }\n return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal\n },\n query\n );\n };\n } else {\n context.fetchFn = fetchFn;\n }\n }\n };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n );\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return options.getPreviousPageParam?.(\n pages[0],\n pages,\n pageParams[0],\n pageParams\n );\n}\nfunction hasNextPage(options, data) {\n if (!data)\n return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam)\n return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1)\n return;\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations();\n this.#queryCache.onFocus();\n }\n });\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations();\n this.#queryCache.onOnline();\n }\n });\n }\n unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0)\n return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const cachedData = this.getQueryData(options.queryKey);\n if (cachedData === void 0)\n return this.fetchQuery(options);\n else {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n if (options.revalidateIfStale && query.isStaleByTime(defaultedOptions.staleTime)) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n const refetchFilters = {\n type: \"active\",\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n cancelQueries(filters = {}, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters = {}, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? \"active\"\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n refetchQueries(filters = {}, options) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","// src/queryObserver.ts\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { fetchState } from \"./query.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options, notifyOptions) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\") {\n throw new Error(\"Expected enabled to be a boolean\");\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult(notifyOptions);\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n const trackedResult = {};\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key);\n onPropTracked?.(key);\n return result[key];\n }\n });\n });\n return trackedResult;\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n query.isFetchingOptimistic = true;\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n if (isServer || this.#currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n const time = timeUntilStale(\n this.#currentResult.dataUpdatedAt,\n this.options.staleTime\n );\n const timeout = time + 1;\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || this.options.enabled === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n if (options.select && newState.data !== void 0) {\n if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(newState.data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n } else {\n data = newState.data;\n }\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n if (options.select && placeholderData !== void 0) {\n try {\n placeholderData = options.select(placeholderData);\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch\n };\n return result;\n }\n updateResult(notifyOptions) {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const defaultNotifyOptions = {};\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true;\n }\n this.#notify({ ...defaultNotifyOptions, ...notifyOptions });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (options.enabled !== false) {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return options.enabled !== false && query.isStaleByTime(options.staleTime);\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\n\n// src/isRestoring.ts\nimport * as React from \"react\";\nvar IsRestoringContext = React.createContext(false);\nvar useIsRestoring = () => React.useContext(IsRestoringContext);\nvar IsRestoringProvider = IsRestoringContext.Provider;\nexport {\n IsRestoringProvider,\n useIsRestoring\n};\n//# sourceMappingURL=isRestoring.js.map","\"use client\";\n\n// src/QueryErrorResetBoundary.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createValue() {\n let isReset = false;\n return {\n clearReset: () => {\n isReset = false;\n },\n reset: () => {\n isReset = true;\n },\n isReset: () => {\n return isReset;\n }\n };\n}\nvar QueryErrorResetBoundaryContext = React.createContext(createValue());\nvar useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\nvar QueryErrorResetBoundary = ({\n children\n}) => {\n const [value] = React.useState(() => createValue());\n return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === \"function\" ? children(value) : children });\n};\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary\n};\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","// src/utils.ts\nfunction shouldThrowError(throwError, params) {\n if (typeof throwError === \"function\") {\n return throwError(...params);\n }\n return !!throwError;\n}\nfunction noop() {\n}\nexport {\n noop,\n shouldThrowError\n};\n//# sourceMappingURL=utils.js.map","\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"./utils.js\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\nvar defaultThrowOnError = (_error, query) => query.state.data === void 0;\nvar ensureStaleTime = (defaultedOptions) => {\n if (defaultedOptions.suspense) {\n if (typeof defaultedOptions.staleTime !== \"number\") {\n defaultedOptions.staleTime = 1e3;\n }\n }\n};\nvar willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nvar shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nvar fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset();\n});\nexport {\n defaultThrowOnError,\n ensureStaleTime,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n};\n//# sourceMappingURL=suspense.js.map","\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { notifyManager } from \"@tanstack/query-core\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./isRestoring.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { ensureStaleTime, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const client = useQueryClient(queryClient);\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const defaultedOptions = client.defaultQueryOptions(options);\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureStaleTime(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n useClearResetErrorBoundary(errorResetBoundary);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange));\n observer.updateResult();\n return unsubscribe;\n },\n [observer, isRestoring]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions, { listeners: false });\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: client.getQueryCache().get(defaultedOptions.queryHash)\n })) {\n throw result.error;\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\n\n// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(options, QueryObserver, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n","import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n","// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n","import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n","import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n // @ts-expect-error\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n // @ts-expect-error\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* READ_PAYLOAD */;\n }\n else if (state === 2 /* READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n","/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","export const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\n","import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n","// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n","import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n","// imported from https://github.com/unshiftio/yeast\n'use strict';\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''), length = 64, map = {};\nlet seed = 0, i = 0, prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nexport function encode(num) {\n let encoded = '';\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nexport function decode(str) {\n let decoded = 0;\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nexport function yeast() {\n const now = encode(+new Date());\n if (now !== prev)\n return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n}\n//\n// Map each character to its index.\n//\nfor (; i < length; i++)\n map[alphabet[i]] = i;\n","// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n","// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\nexport function createCookieJar() { }\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n","import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { nextTick, usingBrowserWebSocket, WebSocket, } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @param {Object} opts - connection options\n * @protected\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n get name() {\n return \"websocket\";\n }\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @private\n */\n check() {\n return !!WebSocket;\n }\n}\n","import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n","import { Polling } from \"./polling.js\";\nimport { WS } from \"./websocket.js\";\nimport { WT } from \"./webtransport.js\";\nexport const transports = {\n websocket: WS,\n webtransport: WT,\n polling: Polling,\n};\n","// imported from https://github.com/galkn/parseuri\n/**\n * Parses a URI\n *\n * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.\n *\n * See:\n * - https://developer.mozilla.org/en-US/docs/Web/API/URL\n * - https://caniuse.com/url\n * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B\n *\n * History of the parse() method:\n * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c\n * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3\n * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242\n *\n * @author Steven Levithan (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n if (str.length > 2000) {\n throw \"URI too long\";\n }\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n","import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n","import { parse } from \"engine.io-client\";\n/**\n * URL parser.\n *\n * @param uri - url\n * @param path - the request path of the connection\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nexport function url(uri, path = \"\", loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n obj = parse(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port + path;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\n","const withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj.buffer instanceof ArrayBuffer;\n};\nconst toString = Object.prototype.toString;\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeFile = typeof File === \"function\" ||\n (typeof File !== \"undefined\" &&\n toString.call(File) === \"[object FileConstructor]\");\n/**\n * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.\n *\n * @private\n */\nexport function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}\nexport function hasBinary(obj, toJSON) {\n if (!obj || typeof obj !== \"object\") {\n return false;\n }\n if (Array.isArray(obj)) {\n for (let i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n return false;\n }\n if (isBinary(obj)) {\n return true;\n }\n if (obj.toJSON &&\n typeof obj.toJSON === \"function\" &&\n arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n return false;\n}\n","import { isBinary } from \"./is-binary.js\";\n/**\n * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @public\n */\nexport function deconstructPacket(packet) {\n const buffers = [];\n const packetData = packet.data;\n const pack = packet;\n pack.data = _deconstructPacket(packetData, buffers);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return { packet: pack, buffers: buffers };\n}\nfunction _deconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (isBinary(data)) {\n const placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n }\n else if (Array.isArray(data)) {\n const newData = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i], buffers);\n }\n return newData;\n }\n else if (typeof data === \"object\" && !(data instanceof Date)) {\n const newData = {};\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n newData[key] = _deconstructPacket(data[key], buffers);\n }\n }\n return newData;\n }\n return data;\n}\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @public\n */\nexport function reconstructPacket(packet, buffers) {\n packet.data = _reconstructPacket(packet.data, buffers);\n delete packet.attachments; // no longer useful\n return packet;\n}\nfunction _reconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (data && data._placeholder === true) {\n const isIndexValid = typeof data.num === \"number\" &&\n data.num >= 0 &&\n data.num < buffers.length;\n if (isIndexValid) {\n return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n }\n else {\n throw new Error(\"illegal attachments\");\n }\n }\n else if (Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i], buffers);\n }\n }\n else if (typeof data === \"object\") {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n data[key] = _reconstructPacket(data[key], buffers);\n }\n }\n }\n return data;\n}\n","import { Emitter } from \"@socket.io/component-emitter\";\nimport { deconstructPacket, reconstructPacket } from \"./binary.js\";\nimport { isBinary, hasBinary } from \"./is-binary.js\";\n/**\n * These strings must not be used as event names, as they have a special meaning.\n */\nconst RESERVED_EVENTS = [\n \"connect\",\n \"connect_error\",\n \"disconnect\",\n \"disconnecting\",\n \"newListener\",\n \"removeListener\", // used by the Node.js EventEmitter\n];\n/**\n * Protocol version.\n *\n * @public\n */\nexport const protocol = 5;\nexport var PacketType;\n(function (PacketType) {\n PacketType[PacketType[\"CONNECT\"] = 0] = \"CONNECT\";\n PacketType[PacketType[\"DISCONNECT\"] = 1] = \"DISCONNECT\";\n PacketType[PacketType[\"EVENT\"] = 2] = \"EVENT\";\n PacketType[PacketType[\"ACK\"] = 3] = \"ACK\";\n PacketType[PacketType[\"CONNECT_ERROR\"] = 4] = \"CONNECT_ERROR\";\n PacketType[PacketType[\"BINARY_EVENT\"] = 5] = \"BINARY_EVENT\";\n PacketType[PacketType[\"BINARY_ACK\"] = 6] = \"BINARY_ACK\";\n})(PacketType || (PacketType = {}));\n/**\n * A socket.io Encoder instance\n */\nexport class Encoder {\n /**\n * Encoder constructor\n *\n * @param {function} replacer - custom replacer to pass down to JSON.parse\n */\n constructor(replacer) {\n this.replacer = replacer;\n }\n /**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n */\n encode(obj) {\n if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {\n if (hasBinary(obj)) {\n return this.encodeAsBinary({\n type: obj.type === PacketType.EVENT\n ? PacketType.BINARY_EVENT\n : PacketType.BINARY_ACK,\n nsp: obj.nsp,\n data: obj.data,\n id: obj.id,\n });\n }\n }\n return [this.encodeAsString(obj)];\n }\n /**\n * Encode packet as string.\n */\n encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }\n /**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n */\n encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }\n}\n// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n */\nexport class Decoder extends Emitter {\n /**\n * Decoder constructor\n *\n * @param {function} reviver - custom reviver to pass down to JSON.stringify\n */\n constructor(reviver) {\n super();\n this.reviver = reviver;\n }\n /**\n * Decodes an encoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n */\n add(obj) {\n let packet;\n if (typeof obj === \"string\") {\n if (this.reconstructor) {\n throw new Error(\"got plaintext data when reconstructing a packet\");\n }\n packet = this.decodeString(obj);\n const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;\n if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {\n packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;\n // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n // no attachments, labeled binary but no binary data to follow\n if (packet.attachments === 0) {\n super.emitReserved(\"decoded\", packet);\n }\n }\n else {\n // non-binary full packet\n super.emitReserved(\"decoded\", packet);\n }\n }\n else if (isBinary(obj) || obj.base64) {\n // raw binary data\n if (!this.reconstructor) {\n throw new Error(\"got binary data when not reconstructing a packet\");\n }\n else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) {\n // received final buffer\n this.reconstructor = null;\n super.emitReserved(\"decoded\", packet);\n }\n }\n }\n else {\n throw new Error(\"Unknown type: \" + obj);\n }\n }\n /**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n */\n decodeString(str) {\n let i = 0;\n // look up type\n const p = {\n type: Number(str.charAt(0)),\n };\n if (PacketType[p.type] === undefined) {\n throw new Error(\"unknown packet type \" + p.type);\n }\n // look up attachments if type binary\n if (p.type === PacketType.BINARY_EVENT ||\n p.type === PacketType.BINARY_ACK) {\n const start = i + 1;\n while (str.charAt(++i) !== \"-\" && i != str.length) { }\n const buf = str.substring(start, i);\n if (buf != Number(buf) || str.charAt(i) !== \"-\") {\n throw new Error(\"Illegal attachments\");\n }\n p.attachments = Number(buf);\n }\n // look up namespace (if any)\n if (\"/\" === str.charAt(i + 1)) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (\",\" === c)\n break;\n if (i === str.length)\n break;\n }\n p.nsp = str.substring(start, i);\n }\n else {\n p.nsp = \"/\";\n }\n // look up id\n const next = str.charAt(i + 1);\n if (\"\" !== next && Number(next) == next) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n if (i === str.length)\n break;\n }\n p.id = Number(str.substring(start, i + 1));\n }\n // look up json data\n if (str.charAt(++i)) {\n const payload = this.tryParse(str.substr(i));\n if (Decoder.isPayloadValid(p.type, payload)) {\n p.data = payload;\n }\n else {\n throw new Error(\"invalid payload\");\n }\n }\n return p;\n }\n tryParse(str) {\n try {\n return JSON.parse(str, this.reviver);\n }\n catch (e) {\n return false;\n }\n }\n static isPayloadValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n return Array.isArray(payload);\n }\n }\n /**\n * Deallocates a parser's resources\n */\n destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n this.reconstructor = null;\n }\n }\n}\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n */\nclass BinaryReconstructor {\n constructor(packet) {\n this.packet = packet;\n this.buffers = [];\n this.reconPack = packet;\n }\n /**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n */\n takeBinaryData(binData) {\n this.buffers.push(binData);\n if (this.buffers.length === this.reconPack.attachments) {\n // done with buffer list\n const packet = reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n }\n /**\n * Cleans up binary packet reconstruction variables.\n */\n finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }\n}\n","export function on(obj, ev, fn) {\n obj.on(ev, fn);\n return function subDestroy() {\n obj.off(ev, fn);\n };\n}\n","import { PacketType } from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\n/**\n * A Socket is the fundamental class for interacting with the server.\n *\n * A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(\"connected\");\n * });\n *\n * // send an event to the server\n * socket.emit(\"foo\", \"bar\");\n *\n * socket.on(\"foobar\", () => {\n * // an event was received from the server\n * });\n *\n * // upon disconnection\n * socket.on(\"disconnect\", (reason) => {\n * console.log(`disconnected due to ${reason}`);\n * });\n */\nexport class Socket extends Emitter {\n /**\n * `Socket` constructor.\n */\n constructor(io, nsp, opts) {\n super();\n /**\n * Whether the socket is currently connected to the server.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.connected); // true\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.connected); // false\n * });\n */\n this.connected = false;\n /**\n * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will\n * be transmitted by the server.\n */\n this.recovered = false;\n /**\n * Buffer for packets received before the CONNECT packet\n */\n this.receiveBuffer = [];\n /**\n * Buffer for packets that will be sent once the socket is connected\n */\n this.sendBuffer = [];\n /**\n * The queue of packets to be sent with retry in case of failure.\n *\n * Packets are sent one by one, each waiting for the server acknowledgement, in order to guarantee the delivery order.\n * @private\n */\n this._queue = [];\n /**\n * A sequence to generate the ID of the {@link QueuedPacket}.\n * @private\n */\n this._queueSeq = 0;\n this.ids = 0;\n /**\n * A map containing acknowledgement handlers.\n *\n * The `withError` attribute is used to differentiate handlers that accept an error as first argument:\n *\n * - `socket.emit(\"test\", (err, value) => { ... })` with `ackTimeout` option\n * - `socket.timeout(5000).emit(\"test\", (err, value) => { ... })`\n * - `const value = await socket.emitWithAck(\"test\")`\n *\n * From those that don't:\n *\n * - `socket.emit(\"test\", (value) => { ... });`\n *\n * In the first case, the handlers will be called with an error when:\n *\n * - the timeout is reached\n * - the socket gets disconnected\n *\n * In the second case, the handlers will be simply discarded upon disconnection, since the client will never receive\n * an acknowledgement from the server.\n *\n * @private\n */\n this.acks = {};\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n this._opts = Object.assign({}, opts);\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Whether the socket is currently disconnected\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.disconnected); // false\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.disconnected); // true\n * });\n */\n get disconnected() {\n return !this.connected;\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects.\n *\n * @example\n * const socket = io();\n *\n * console.log(socket.active); // true\n *\n * socket.on(\"disconnect\", (reason) => {\n * if (reason === \"io server disconnect\") {\n * // the disconnection was initiated by the server, you need to manually reconnect\n * console.log(socket.active); // false\n * }\n * // else the socket will automatically try to reconnect\n * console.log(socket.active); // true\n * });\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @example\n * const socket = io({\n * autoConnect: false\n * });\n *\n * socket.connect();\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for {@link connect()}.\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * This method mimics the WebSocket.send() method.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n *\n * @example\n * socket.send(\"hello\");\n *\n * // this is equivalent to\n * socket.emit(\"message\", \"hello\");\n *\n * @return self\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @example\n * socket.emit(\"hello\", \"world\");\n *\n * // all serializable datastructures are supported (no need to call JSON.stringify)\n * socket.emit(\"hello\", 1, \"2\", { 3: [\"4\"], 5: Uint8Array.from([6]) });\n *\n * // with an acknowledgement from the server\n * socket.emit(\"hello\", \"world\", (val) => {\n * // ...\n * });\n *\n * @return self\n */\n emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev.toString() + '\" is a reserved event name');\n }\n args.unshift(ev);\n if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {\n this._addToQueue(args);\n return this;\n }\n const packet = {\n type: PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n }\n else if (this.connected) {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * @private\n */\n _registerAckCallback(id, ack) {\n var _a;\n const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;\n if (timeout === undefined) {\n this.acks[id] = ack;\n return;\n }\n // @ts-ignore\n const timer = this.io.setTimeoutFn(() => {\n delete this.acks[id];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n if (this.sendBuffer[i].id === id) {\n this.sendBuffer.splice(i, 1);\n }\n }\n ack.call(this, new Error(\"operation has timed out\"));\n }, timeout);\n const fn = (...args) => {\n // @ts-ignore\n this.io.clearTimeoutFn(timer);\n ack.apply(this, args);\n };\n fn.withError = true;\n this.acks[id] = fn;\n }\n /**\n * Emits an event and waits for an acknowledgement\n *\n * @example\n * // without timeout\n * const response = await socket.emitWithAck(\"hello\", \"world\");\n *\n * // with a specific timeout\n * try {\n * const response = await socket.timeout(1000).emitWithAck(\"hello\", \"world\");\n * } catch (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n *\n * @return a Promise that will be fulfilled when the server acknowledges the event\n */\n emitWithAck(ev, ...args) {\n return new Promise((resolve, reject) => {\n const fn = (arg1, arg2) => {\n return arg1 ? reject(arg1) : resolve(arg2);\n };\n fn.withError = true;\n args.push(fn);\n this.emit(ev, ...args);\n });\n }\n /**\n * Add the packet to the queue.\n * @param args\n * @private\n */\n _addToQueue(args) {\n let ack;\n if (typeof args[args.length - 1] === \"function\") {\n ack = args.pop();\n }\n const packet = {\n id: this._queueSeq++,\n tryCount: 0,\n pending: false,\n args,\n flags: Object.assign({ fromQueue: true }, this.flags),\n };\n args.push((err, ...responseArgs) => {\n if (packet !== this._queue[0]) {\n // the packet has already been acknowledged\n return;\n }\n const hasError = err !== null;\n if (hasError) {\n if (packet.tryCount > this._opts.retries) {\n this._queue.shift();\n if (ack) {\n ack(err);\n }\n }\n }\n else {\n this._queue.shift();\n if (ack) {\n ack(null, ...responseArgs);\n }\n }\n packet.pending = false;\n return this._drainQueue();\n });\n this._queue.push(packet);\n this._drainQueue();\n }\n /**\n * Send the first packet of the queue, and wait for an acknowledgement from the server.\n * @param force - whether to resend a packet that has not been acknowledged yet\n *\n * @private\n */\n _drainQueue(force = false) {\n if (!this.connected || this._queue.length === 0) {\n return;\n }\n const packet = this._queue[0];\n if (packet.pending && !force) {\n return;\n }\n packet.pending = true;\n packet.tryCount++;\n this.flags = packet.flags;\n this.emit.apply(this, packet.args);\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this._sendConnectPacket(data);\n });\n }\n else {\n this._sendConnectPacket(this.auth);\n }\n }\n /**\n * Sends a CONNECT packet to initiate the Socket.IO session.\n *\n * @param data\n * @private\n */\n _sendConnectPacket(data) {\n this.packet({\n type: PacketType.CONNECT,\n data: this._pid\n ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data)\n : data,\n });\n }\n /**\n * Called upon engine or manager `error`.\n *\n * @param err\n * @private\n */\n onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @param description\n * @private\n */\n onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n this._clearAcks();\n }\n /**\n * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from\n * the server.\n *\n * @private\n */\n _clearAcks() {\n Object.keys(this.acks).forEach((id) => {\n const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id);\n if (!isBuffered) {\n // note: handlers that do not accept an error as first argument are ignored here\n const ack = this.acks[id];\n delete this.acks[id];\n if (ack.withError) {\n ack.call(this, new Error(\"socket has been disconnected\"));\n }\n }\n });\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n this.onconnect(packet.data.sid, packet.data.pid);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n if (this._pid && args.length && typeof args[args.length - 1] === \"string\") {\n this._lastOffset = args[args.length - 1];\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowledgement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (typeof ack !== \"function\") {\n return;\n }\n delete this.acks[packet.id];\n // @ts-ignore FIXME ack is incorrectly inferred as 'never'\n if (ack.withError) {\n packet.data.unshift(null);\n }\n // @ts-ignore\n ack.apply(this, packet.data);\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id, pid) {\n this.id = id;\n this.recovered = pid && this._pid === pid;\n this._pid = pid; // defined only if connection state recovery is enabled\n this.connected = true;\n this.emitBuffered();\n this.emitReserved(\"connect\");\n this._drainQueue(true);\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually. In that case, the socket will not try to reconnect.\n *\n * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"disconnect\", (reason) => {\n * // console.log(reason); prints \"io client disconnect\"\n * });\n *\n * socket.disconnect();\n *\n * @return self\n */\n disconnect() {\n if (this.connected) {\n this.packet({ type: PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for {@link disconnect()}.\n *\n * @return self\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @example\n * socket.compress(false).emit(\"hello\");\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @example\n * socket.volatile.emit(\"hello\"); // the server may or may not receive it\n *\n * @returns self\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the callback will be called with an error when the\n * given number of milliseconds have elapsed without an acknowledgement from the server:\n *\n * @example\n * socket.timeout(5000).emit(\"my-event\", (err) => {\n * if (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n * });\n *\n * @returns self\n */\n timeout(timeout) {\n this.flags.timeout = timeout;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @example\n * socket.onAny((event, ...args) => {\n * console.log(`got ${event}`);\n * });\n *\n * @param listener\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @example\n * socket.prependAny((event, ...args) => {\n * console.log(`got event ${event}`);\n * });\n *\n * @param listener\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`got event ${event}`);\n * }\n *\n * socket.onAny(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAny(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAny();\n *\n * @param listener\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.onAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n onAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.prependAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n prependAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`sent event ${event}`);\n * }\n *\n * socket.onAnyOutgoing(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAnyOutgoing(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAnyOutgoing();\n *\n * @param [listener] - the catch-all listener (optional)\n */\n offAnyOutgoing(listener) {\n if (!this._anyOutgoingListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyOutgoingListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyOutgoingListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }\n /**\n * Notify the listeners for each packet sent\n *\n * @param packet\n *\n * @private\n */\n notifyOutgoingListeners(packet) {\n if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {\n const listeners = this._anyOutgoingListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, packet.data);\n }\n }\n }\n}\n","/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\nexport function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\nBackoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\nBackoff.prototype.reset = function () {\n this.attempts = 0;\n};\n/**\n * Set the minimum duration\n *\n * @api public\n */\nBackoff.prototype.setMin = function (min) {\n this.ms = min;\n};\n/**\n * Set the maximum duration\n *\n * @api public\n */\nBackoff.prototype.setMax = function (max) {\n this.max = max;\n};\n/**\n * Set the jitter\n *\n * @api public\n */\nBackoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n};\n","import { Socket as Engine, installTimerFunctions, nextTick, } from \"engine.io-client\";\nimport { Socket } from \"./socket.js\";\nimport * as parser from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Backoff } from \"./contrib/backo2.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\nexport class Manager extends Emitter {\n constructor(uri, opts) {\n var _a;\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n installTimerFunctions(this, opts);\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n if (~this._readyState.indexOf(\"open\"))\n return this;\n this.engine = new Engine(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSubDestroy = on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n const onError = (err) => {\n this.cleanup();\n this._readyState = \"closed\";\n this.emitReserved(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n this.maybeReconnectOnOpen();\n }\n };\n // emit `error`\n const errorSub = on(socket, \"error\", onError);\n if (false !== this._timeout) {\n const timeout = this._timeout;\n // set timer\n const timer = this.setTimeoutFn(() => {\n openSubDestroy();\n onError(new Error(\"timeout\"));\n socket.close();\n }, timeout);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n this.subs.push(openSubDestroy);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n this.emitReserved(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n try {\n this.decoder.add(data);\n }\n catch (e) {\n this.onclose(\"parse error\", e);\n }\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n this.emitReserved(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n else if (this._autoConnect && !socket.active) {\n socket.connect();\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called upon engine close.\n *\n * @private\n */\n onclose(reason, description) {\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n this.emitReserved(\"close\", reason, description);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n this.backoff.reset();\n this.emitReserved(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n this._reconnecting = true;\n const timer = this.setTimeoutFn(() => {\n if (self.skipReconnect)\n return;\n this.emitReserved(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n self._reconnecting = false;\n self.reconnect();\n this.emitReserved(\"reconnect_error\", err);\n }\n else {\n self.onreconnect();\n }\n });\n }, delay);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }\n}\n","import { url } from \"./url.js\";\nimport { Manager } from \"./manager.js\";\nimport { Socket } from \"./socket.js\";\n/**\n * Managers cache.\n */\nconst cache = {};\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url(uri, opts.path || \"/socket.io\");\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n io = new Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n cache[id] = new Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.queryKey;\n }\n return io.socket(parsed.path, opts);\n}\n// so that \"lookup\" can be used both as a function (e.g. `io(...)`) and as a\n// namespace (e.g. `io.connect(...)`), for backward compatibility\nObject.assign(lookup, {\n Manager,\n Socket,\n io: lookup,\n connect: lookup,\n});\n/**\n * Protocol version.\n *\n * @public\n */\nexport { protocol } from \"socket.io-parser\";\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nexport { Manager, Socket, lookup as io, lookup as connect, lookup as default, };\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n","import { API_URL, EVENTS_SOCKET } from '@/constants'\r\nimport { TMessage, TTemplateType } from '@/types/chatbox'\r\nimport { genId, getAddress } from '@/utils'\r\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\r\nimport {\r\n createContext,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react'\r\nimport { Socket, io } from 'socket.io-client'\r\nimport { useUnmount } from 'usehooks-ts'\r\n\r\nexport type TSocketCtx = {\r\n socket: Socket\r\n messages: TMessage[]\r\n channelId: string\r\n onEndBot?: () => void\r\n isTest?: boolean\r\n handleSendMessage: (options: {\r\n message: string\r\n cb?: (data: TMessage) => void\r\n type?: TTemplateType\r\n extraData?: string\r\n }) => void\r\n handleClose: () => void\r\n disableInput?: boolean\r\n isShowClose?: boolean\r\n isLoadingMessages?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n handleReload: () => void\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n handleTyping?: () => void\r\n adminId?: string\r\n isForManager?: boolean\r\n}\r\n\r\nexport const SocketCtx = createContext({} as TSocketCtx)\r\n\r\nexport type Props = {\r\n children: React.ReactNode\r\n channelId?: string\r\n onEndBot?: () => void\r\n className?: string\r\n isTest?: boolean\r\n onClose?: () => void\r\n isShowClose?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n isForPreview?: boolean\r\n isForManager?: boolean\r\n adminId?: string\r\n API_URL?: string\r\n}\r\n\r\nexport const SocketProvider = ({\r\n children,\r\n channelId,\r\n onEndBot,\r\n isTest = false,\r\n onClose,\r\n isShowClose = true,\r\n isForLiveChat,\r\n userId,\r\n customStyles: _customStyles,\r\n isForPreview,\r\n isForManager,\r\n adminId,\r\n ...props\r\n}: Props) => {\r\n const [disableInput, setDisableInput] = useState(false)\r\n const [customStyles, setCustomStyles] = useState(\r\n isForManager ? undefined : _customStyles,\r\n )\r\n\r\n const queryClient = useQueryClient()\r\n\r\n const urlParams = useMemo(\r\n () => new URLSearchParams(window.location.search),\r\n [],\r\n )\r\n\r\n const _userId = useMemo(() => (userId ? userId : genId()), [userId])\r\n const _channelId = useMemo(\r\n () => channelId || urlParams.get('channelId') || '',\r\n [channelId, urlParams],\r\n )\r\n\r\n const socketRef = useRef(\r\n io(props.API_URL || API_URL, {\r\n autoConnect: false,\r\n transports: ['websocket'],\r\n query: {\r\n userId: adminId ? `${_userId}_${adminId}` : _userId,\r\n },\r\n }),\r\n )\r\n\r\n const { data: messages, isLoading } = useQuery({\r\n queryKey: ['messages', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n if (isForPreview) {\r\n return [\r\n {\r\n isBot: true,\r\n message: 'Hello, how can I help you?',\r\n createdAt: new Date().toISOString(),\r\n },\r\n {\r\n isBot: false,\r\n message: 'I want to know more about your product',\r\n userId: genId(),\r\n createdAt: new Date().toISOString(),\r\n },\r\n ]\r\n }\r\n\r\n const res = await fetch(\r\n `${URL}/api/conversation-live-chat/${\r\n userId || genId()\r\n }/${_channelId}`,\r\n )\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Array\r\n } catch (error) {\r\n return []\r\n }\r\n },\r\n initialData: [],\r\n })\r\n\r\n const { data: custom } = useQuery({\r\n queryKey: ['custom-style', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n const res = await fetch(\r\n `${props.API_URL || API_URL}/api/custom-chatbox/${_channelId}`,\r\n )\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Record\r\n } catch (error) {\r\n return undefined\r\n }\r\n },\r\n enabled: !isTest && !isForPreview && !isForManager,\r\n })\r\n\r\n const handleSendMessage: TSocketCtx['handleSendMessage'] = useCallback(\r\n ({ message, cb, extraData, type }) => {\r\n const trimmedMessage = message.trim()\r\n if (trimmedMessage.length === 0) return\r\n\r\n const address = getAddress(_channelId, userId)\r\n\r\n const newMessage: TMessage = {\r\n message: type === 'list-button' ? extraData || '' : trimmedMessage,\r\n userId: adminId ? adminId : userId || genId(),\r\n template: {} as any,\r\n createdAt: new Date().toISOString(),\r\n isTest,\r\n }\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n message: trimmedMessage,\r\n address,\r\n isTest,\r\n createdAt: newMessage.createdAt,\r\n })\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, newMessage]\r\n },\r\n )\r\n\r\n cb && cb(newMessage)\r\n },\r\n [_channelId, adminId, isTest, queryClient, userId],\r\n )\r\n\r\n const handleClose = useCallback(() => {\r\n if (window.parent) {\r\n window.parent.postMessage(\r\n {\r\n type: 'TOGGLE_CHAT',\r\n },\r\n '*',\r\n )\r\n }\r\n onClose?.()\r\n }, [onClose])\r\n\r\n const handleReload = useCallback(() => {\r\n if (isForPreview) return\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n type: 'event',\r\n typeName: 'endConversation',\r\n address: getAddress(_channelId, userId),\r\n isTest,\r\n message: '',\r\n })\r\n setDisableInput(false)\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n () => {\r\n return []\r\n },\r\n )\r\n }, [_channelId, isForPreview, isTest, queryClient, userId])\r\n\r\n useUnmount(() => {\r\n socketRef.current.disconnect()\r\n })\r\n\r\n useEffect(() => {\r\n // if customStyles is set, don't connect to socket because it for preview\r\n if (isForPreview) return\r\n\r\n const socket = socketRef.current\r\n\r\n socket.connect()\r\n\r\n socket.on(EVENTS_SOCKET.MESSAGE, (data) => {\r\n if (data.template?.type === 'list-button') {\r\n setDisableInput(true)\r\n } else {\r\n setDisableInput(false)\r\n }\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, data].filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, { userId: 'typing' }]\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.STOP_TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return prev.filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n return () => {\r\n socket.disconnect()\r\n }\r\n }, [_channelId, queryClient, userId, isForPreview])\r\n\r\n useEffect(() => {\r\n if (isForPreview) {\r\n setDisableInput(true)\r\n }\r\n }, [isForPreview])\r\n\r\n useEffect(() => {\r\n if (custom && !isForManager) {\r\n setCustomStyles(custom as any)\r\n }\r\n }, [custom, isForManager])\r\n\r\n useEffect(() => {\r\n if (_customStyles && !isForManager) {\r\n setCustomStyles(_customStyles)\r\n }\r\n }, [_customStyles, isForManager])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n","import { SocketCtx } from '@/context/socket.ctx'\r\nimport { useContext } from 'react'\r\n\r\n/**\r\n * Custom hook that provides access to the socket context.\r\n * @returns The socket context.\r\n * @throws {Error} If used outside of the SocketProvider.\r\n */\r\nexport const useSocket = () => {\r\n const socketCtx = useContext(SocketCtx)\r\n\r\n if (!socketCtx) {\r\n throw new Error('useSocket must be used within SocketProvider')\r\n }\r\n\r\n return socketCtx\r\n}\r\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t validator(classRest))?.classGroupId;\n}\nconst arbitraryPropertyRegex = /^\\[(.+)\\]$/;\nfunction getGroupIdForArbitraryProperty(className) {\n if (arbitraryPropertyRegex.test(className)) {\n const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];\n const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));\n if (property) {\n // I use two dots here because one dot is used as prefix for class groups in plugins\n return 'arbitrary..' + property;\n }\n }\n}\n/**\n * Exported for testing only\n */\nfunction createClassMap(config) {\n const {\n theme,\n prefix\n } = config;\n const classMap = {\n nextPart: new Map(),\n validators: []\n };\n const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);\n prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {\n processClassesRecursively(classGroup, classMap, classGroupId, theme);\n });\n return classMap;\n}\nfunction processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {\n classGroup.forEach(classDefinition => {\n if (typeof classDefinition === 'string') {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n return;\n }\n if (typeof classDefinition === 'function') {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n classPartObject.validators.push({\n validator: classDefinition,\n classGroupId\n });\n return;\n }\n Object.entries(classDefinition).forEach(([key, classGroup]) => {\n processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);\n });\n });\n}\nfunction getPart(classPartObject, path) {\n let currentClassPartObject = classPartObject;\n path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {\n if (!currentClassPartObject.nextPart.has(pathPart)) {\n currentClassPartObject.nextPart.set(pathPart, {\n nextPart: new Map(),\n validators: []\n });\n }\n currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);\n });\n return currentClassPartObject;\n}\nfunction isThemeGetter(func) {\n return func.isThemeGetter;\n}\nfunction getPrefixedClassGroupEntries(classGroupEntries, prefix) {\n if (!prefix) {\n return classGroupEntries;\n }\n return classGroupEntries.map(([classGroupId, classGroup]) => {\n const prefixedClassGroup = classGroup.map(classDefinition => {\n if (typeof classDefinition === 'string') {\n return prefix + classDefinition;\n }\n if (typeof classDefinition === 'object') {\n return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));\n }\n return classDefinition;\n });\n return [classGroupId, prefixedClassGroup];\n });\n}\n\n// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance\nfunction createLruCache(maxCacheSize) {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = new Map();\n let previousCache = new Map();\n function update(key, value) {\n cache.set(key, value);\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = new Map();\n }\n }\n return {\n get(key) {\n let value = cache.get(key);\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache.get(key)) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (cache.has(key)) {\n cache.set(key, value);\n } else {\n update(key, value);\n }\n }\n };\n}\nconst IMPORTANT_MODIFIER = '!';\nfunction createSplitModifiers(config) {\n const separator = config.separator;\n const isSeparatorSingleCharacter = separator.length === 1;\n const firstSeparatorCharacter = separator[0];\n const separatorLength = separator.length;\n // splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n return function splitModifiers(className) {\n const modifiers = [];\n let bracketDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n for (let index = 0; index < className.length; index++) {\n let currentCharacter = className[index];\n if (bracketDepth === 0) {\n if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + separatorLength;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') {\n bracketDepth++;\n } else if (currentCharacter === ']') {\n bracketDepth--;\n }\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);\n const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);\n const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n };\n };\n}\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nfunction sortModifiers(modifiers) {\n if (modifiers.length <= 1) {\n return modifiers;\n }\n const sortedModifiers = [];\n let unsortedModifiers = [];\n modifiers.forEach(modifier => {\n const isArbitraryVariant = modifier[0] === '[';\n if (isArbitraryVariant) {\n sortedModifiers.push(...unsortedModifiers.sort(), modifier);\n unsortedModifiers = [];\n } else {\n unsortedModifiers.push(modifier);\n }\n });\n sortedModifiers.push(...unsortedModifiers.sort());\n return sortedModifiers;\n}\nfunction createConfigUtils(config) {\n return {\n cache: createLruCache(config.cacheSize),\n splitModifiers: createSplitModifiers(config),\n ...createClassUtils(config)\n };\n}\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nfunction mergeClassList(classList, configUtils) {\n const {\n splitModifiers,\n getClassGroupId,\n getConflictingClassGroupIds\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = new Set();\n return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName => {\n const {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = splitModifiers(originalClassName);\n let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n let hasPostfixModifier = Boolean(maybePostfixModifierPosition);\n if (!classGroupId) {\n if (!maybePostfixModifierPosition) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n hasPostfixModifier = false;\n }\n const variantModifier = sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n return {\n isTailwindClass: true,\n modifierId,\n classGroupId,\n originalClassName,\n hasPostfixModifier\n };\n }).reverse()\n // Last class in conflict wins, so we need to filter conflicting classes in reverse order.\n .filter(parsed => {\n if (!parsed.isTailwindClass) {\n return true;\n }\n const {\n modifierId,\n classGroupId,\n hasPostfixModifier\n } = parsed;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.has(classId)) {\n return false;\n }\n classGroupsInConflict.add(classId);\n getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(group => classGroupsInConflict.add(modifierId + group));\n return true;\n }).reverse().map(parsed => parsed.originalClassName).join(' ');\n}\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards (lukeed.com)\n */\nfunction twJoin() {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < arguments.length) {\n if (argument = arguments[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction toValue(mix) {\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction createTailwindMerge(createConfigFirst, ...createConfigRest) {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall = initTailwindMerge;\n function initTailwindMerge(classList) {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n }\n function tailwindMerge(classList) {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n }\n return function callTailwindMerge() {\n return functionToCall(twJoin.apply(null, arguments));\n };\n}\nfunction fromTheme(key) {\n const themeGetter = theme => theme[key] || [];\n themeGetter.isThemeGetter = true;\n return themeGetter;\n}\nconst arbitraryValueRegex = /^\\[(?:([a-z-]+):)?(.+)\\]$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nfunction isLength(value) {\n return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);\n}\nfunction isArbitraryLength(value) {\n return getIsArbitraryValue(value, 'length', isLengthOnly);\n}\nfunction isNumber(value) {\n return Boolean(value) && !Number.isNaN(Number(value));\n}\nfunction isArbitraryNumber(value) {\n return getIsArbitraryValue(value, 'number', isNumber);\n}\nfunction isInteger(value) {\n return Boolean(value) && Number.isInteger(Number(value));\n}\nfunction isPercent(value) {\n return value.endsWith('%') && isNumber(value.slice(0, -1));\n}\nfunction isArbitraryValue(value) {\n return arbitraryValueRegex.test(value);\n}\nfunction isTshirtSize(value) {\n return tshirtUnitRegex.test(value);\n}\nconst sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);\nfunction isArbitrarySize(value) {\n return getIsArbitraryValue(value, sizeLabels, isNever);\n}\nfunction isArbitraryPosition(value) {\n return getIsArbitraryValue(value, 'position', isNever);\n}\nconst imageLabels = /*#__PURE__*/new Set(['image', 'url']);\nfunction isArbitraryImage(value) {\n return getIsArbitraryValue(value, imageLabels, isImage);\n}\nfunction isArbitraryShadow(value) {\n return getIsArbitraryValue(value, '', isShadow);\n}\nfunction isAny() {\n return true;\n}\nfunction getIsArbitraryValue(value, label, testValue) {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return typeof label === 'string' ? result[1] === label : label.has(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n}\nfunction isLengthOnly(value) {\n // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n // For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\n return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\n}\nfunction isNever() {\n return false;\n}\nfunction isShadow(value) {\n return shadowRegex.test(value);\n}\nfunction isImage(value) {\n return imageRegex.test(value);\n}\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isInteger,\n isLength,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nfunction getDefaultConfig() {\n const colors = fromTheme('colors');\n const spacing = fromTheme('spacing');\n const blur = fromTheme('blur');\n const brightness = fromTheme('brightness');\n const borderColor = fromTheme('borderColor');\n const borderRadius = fromTheme('borderRadius');\n const borderSpacing = fromTheme('borderSpacing');\n const borderWidth = fromTheme('borderWidth');\n const contrast = fromTheme('contrast');\n const grayscale = fromTheme('grayscale');\n const hueRotate = fromTheme('hueRotate');\n const invert = fromTheme('invert');\n const gap = fromTheme('gap');\n const gradientColorStops = fromTheme('gradientColorStops');\n const gradientColorStopPositions = fromTheme('gradientColorStopPositions');\n const inset = fromTheme('inset');\n const margin = fromTheme('margin');\n const opacity = fromTheme('opacity');\n const padding = fromTheme('padding');\n const saturate = fromTheme('saturate');\n const scale = fromTheme('scale');\n const sepia = fromTheme('sepia');\n const skew = fromTheme('skew');\n const space = fromTheme('space');\n const translate = fromTheme('translate');\n const getOverscroll = () => ['auto', 'contain', 'none'];\n const getOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const getSpacingWithAutoAndArbitrary = () => ['auto', isArbitraryValue, spacing];\n const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];\n const getLengthWithEmptyAndArbitrary = () => ['', isLength, isArbitraryLength];\n const getNumberWithAutoAndArbitrary = () => ['auto', isNumber, isArbitraryValue];\n const getPositions = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];\n const getLineStyles = () => ['solid', 'dashed', 'dotted', 'double', 'none'];\n const getBlendModes = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];\n const getAlign = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];\n const getZeroAndEmpty = () => ['', '0', isArbitraryValue];\n const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const getNumber = () => [isNumber, isArbitraryNumber];\n const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];\n return {\n cacheSize: 500,\n separator: ':',\n theme: {\n colors: [isAny],\n spacing: [isLength, isArbitraryLength],\n blur: ['none', '', isTshirtSize, isArbitraryValue],\n brightness: getNumber(),\n borderColor: [colors],\n borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],\n borderSpacing: getSpacingWithArbitrary(),\n borderWidth: getLengthWithEmptyAndArbitrary(),\n contrast: getNumber(),\n grayscale: getZeroAndEmpty(),\n hueRotate: getNumberAndArbitrary(),\n invert: getZeroAndEmpty(),\n gap: getSpacingWithArbitrary(),\n gradientColorStops: [colors],\n gradientColorStopPositions: [isPercent, isArbitraryLength],\n inset: getSpacingWithAutoAndArbitrary(),\n margin: getSpacingWithAutoAndArbitrary(),\n opacity: getNumber(),\n padding: getSpacingWithArbitrary(),\n saturate: getNumber(),\n scale: getNumber(),\n sepia: getZeroAndEmpty(),\n skew: getNumberAndArbitrary(),\n space: getSpacingWithArbitrary(),\n translate: getSpacingWithArbitrary()\n },\n classGroups: {\n // Layout\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', 'video', isArbitraryValue]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isTshirtSize]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': getBreaks()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': getBreaks()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: [...getPositions(), isArbitraryValue]\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: getOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': getOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': getOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: getOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': getOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': getOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: [inset]\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': [inset]\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': [inset]\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: [inset]\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: [inset]\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: [inset]\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: [inset]\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: [inset]\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: [inset]\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: ['auto', isInteger, isArbitraryValue]\n }],\n // Flexbox and Grid\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: getSpacingWithAutoAndArbitrary()\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['wrap', 'wrap-reverse', 'nowrap']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: ['1', 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: getZeroAndEmpty()\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: getZeroAndEmpty()\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: ['first', 'last', 'none', isInteger, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': [isAny]\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: ['auto', {\n span: ['full', isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': [isAny]\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: ['auto', {\n span: [isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: [gap]\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': [gap]\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': [gap]\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: ['normal', ...getAlign()]\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': ['start', 'end', 'center', 'stretch']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...getAlign(), 'baseline']\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', 'start', 'end', 'center', 'stretch', 'baseline']\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': [...getAlign(), 'baseline']\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: [padding]\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: [padding]\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: [padding]\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: [padding]\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: [padding]\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: [padding]\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: [padding]\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: [padding]\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: [padding]\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: [margin]\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: [margin]\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: [margin]\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: [margin]\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: [margin]\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: [margin]\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: [margin]\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: [margin]\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: [margin]\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x': [{\n 'space-x': [space]\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y': [{\n 'space-y': [space]\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y-reverse': ['space-y-reverse'],\n // Sizing\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: ['auto', 'min', 'max', 'fit', 'svw', 'lvw', 'dvw', isArbitraryValue, spacing]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit']\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [isArbitraryValue, spacing, 'none', 'full', 'min', 'max', 'fit', 'prose', {\n screen: [isTshirtSize]\n }, isTshirtSize]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Size\n * @see https://tailwindcss.com/docs/size\n */\n size: [{\n size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']\n }],\n // Typography\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', isTshirtSize, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black', isArbitraryNumber]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isAny]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractons'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest', isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': ['none', isNumber, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryValue]\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['none', 'disc', 'decimal', isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: [colors]\n }],\n /**\n * Placeholder Opacity\n * @see https://tailwindcss.com/docs/placeholder-opacity\n */\n 'placeholder-opacity': [{\n 'placeholder-opacity': [opacity]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: [colors]\n }],\n /**\n * Text Opacity\n * @see https://tailwindcss.com/docs/text-opacity\n */\n 'text-opacity': [{\n 'text-opacity': [opacity]\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...getLineStyles(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: ['auto', 'from-font', isLength, isArbitraryLength]\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': ['auto', isLength, isArbitraryValue]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: [colors]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: getSpacingWithArbitrary()\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryValue]\n }],\n // Backgrounds\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Opacity\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/background-opacity\n */\n 'bg-opacity': [{\n 'bg-opacity': [opacity]\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: [...getPositions(), isArbitraryPosition]\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: ['no-repeat', {\n repeat: ['', 'x', 'y', 'round', 'space']\n }]\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: ['auto', 'cover', 'contain', isArbitrarySize]\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n 'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: [colors]\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: [gradientColorStops]\n }],\n // Borders\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: [borderRadius]\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': [borderRadius]\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': [borderRadius]\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': [borderRadius]\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': [borderRadius]\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': [borderRadius]\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': [borderRadius]\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': [borderRadius]\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': [borderRadius]\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': [borderRadius]\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': [borderRadius]\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': [borderRadius]\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': [borderRadius]\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': [borderRadius]\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': [borderRadius]\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: [borderWidth]\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': [borderWidth]\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': [borderWidth]\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': [borderWidth]\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': [borderWidth]\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': [borderWidth]\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': [borderWidth]\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': [borderWidth]\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': [borderWidth]\n }],\n /**\n * Border Opacity\n * @see https://tailwindcss.com/docs/border-opacity\n */\n 'border-opacity': [{\n 'border-opacity': [opacity]\n }],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...getLineStyles(), 'hidden']\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x': [{\n 'divide-x': [borderWidth]\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y': [{\n 'divide-y': [borderWidth]\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Divide Opacity\n * @see https://tailwindcss.com/docs/divide-opacity\n */\n 'divide-opacity': [{\n 'divide-opacity': [opacity]\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/divide-style\n */\n 'divide-style': [{\n divide: getLineStyles()\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: [borderColor]\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': [borderColor]\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': [borderColor]\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': [borderColor]\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': [borderColor]\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': [borderColor]\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': [borderColor]\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: [borderColor]\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: ['', ...getLineStyles()]\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isLength, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: [isLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: [colors]\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w': [{\n ring: getLengthWithEmptyAndArbitrary()\n }],\n /**\n * Ring Width Inset\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/ring-color\n */\n 'ring-color': [{\n ring: [colors]\n }],\n /**\n * Ring Opacity\n * @see https://tailwindcss.com/docs/ring-opacity\n */\n 'ring-opacity': [{\n 'ring-opacity': [opacity]\n }],\n /**\n * Ring Offset Width\n * @see https://tailwindcss.com/docs/ring-offset-width\n */\n 'ring-offset-w': [{\n 'ring-offset': [isLength, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://tailwindcss.com/docs/ring-offset-color\n */\n 'ring-offset-color': [{\n 'ring-offset': [colors]\n }],\n // Effects\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: ['', 'inner', 'none', isTshirtSize, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow-color\n */\n 'shadow-color': [{\n shadow: [isAny]\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [opacity]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': getBlendModes()\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': getBlendModes()\n }],\n // Filters\n /**\n * Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: ['', 'none']\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: [blur]\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [brightness]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [contrast]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': ['', 'none', isTshirtSize, isArbitraryValue]\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: [grayscale]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [hueRotate]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: [invert]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [saturate]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: [sepia]\n }],\n /**\n * Backdrop Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': ['', 'none']\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': [blur]\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [brightness]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [contrast]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': [grayscale]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [hueRotate]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': [invert]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [opacity]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [saturate]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': [sepia]\n }],\n // Tables\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': [borderSpacing]\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': [borderSpacing]\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': [borderSpacing]\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // Transitions and Animation\n /**\n * Tranisition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['none', 'all', '', 'colors', 'opacity', 'shadow', 'transform', isArbitraryValue]\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: getNumberAndArbitrary()\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'in', 'out', 'in-out', isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: getNumberAndArbitrary()\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', 'spin', 'ping', 'pulse', 'bounce', isArbitraryValue]\n }],\n // Transforms\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: ['', 'gpu', 'none']\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: [scale]\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': [scale]\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': [scale]\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: [isInteger, isArbitraryValue]\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': [translate]\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': [translate]\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': [skew]\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': [skew]\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryValue]\n }],\n // Interactivity\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: ['auto', colors]\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryValue]\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: [colors]\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['none', 'auto']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', 'y', 'x', '']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryValue]\n }],\n // SVG\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: [colors, 'none']\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: [colors, 'none']\n }],\n // Accessibility\n /**\n * Screen Readers\n * @see https://tailwindcss.com/docs/screen-readers\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n }\n };\n}\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nfunction mergeConfigs(baseConfig, {\n cacheSize,\n prefix,\n separator,\n extend = {},\n override = {}\n}) {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'separator', separator);\n for (const configKey in override) {\n overrideConfigProperties(baseConfig[configKey], override[configKey]);\n }\n for (const key in extend) {\n mergeConfigProperties(baseConfig[key], extend[key]);\n }\n return baseConfig;\n}\nfunction overrideProperty(baseObject, overrideKey, overrideValue) {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n}\nfunction overrideConfigProperties(baseObject, overrideObject) {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n}\nfunction mergeConfigProperties(baseObject, mergeObject) {\n if (mergeObject) {\n for (const key in mergeObject) {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = (baseObject[key] || []).concat(mergeValue);\n }\n }\n }\n}\nfunction extendTailwindMerge(configExtension, ...createConfig) {\n return typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\n}\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { toKebabCase } from './shared/src/utils.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n ...rest\n }, ref) => {\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: [\"lucide\", `lucide-${toKebabCase(iconName)}`, className].join(\" \"),\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n );\n Component.displayName = `${iconName}`;\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst LoaderCircle = createLucideIcon(\"LoaderCircle\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]\n]);\n\nexport { LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCcw = createLucideIcon(\"RefreshCcw\", [\n [\"path\", { d: \"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"14sxne\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }],\n [\"path\", { d: \"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16\", key: \"1hlbsb\" }],\n [\"path\", { d: \"M16 16h5v5\", key: \"ccwih5\" }]\n]);\n\nexport { RefreshCcw as default };\n//# sourceMappingURL=refresh-ccw.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Send = createLucideIcon(\"Send\", [\n [\"path\", { d: \"m22 2-7 20-4-9-9-4Z\", key: \"1q3vgg\" }],\n [\"path\", { d: \"M22 2 11 13\", key: \"nzbqef\" }]\n]);\n\nexport { Send as default };\n//# sourceMappingURL=send.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst X = createLucideIcon(\"X\", [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n]);\n\nexport { X as default };\n//# sourceMappingURL=x.js.map\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { TMessage } from '@/types/chatbox'\r\n\r\ntype Props = {\r\n message: TMessage\r\n children?: React.ReactNode\r\n}\r\n\r\n/**\r\n * Represents a message component.\r\n * @param {Object} props - The component props.\r\n * @param {boolean} props.isBot - Indicates whether the message is from a bot.\r\n * @param {string} props.message - The content of the message.\r\n *\r\n */\r\nconst Message = ({ message, children }: Props) => {\r\n const { customStyles, adminId: _adminId, isForManager } = useSocket()\r\n\r\n const isLeft = message.isBot\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {isForManager ? (message.isBot ? 'From bot' : 'From user') : null}\r\n \r\n \r\n {message.message}\r\n {children}\r\n
\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Message\r\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;ttypeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../lib/utils'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow hover:bg-primary/90',\n destructive:\n 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n message:\n 'bg-background shadow-sm border text-primary border-primary hover:bg-primary/10 !rounded-full',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes,\n VariantProps {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return (\n \n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TButtonsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TButtonsMessage\r\n}\r\n\r\nconst ButtonsMessage = ({ message }: Props) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n return (\r\n
\r\n \r\n
\r\n {message.template.data.map((button) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default ButtonsMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TCard, TCardsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TCardsMessage\r\n}\r\n\r\nconst Card = ({ card }: { card: TCard }) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n \r\n

{card.title}

\r\n

{card.subtitle}

\r\n {card.buttons && card.buttons.length > 0 && (\r\n
\r\n {card.buttons.map((button, index) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl\r\n ? `${hsl.h} ${hsl.s}% ${hsl.l}%`\r\n : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport const CardsMessage = ({ message }: Props) => {\r\n return (\r\n
\r\n {message.template.data.map((card, index) => {\r\n return (\r\n }\r\n />\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import Message from './message'\r\n\r\nexport const TypingMessage = () => {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n }\r\n />\r\n )\r\n}\r\n\r\nexport default TypingMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TMessage } from '@/types/chatbox'\r\nimport dayjs from 'dayjs'\r\nimport { Loader2 } from 'lucide-react'\r\nimport { Fragment, useEffect, useRef } from 'react'\r\nimport ButtonsMessage from './buttons-message'\r\nimport { CardsMessage } from './cards-message'\r\nimport Message from './message'\r\nimport TypingMessage from './typing-message'\r\n\r\n/**\r\n * Represents the body component of the chatbox.\r\n * This component displays the main content of the chatbox.\r\n */\r\n\r\nconst Body = () => {\r\n const endMessageRef = useRef(null)\r\n const { messages, isLoadingMessages } = useSocket()\r\n\r\n /**\r\n * Scrolls to the end of the messages when a new message is received.\r\n */\r\n useEffect(() => {\r\n if (!endMessageRef.current) return\r\n\r\n endMessageRef.current.scrollIntoView({ behavior: 'smooth' })\r\n }, [messages])\r\n\r\n const renderMessage = (msg: TMessage, index: number) => {\r\n if (msg?.userId === 'typing') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-button') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-card') {\r\n return \r\n }\r\n\r\n return \r\n }\r\n\r\n return (\r\n
\r\n {isLoadingMessages ? (\r\n
\r\n \r\n
\r\n ) : (\r\n
\r\n {messages.length > 0 && (\r\n
\r\n {dayjs(messages[0].createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {messages.map((msg, index) => {\r\n return (\r\n \r\n {index > 0 &&\r\n dayjs(msg.createdAt).diff(\r\n dayjs(messages[index - 1].createdAt),\r\n 'minutes',\r\n ) > 10 && (\r\n
\r\n {dayjs(msg.createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {renderMessage(msg, index)}\r\n
\r\n )\r\n })}\r\n\r\n
\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport default Body\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { RefreshCcw, X } from 'lucide-react'\r\n\r\n/**\r\n * Represents the header component of the chatbox.\r\n *\r\n */\r\nconst Header = () => {\r\n const { handleClose, isShowClose, handleReload, customStyles, isForManager } =\r\n useSocket()\r\n return (\r\n \r\n
\r\n
\r\n {customStyles?.logoUrl ? (\r\n \r\n ) : (\r\n \r\n \r\n B\r\n \r\n \r\n )}\r\n \r\n {customStyles?.name || 'DialogueBot'}\r\n \r\n
\r\n
\r\n {!isForManager && (\r\n \r\n \r\n
\r\n )}\r\n {isShowClose && (\r\n \r\n \r\n
\r\n )}\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default Header\r\n","import * as React from 'react'\n\nimport { cn } from '../../lib/utils'\nexport interface InputProps\n extends React.InputHTMLAttributes {}\n\nconst Input = React.forwardRef(\n ({ className, type, ...props }, ref) => {\n return (\n \n )\n },\n)\nInput.displayName = 'Input'\n\nexport { Input }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { hexToHSL } from '@/utils'\r\nimport { Send } from 'lucide-react'\r\nimport { useState } from 'react'\r\nimport { Button } from './ui/button'\r\nimport { Input } from './ui/input'\r\n\r\n/**\r\n * Represents the send area component.\r\n */\r\nconst SendArea = () => {\r\n const { handleSendMessage, disableInput, customStyles } = useSocket()\r\n const [message, setMessage] = useState('')\r\n\r\n const handleEnter = (e: React.KeyboardEvent) => {\r\n if (e.key === 'Enter') {\r\n e.preventDefault()\r\n handleSendMessage({\r\n message,\r\n })\r\n\r\n setMessage('')\r\n }\r\n }\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n setMessage(e.target.value)}\r\n onKeyDown={handleEnter}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n />\r\n {\r\n handleSendMessage({\r\n message,\r\n cb: () => setMessage(''),\r\n })\r\n }}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nexport default SendArea\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\r\nimport { Body, Header, SendArea } from '../components'\r\nimport { Props, SocketProvider } from '../context/socket.ctx'\r\n\r\nconst queryClient = new QueryClient()\r\n\r\n/**\r\n * Represents the ChatBox component.\r\n * This component displays a chat box with a header, body, and send area.\r\n */\r\n\r\nconst ChatBox = ({ className }: { className?: string }) => {\r\n const { customStyles, isForManager } = useSocket()\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n {!isForManager && }\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Wrapper component for the chat box.\r\n *\r\n * @returns The rendered chat box wrapped in a SocketProvider.\r\n */\r\nconst ChatBoxWrapper = (props: Omit) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default ChatBoxWrapper\r\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","Object$","Map$","Set$","SetHas$","SetAdd$","MapHas$","MapGet$","MapSet$","ChildFlag","AttributeFlag","EventFlag","StyleAttributeFlag","SvgAttributeFlag","BlockFlag","TEXT_NODE_CACHE","EVENT_PATCH","EVENTS_REGISTRY","IS_NON_DIMENSIONAL","XLINK_NS","XML_NS","X_CHAR","NON_PROPS","VOID_ELEMENTS","document$","HTM_TEMPLATE","HTM_TEMPLATE_CONTENT","SVG_TEMPLATE","node$","element$","characterData$","getOwnPropertyDescriptor$","insertBefore$","cloneNode$","replaceChild$","remove$$1","addEventListener$","removeAttribute$","setAttribute$","setAttributeNS$","setTextContent$","firstChild$","nextSibling$","characterDataSet$","stringToDOM","content","svg","template","createEventListener","el","event","capture","nativeEvent","el2","handler","patch","newValue","_a","childAt","index","j","visitedNodes","removeComments","insertText","setText","setStyleAttribute","setSvgAttribute","setAttribute","isValueNully","isInput","isSelect","isTextArea","__defProp$1","__defNormalProp$1","obj","__publicField$1","AbstractBlock","renderToTemplate","vnode","edits","path","current","style","kebabKey","char","canMergeString","_b","newPath","__defProp","__defNormalProp","__publicField","mapArray","ArrayBlock","oldChildren","newChildren","oldChildrenLength","newChildrenLength","parent","arrayRemove$","arrayMount$","oldHead","newHead","oldTail","newTail","oldHeadChild","newHeadChild","oldTailChild","newTailChild","oldKeyMap","oldHeadKey","newHeadKey","patch$","oldTailKey","newTailKey","nextChild","move$","oldIndex","mount$","oldChild","remove$","refNode","block","array$","arrayPatch$","HOLE_PROXY","_","unwrap","shouldUpdate","root","shouldUpdateCurrentBlock","Block","oldBlock","newBlock","getElements","hydrateNode","elements","getCurrentElement","edit","targetEl","patch2","initsLength","shouldUpdate$","oldValue","firstEdit","newChildBlock","newTargetEl","block2","_oldProps","_newProps","cache","pathLength","isCacheAndKeyExists","siblings","block$","experimental_options","RENDER_SCOPE","SVG_RENDER_SCOPE","Effect","effect","deps","useEffect","REGISTRY","scopedContext","createContext","processProps","portals","processedProps","currentIndex","renderReactScope","wrap","createElement","unstable","isBlock","isCallable","puppetComponent","puppetBlock","reactPortal","createPortal","Fragment","millionPortal","cn","flatten","rawChildren","flattenedChildren","useLayoutEffect","useLayoutEffect$1","traverse","fiber","selector","ascending","useFiber","useRef","useState","bind","maybeFiber","useNearestParent","parentRef","useContainer","rootRef","options","noSlot","blockTarget","defaultType","block$1","MillionBlock","forwardedRef","container","hmrTimestamp","patch$1","portalRef","useCallback","currentBlock","_c","props2","marker","useMemo","childrenSize","MillionArray","each","memo2","as","rest","fragmentRef","setMountPortals","createChildren","MillionFor","typedMemo","memo","getComponent","currentCache","portals2","isEqual","shouldCompiledBlockUpdate","prev","next","compiledBlock","render","blockName","RenderBlock","portalCount","scoped","useContext","derived","scope","targets","len","EVENTS_SOCKET","USER_ID_KEY","API_URL","_assert","number","bool","isBytes","bytes","lengths","hash","exists","instance","checkFinished","output","out","min","assert","_u64","U32_MASK64","_32n","fromBig","le","split","lst","Ah","Al","toBig","shrSH","_l","shrSL","rotrSH","rotrSL","rotrBH","rotrBL","rotr32H","_h","rotr32L","rotlSH","rotlSL","rotlBH","rotlBL","add","Bh","Bl","add3L","Cl","add3H","low","Ch","add4L","Dl","add4H","Dh","add5L","El","add5H","Eh","u64","crypto","exports","crypto_1","_assert_js_1","u8","arr","u32","createView","rotr","word","shift","rotl","byteSwap","byteSwap32","hexes","bytesToHex","hex","asciis","asciiToBase16","hexToBytes","hl","al","array","ai","hi","n1","n2","nextTick","asyncLoop","iters","tick","cb","ts","diff","utf8ToBytes","str","toBytes","data","concatBytes","arrays","sum","res","pad","Hash","toStr","checkOpts","defaults","opts","wrapConstructor","hashCons","hashC","msg","tmp","wrapConstructorWithOpts","wrapXOFConstructorWithOpts","randomBytes","bytesLength","sha3","_u64_js_1","utils_js_1","require$$2","SHA3_PI","SHA3_ROTL","_SHA3_IOTA","_0n","_1n","_2n","_7n","_256n","_0x71n","round","R","y","t","SHA3_IOTA_H","SHA3_IOTA_L","rotlH","rotlL","keccakP","rounds","B","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","Keccak","blockLen","suffix","outputLen","enableXOF","state","pos","take","bufferOut","to","gen","genShake","defaultLength","bigLength","createEntropy","length","random","entropy","bufToBigInt","buf","bits","bi","input","alphabet","randomLetter","createFingerprint","globalObj","global","globals","sourceString","createCounter","count","initialCountMax","counter","fingerprint","firstLetter","time","salt","hashInput","createId","isCuid","id","minLength","maxLength","regex","src","getConstants","createId_1","genId","generatedId","userIdFromLocalStorage","getAddress","channelId","incomeUserId","userId","openInNewTab","url","hexToHSL","bigint","max","Subscribable","listener","isServer","noop","functionalUpdate","updater","isValidTimeout","timeUntilStale","updatedAt","staleTime","matchQuery","filters","query","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","status","mutationKey","hashKey","val","isPlainObject","result","replaceEqualDeep","isPlainArray","aItems","aSize","bItems","bSize","copy","equalItems","shallowEqualObjects","o","hasObjectPrototype","ctor","prot","sleep","ms","resolve","replaceData","prevData","addToEnd","items","newItems","addToStart","skipToken","FocusManager","__privateAdd","_focused","_cleanup","_setup","__privateSet","onFocus","__privateGet","setup","focused","isFocused","focusManager","OnlineManager","_online","onOnline","onlineListener","offlineListener","online","onlineManager","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","isRetryCancelled","isResolved","continueFn","promiseResolve","promiseReject","promise","outerResolve","outerReject","cancel","cancelOptions","reject","cancelRetry","continueRetry","shouldPause","pause","continueResolve","canContinue","run","promiseOrValue","retry","retryDelay","delay","shouldRetry","createNotifyManager","queue","transactions","notifyFn","callback","batchNotifyFn","scheduleFn","setScheduler","batch","flush","schedule","batchCalls","originalQueue","notifyManager","Removable","_gcTimeout","newGcTime","Query","_dispatch","_initialState","_revertState","_cache","_retryer","_observers","_defaultOptions","_abortSignalConsumed","getDefaultState","newData","__privateMethod","dispatch_fn","setStateOptions","observer","fetchOptions","abortController","queryFnContext","addSignalProperty","fetchFn","onError","_d","action","reducer","fetchState","hasData","initialDataUpdatedAt","QueryCache","_queries","client","queryHash","queryInMap","defaultedFilters","queries","Mutation","_mutationCache","variables","executeMutation","restored","_f","_e","_g","_j","_i","_k","_n","_m","_p","_o","_r","_q","_t","_s","MutationCache","_mutations","_mutationId","_resuming","__privateWrapper","pausedMutations","infiniteQueryBehavior","pages","direction","oldPages","oldPageParams","empty","cancelled","queryFn","fetchPage","param","previous","page","maxPages","addTo","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pageParams","lastIndex","QueryClient","_queryCache","_queryDefaults","_mutationDefaults","_mountCount","_unsubscribeFocus","_unsubscribeOnline","cachedData","defaultedOptions","queryCache","refetchFilters","defaultedCancelOptions","promises","queryDefault","QueryObserver","_executeFetch","_updateStaleTimeout","_computeRefetchInterval","_updateRefetchInterval","_updateTimers","_clearStaleTimeout","_clearRefetchInterval","_updateQuery","_notify","_client","_currentQuery","_currentQueryInitialState","_currentResult","_currentResultState","_currentResultOptions","_selectError","_selectFn","_selectResult","_lastQueryWithDefinedData","_staleTimeoutId","_refetchIntervalId","_currentRefetchInterval","_trackedProps","shouldFetchOnMount","executeFetch_fn","updateTimers_fn","shouldFetchOn","clearStaleTimeout_fn","clearRefetchInterval_fn","notifyOptions","prevOptions","prevQuery","updateQuery_fn","mounted","shouldFetchOptionally","updateStaleTimeout_fn","nextRefetchInterval","computeRefetchInterval_fn","updateRefetchInterval_fn","shouldAssignObserverCurrentProperties","onPropTracked","trackedResult","prevResult","prevResultState","prevResultOptions","queryInitialState","newState","isPlaceholderData","fetchOnMount","fetchOptionally","errorUpdatedAt","selectError","placeholderData","isFetching","isPending","isError","isLoading","isStale","nextResult","defaultNotifyOptions","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","typedKey","notify_fn","timeout","nextInterval","shouldLoadOnMount","field","optimisticResult","QueryClientContext","useQueryClient","queryClient","QueryClientProvider","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","shouldThrowError","throwError","params","ensurePreventErrorBoundaryRetry","errorResetBoundary","useClearResetErrorBoundary","getHasError","throwOnError","ensureStaleTime","shouldSuspend","fetchOptimistic","useBaseQuery","Observer","isRestoring","onStoreChange","unsubscribe","useQuery","PACKET_TYPES","PACKET_TYPES_REVERSE","ERROR_PACKET","withNativeBlob","withNativeArrayBuffer","isView","encodePacket","supportsBinary","encodeBlobAsBase64","fileReader","toArray","TEXT_ENCODER","encodePacketToBinary","packet","encoded","chars","lookup","decode","base64","bufferLength","encoded1","encoded2","encoded3","encoded4","arraybuffer","decodePacket","encodedPacket","binaryType","mapBinary","decodeBase64Packet","decoded","SEPARATOR","encodePayload","packets","encodedPackets","decodePayload","encodedPayload","decodedPacket","createPacketEncoderStream","controller","payloadLength","header","view","TEXT_DECODER","totalLength","chunks","acc","chunk","concatChunks","size","buffer","createPacketDecoderStream","maxPayload","expectedLength","isBinary","headerArray","protocol","Emitter","mixin","on","callbacks","globalThisShim","pick","attr","NATIVE_SET_TIMEOUT","globalThis","NATIVE_CLEAR_TIMEOUT","installTimerFunctions","BASE64_OVERHEAD","byteLength","utf8Length","encode","qs","qry","pairs","pair","TransportError","reason","description","Transport","details","onPause","schema","hostname","encodedQuery","map","seed","num","yeast","now","hasCORS","XHR","xdomain","hasXHR2","XMLHttpRequest","Polling","isSSL","port","forceBase64","total","close","Request","req","xhrStatus","uri","xhr","fromError","unloadHandler","terminationEvent","setTimeoutFn","WebSocket","usingBrowserWebSocket","defaultBinaryType","isReactNative","WS","protocols","closeEvent","ev","lastPacket","WT","stream","decoderStream","reader","encoderStream","read","done","transports","re","parts","parse","pathNames","regx","names","$0","$1","$2","Socket","transport","failed","onTransportOpen","cleanup","freezeTransport","onerror","onTransportClose","onclose","onupgrade","payloadSize","cleanupAndClose","waitForUpgrade","upgrades","filteredUpgrades","loc","host","toString","withNativeFile","hasBinary","toJSON","deconstructPacket","buffers","packetData","pack","_deconstructPacket","placeholder","reconstructPacket","_reconstructPacket","RESERVED_EVENTS","PacketType","Encoder","replacer","deconstruction","isObject","Decoder","reviver","isBinaryEvent","BinaryReconstructor","start","binData","io","nsp","ack","isTransportWritable","timer","arg1","arg2","responseArgs","force","listeners","sent","pid","subDestroy","compress","Backoff","rand","deviation","jitter","Manager","_parser","parser","v","Engine","socket","openSubDestroy","errorSub","nsps","attempt","parsed","sameNamespace","newConnection","freeGlobal","freeSelf","useUnmount","func","funcRef","SocketCtx","SocketProvider","onEndBot","isTest","onClose","isShowClose","isForLiveChat","customStyles","_customStyles","isForPreview","isForManager","adminId","disableInput","setDisableInput","setCustomStyles","undefined","urlParams","URLSearchParams","window","search","_userId","_channelId","get","socketRef","autoConnect","messages","isBot","message","createdAt","Date","toISOString","fetch","URL","json","initialData","custom","enabled","handleSendMessage","extraData","trimmedMessage","trim","address","newMessage","emit","MESSAGE","setQueryData","handleClose","postMessage","handleReload","disconnect","connect","filter","TYPING","STOP_TYPING","isLoadingMessages","useSocket","socketCtx","r","clsx","CLASS_PART_SEPARATOR","createClassUtils","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","getClassGroupId","className","classParts","getGroupRecursive","getGroupIdForArbitraryProperty","getConflictingClassGroupIds","classGroupId","hasPostfixModifier","conflicts","classPartObject","currentClassPart","nextClassPartObject","classGroupFromNextClassPart","classRest","validator","arbitraryPropertyRegex","arbitraryPropertyClassName","property","theme","getPrefixedClassGroupEntries","classGroup","processClassesRecursively","classDefinition","classPartObjectToEdit","getPart","isThemeGetter","currentClassPartObject","pathPart","classGroupEntries","prefixedClassGroup","createLruCache","maxCacheSize","cacheSize","previousCache","update","IMPORTANT_MODIFIER","createSplitModifiers","separator","isSeparatorSingleCharacter","firstSeparatorCharacter","separatorLength","modifiers","bracketDepth","modifierStart","postfixModifierPosition","currentCharacter","baseClassNameWithImportantModifier","hasImportantModifier","baseClassName","maybePostfixModifierPosition","sortModifiers","sortedModifiers","unsortedModifiers","modifier","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","splitModifiers","classGroupsInConflict","originalClassName","variantModifier","modifierId","classId","group","twJoin","argument","resolvedValue","string","toValue","mix","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","fromTheme","themeGetter","arbitraryValueRegex","fractionRegex","stringLengths","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isLength","isNumber","isArbitraryLength","getIsArbitraryValue","isLengthOnly","isArbitraryNumber","isInteger","isPercent","isArbitraryValue","isTshirtSize","sizeLabels","isArbitrarySize","isNever","isArbitraryPosition","imageLabels","isArbitraryImage","isImage","isArbitraryShadow","isShadow","isAny","label","testValue","getDefaultConfig","colors","spacing","blur","brightness","borderColor","borderRadius","borderSpacing","borderWidth","contrast","grayscale","hueRotate","invert","gap","gradientColorStops","gradientColorStopPositions","inset","margin","opacity","padding","saturate","scale","sepia","skew","space","translate","getOverscroll","getOverflow","getSpacingWithAutoAndArbitrary","getSpacingWithArbitrary","getLengthWithEmptyAndArbitrary","getNumberWithAutoAndArbitrary","getPositions","getLineStyles","getBlendModes","getAlign","getZeroAndEmpty","getBreaks","getNumber","getNumberAndArbitrary","twMerge","inputs","module","this","u","$","M","D","S","w","O","defaultAttributes","toKebabCase","createLucideIcon","iconName","iconNode","forwardRef","color","strokeWidth","absoluteStrokeWidth","tag","attrs","LoaderCircle","RefreshCcw","Send","X","Message_1","_compiledBlock","_props","v0","v1","v2","v3","v4","v5","v6","v7","Message","_adminId","isLeft","wordBreak","backgroundColor","_extends","target","$6ed0406888f73fc4$var$setRef","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","slotPropValue","childPropValue","falsyToString","cx","cva","base","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","getCompoundVariantClassNames","param1","cvClass","cvClassName","compoundVariantOptions","buttonVariants","default","destructive","outline","secondary","ghost","link","sm","lg","icon","Button","asChild","Comp","Slot","ButtonsMessage","hsl","button","title","Card_1","Card","card","image_url","subtitle","buttons","CardsMessage","TypingMessage","Body","endMessageRef","scrollIntoView","behavior","renderMessage","Loader2","dayjs","Header_1","Header","logoUrl","Input","SendArea","setMessage","handleEnter","preventDefault","ChatBox_1","ChatBox","width","windowSize","height","ChatBoxWrapper"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASa,MAAIA,IAAEC,IAAiBC,IAAE,OAAO,IAAI,eAAe,GAAEC,IAAE,OAAO,IAAI,gBAAgB,GAAEC,IAAE,OAAO,UAAU,gBAAeC,IAAEL,EAAE,mDAAmD,mBAAkBM,IAAE,EAAC,KAAI,IAAG,KAAI,IAAG,QAAO,IAAG,UAAS,GAAE;AAClP,WAASC,EAAEC,GAAEC,GAAEC,GAAE;AAAC,QAAIC,GAAEC,IAAE,IAAGC,IAAE,MAAKC,IAAE;AAAK,IAASJ,MAAT,WAAaG,IAAE,KAAGH,IAAYD,EAAE,QAAX,WAAiBI,IAAE,KAAGJ,EAAE,MAAcA,EAAE,QAAX,WAAiBK,IAAEL,EAAE;AAAK,SAAIE,KAAKF;AAAE,MAAAL,EAAE,KAAKK,GAAEE,CAAC,KAAG,CAACL,EAAE,eAAeK,CAAC,MAAIC,EAAED,CAAC,IAAEF,EAAEE,CAAC;AAAG,QAAGH,KAAGA,EAAE;AAAa,WAAIG,KAAKF,IAAED,EAAE,cAAa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zyC,gBAAAA,MAACiyC,IAAO,CAAA,CAAA,GAAA,IACP,CAACjU,KAAgBh+B,gBAAAA,EAAA,IAAC4yC,KAAW,CAAA,GAAA;AAAA;AAKxC,GAOMS,KAAiBA,CAACz6C,MAEnBoH,gBAAAA,EAAA,IAAAyuB,IAAA,EAAoB,QAAQD,IAC3B,gCAAC+O,IAAmB3kC,EAAAA,GAAAA,GAClB,UAAAoH,gBAAAA,EAAA,IAACizC,IAAQ,EAAA,WAAWr6C,EAAM4oC,UAAa,CAAA,GACzC,EACF,CAAA;","x_google_ignoreList":[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,74,75,76,77,78,79,80,81,83,84,85,86,87]} \ No newline at end of file diff --git a/dist-components/index.umd.js b/dist-components/index.umd.js index 610ec23..bbd61e7 100644 --- a/dist-components/index.umd.js +++ b/dist-components/index.umd.js @@ -1,4 +1,4 @@ -(function(ee,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],b):(ee=typeof globalThis<"u"?globalThis:ee||self,b(ee.chatbox={},ee.React,ee.ReactDOM))})(this,function(ee,b,me){"use strict";var ss=(ee,b,me)=>{if(!b.has(ee))throw TypeError("Cannot "+me)};var u=(ee,b,me)=>(ss(ee,b,"read from private field"),me?me.call(ee):b.get(ee)),N=(ee,b,me)=>{if(b.has(ee))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(ee):b.set(ee,me)},P=(ee,b,me,_t)=>(ss(ee,b,"write to private field"),_t?_t.call(ee,me):b.set(ee,me),me);var cn=(ee,b,me,_t)=>({set _(ge){P(ee,b,ge,me)},get _(){return u(ee,b,_t)}}),W=(ee,b,me)=>(ss(ee,b,"access private method"),me);var yt,tt,Pt,No,$t,rt,Mt,jo,mt,Do,Lt,Nt,Oe,be,de,pr,gt,$e,Ye,Bo,De,Io,Be,yr,_e,jt,Ie,ct,Fo,Ae,mr,bt,qo,oe,nt,st,Dt,Bt,it,It,Ft,Uo,xe,ne,gr,ve,vt,qt,Fe,br,Ut,Ht,wt,xt,ot,Vt,Et,Or,vr,is,wr,os,xr,as,Er,cs,_r,ls,Sr,us,kr,hs,nn,na,Ho;function _t(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const ge=_t(b);var lt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ln={exports:{}},Kt={};/** +(function(ee,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],b):(ee=typeof globalThis<"u"?globalThis:ee||self,b(ee.chatbox={},ee.React,ee.ReactDOM))})(this,function(ee,b,me){"use strict";var ss=(ee,b,me)=>{if(!b.has(ee))throw TypeError("Cannot "+me)};var u=(ee,b,me)=>(ss(ee,b,"read from private field"),me?me.call(ee):b.get(ee)),L=(ee,b,me)=>{if(b.has(ee))throw TypeError("Cannot add the same private member more than once");b instanceof WeakSet?b.add(ee):b.set(ee,me)},P=(ee,b,me,_t)=>(ss(ee,b,"write to private field"),_t?_t.call(ee,me):b.set(ee,me),me);var cn=(ee,b,me,_t)=>({set _(ge){P(ee,b,ge,me)},get _(){return u(ee,b,_t)}}),W=(ee,b,me)=>(ss(ee,b,"access private method"),me);var yt,tt,Pt,No,$t,rt,Mt,jo,mt,Do,Lt,Nt,Oe,be,de,pr,gt,$e,Ye,Bo,De,Io,Be,yr,_e,jt,Ie,ct,Fo,Ae,mr,bt,Uo,ie,nt,st,Dt,Bt,it,It,Ft,qo,xe,ne,gr,ve,vt,Ut,Fe,br,qt,Ht,wt,xt,ot,Vt,Et,Or,vr,is,wr,os,xr,as,Er,cs,_r,ls,Sr,us,kr,hs,nn,na,Ho;function _t(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const ge=_t(b);var lt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sa(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ln={exports:{}},Kt={};/** * @license React * react-jsx-runtime.production.min.js * @@ -14,19 +14,19 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ds;function oa(){return ds||(ds=1,process.env.NODE_ENV!=="production"&&function(){var t=b,e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,_="@@iterator";function g(c){if(c===null||typeof c!="object")return null;var E=w&&c[w]||c[_];return typeof E=="function"?E:null}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function L(c){{for(var E=arguments.length,A=new Array(E>1?E-1:0),q=1;q1?E-1:0),U=1;U=1&&ue>=0&&V[ce]!==we[ue];)ue--;for(;ce>=1&&ue>=0;ce--,ue--)if(V[ce]!==we[ue]){if(ce!==1||ue!==1)do if(ce--,ue--,ue<0||V[ce]!==we[ue]){var Te=` -`+V[ce].replace(" at new "," at ");return c.displayName&&Te.includes("")&&(Te=Te.replace("",c.displayName)),typeof c=="function"&&he.set(c,Te),Te}while(ce>=1&&ue>=0);break}}}finally{Le=!1,qe.current=te,Ee(),Error.prepareStackTrace=G}var Wt=c?c.displayName||c.name:"",ra=Wt?Ue(Wt):"";return typeof c=="function"&&he.set(c,ra),ra}function Qt(c,E,A){return at(c,!1)}function qu(c){var E=c.prototype;return!!(E&&E.isReactComponent)}function sn(c,E,A){if(c==null)return"";if(typeof c=="function")return at(c,qu(c));if(typeof c=="string")return Ue(c);switch(c){case f:return Ue("Suspense");case h:return Ue("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case l:return Qt(c.render);case p:return sn(c.type,E,A);case d:{var q=c,G=q._payload,te=q._init;try{return sn(te(G),E,A)}catch{}}}return""}var on=Object.prototype.hasOwnProperty,Vo={},Qo=C.ReactDebugCurrentFrame;function an(c){if(c){var E=c._owner,A=sn(c.type,c._source,E?E.type:null);Qo.setExtraStackFrame(A)}else Qo.setExtraStackFrame(null)}function Uu(c,E,A,q,G){{var te=Function.call.bind(on);for(var Y in c)if(te(c,Y)){var V=void 0;try{if(typeof c[Y]!="function"){var we=Error((q||"React class")+": "+A+" type `"+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[Y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw we.name="Invariant Violation",we}V=c[Y](E,Y,q,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){V=ce}V&&!(V instanceof Error)&&(an(G),L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",q||"React class",A,Y,typeof V),an(null)),V instanceof Error&&!(V.message in Vo)&&(Vo[V.message]=!0,an(G),L("Failed %s type: %s",A,V.message),an(null))}}}var Hu=Array.isArray;function Zn(c){return Hu(c)}function Vu(c){{var E=typeof Symbol=="function"&&Symbol.toStringTag,A=E&&c[Symbol.toStringTag]||c.constructor.name||"Object";return A}}function Qu(c){try{return zo(c),!1}catch{return!0}}function zo(c){return""+c}function Wo(c){if(Qu(c))return L("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Vu(c)),zo(c)}var Cr=C.ReactCurrentOwner,zu={key:!0,ref:!0,__self:!0,__source:!0},Yo,Ko,es;es={};function Wu(c){if(on.call(c,"ref")){var E=Object.getOwnPropertyDescriptor(c,"ref").get;if(E&&E.isReactWarning)return!1}return c.ref!==void 0}function Yu(c){if(on.call(c,"key")){var E=Object.getOwnPropertyDescriptor(c,"key").get;if(E&&E.isReactWarning)return!1}return c.key!==void 0}function Ku(c,E){if(typeof c.ref=="string"&&Cr.current&&E&&Cr.current.stateNode!==E){var A=R(Cr.current.type);es[A]||(L('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',R(Cr.current.type),c.ref),es[A]=!0)}}function Gu(c,E){{var A=function(){Yo||(Yo=!0,L("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};A.isReactWarning=!0,Object.defineProperty(c,"key",{get:A,configurable:!0})}}function Xu(c,E){{var A=function(){Ko||(Ko=!0,L("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};A.isReactWarning=!0,Object.defineProperty(c,"ref",{get:A,configurable:!0})}}var Ju=function(c,E,A,q,G,te,Y){var V={$$typeof:e,type:c,key:E,ref:A,props:Y,_owner:te};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:q}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function Zu(c,E,A,q,G){{var te,Y={},V=null,we=null;A!==void 0&&(Wo(A),V=""+A),Yu(E)&&(Wo(E.key),V=""+E.key),Wu(E)&&(we=E.ref,Ku(E,G));for(te in E)on.call(E,te)&&!zu.hasOwnProperty(te)&&(Y[te]=E[te]);if(c&&c.defaultProps){var ce=c.defaultProps;for(te in ce)Y[te]===void 0&&(Y[te]=ce[te])}if(V||we){var ue=typeof c=="function"?c.displayName||c.name||"Unknown":c;V&&Gu(Y,ue),we&&Xu(Y,ue)}return Ju(c,V,we,G,q,Cr.current,Y)}}var ts=C.ReactCurrentOwner,Go=C.ReactDebugCurrentFrame;function zt(c){if(c){var E=c._owner,A=sn(c.type,c._source,E?E.type:null);Go.setExtraStackFrame(A)}else Go.setExtraStackFrame(null)}var rs;rs=!1;function ns(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}function Xo(){{if(ts.current){var c=R(ts.current.type);if(c)return` +`+V[ce].replace(" at new "," at ");return c.displayName&&Te.includes("")&&(Te=Te.replace("",c.displayName)),typeof c=="function"&&he.set(c,Te),Te}while(ce>=1&&ue>=0);break}}}finally{Le=!1,Ue.current=te,Ee(),Error.prepareStackTrace=G}var Wt=c?c.displayName||c.name:"",ra=Wt?qe(Wt):"";return typeof c=="function"&&he.set(c,ra),ra}function Qt(c,E,A){return at(c,!1)}function Uu(c){var E=c.prototype;return!!(E&&E.isReactComponent)}function sn(c,E,A){if(c==null)return"";if(typeof c=="function")return at(c,Uu(c));if(typeof c=="string")return qe(c);switch(c){case f:return qe("Suspense");case h:return qe("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case l:return Qt(c.render);case p:return sn(c.type,E,A);case d:{var U=c,G=U._payload,te=U._init;try{return sn(te(G),E,A)}catch{}}}return""}var on=Object.prototype.hasOwnProperty,Vo={},Qo=k.ReactDebugCurrentFrame;function an(c){if(c){var E=c._owner,A=sn(c.type,c._source,E?E.type:null);Qo.setExtraStackFrame(A)}else Qo.setExtraStackFrame(null)}function qu(c,E,A,U,G){{var te=Function.call.bind(on);for(var Y in c)if(te(c,Y)){var V=void 0;try{if(typeof c[Y]!="function"){var we=Error((U||"React class")+": "+A+" type `"+Y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[Y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw we.name="Invariant Violation",we}V=c[Y](E,Y,U,A,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ce){V=ce}V&&!(V instanceof Error)&&(an(G),M("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",U||"React class",A,Y,typeof V),an(null)),V instanceof Error&&!(V.message in Vo)&&(Vo[V.message]=!0,an(G),M("Failed %s type: %s",A,V.message),an(null))}}}var Hu=Array.isArray;function Zn(c){return Hu(c)}function Vu(c){{var E=typeof Symbol=="function"&&Symbol.toStringTag,A=E&&c[Symbol.toStringTag]||c.constructor.name||"Object";return A}}function Qu(c){try{return zo(c),!1}catch{return!0}}function zo(c){return""+c}function Wo(c){if(Qu(c))return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Vu(c)),zo(c)}var Cr=k.ReactCurrentOwner,zu={key:!0,ref:!0,__self:!0,__source:!0},Yo,Ko,es;es={};function Wu(c){if(on.call(c,"ref")){var E=Object.getOwnPropertyDescriptor(c,"ref").get;if(E&&E.isReactWarning)return!1}return c.ref!==void 0}function Yu(c){if(on.call(c,"key")){var E=Object.getOwnPropertyDescriptor(c,"key").get;if(E&&E.isReactWarning)return!1}return c.key!==void 0}function Ku(c,E){if(typeof c.ref=="string"&&Cr.current&&E&&Cr.current.stateNode!==E){var A=T(Cr.current.type);es[A]||(M('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(Cr.current.type),c.ref),es[A]=!0)}}function Gu(c,E){{var A=function(){Yo||(Yo=!0,M("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};A.isReactWarning=!0,Object.defineProperty(c,"key",{get:A,configurable:!0})}}function Xu(c,E){{var A=function(){Ko||(Ko=!0,M("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",E))};A.isReactWarning=!0,Object.defineProperty(c,"ref",{get:A,configurable:!0})}}var Ju=function(c,E,A,U,G,te,Y){var V={$$typeof:e,type:c,key:E,ref:A,props:Y,_owner:te};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function Zu(c,E,A,U,G){{var te,Y={},V=null,we=null;A!==void 0&&(Wo(A),V=""+A),Yu(E)&&(Wo(E.key),V=""+E.key),Wu(E)&&(we=E.ref,Ku(E,G));for(te in E)on.call(E,te)&&!zu.hasOwnProperty(te)&&(Y[te]=E[te]);if(c&&c.defaultProps){var ce=c.defaultProps;for(te in ce)Y[te]===void 0&&(Y[te]=ce[te])}if(V||we){var ue=typeof c=="function"?c.displayName||c.name||"Unknown":c;V&&Gu(Y,ue),we&&Xu(Y,ue)}return Ju(c,V,we,G,U,Cr.current,Y)}}var ts=k.ReactCurrentOwner,Go=k.ReactDebugCurrentFrame;function zt(c){if(c){var E=c._owner,A=sn(c.type,c._source,E?E.type:null);Go.setExtraStackFrame(A)}else Go.setExtraStackFrame(null)}var rs;rs=!1;function ns(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}function Xo(){{if(ts.current){var c=T(ts.current.type);if(c)return` Check the render method of \``+c+"`."}return""}}function eh(c){{if(c!==void 0){var E=c.fileName.replace(/^.*[\\\/]/,""),A=c.lineNumber;return` Check your code at `+E+":"+A+"."}return""}}var Jo={};function th(c){{var E=Xo();if(!E){var A=typeof c=="string"?c:c.displayName||c.name;A&&(E=` -Check the top-level render call using <`+A+">.")}return E}}function Zo(c,E){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var A=th(E);if(Jo[A])return;Jo[A]=!0;var q="";c&&c._owner&&c._owner!==ts.current&&(q=" It was passed a child from "+R(c._owner.type)+"."),zt(c),L('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,q),zt(null)}}function ea(c,E){{if(typeof c!="object")return;if(Zn(c))for(var A=0;A",V=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof c,L("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,V)}var ue=Zu(c,E,A,G,te);if(ue==null)return ue;if(Y){var Te=E.children;if(Te!==void 0)if(q)if(Zn(Te)){for(var Wt=0;Wt"u")throw new Error("See http://million.dev/docs/install to install the compiler.");const Ge=document;Ge.createElement("template");const gs=Ge.createElement("template"),ma=gs.content,bs=Ge.createElementNS("http://www.w3.org/2000/svg","svg"),ut=Node.prototype,$r=Element.prototype,ga=CharacterData.prototype,Mr=ps.getOwnPropertyDescriptor,Lr=ut.insertBefore,vs=ut.cloneNode,ba=ut.replaceChild,va=$r.remove,wa=ut.addEventListener,xa=$r.removeAttribute,ws=$r.setAttribute,xs=$r.setAttributeNS,Ea=Mr(ut,"textContent").set,Es=Mr(ut,"firstChild").get,_a=Mr(ut,"nextSibling").get,Sa=Mr(ga,"data").set,ka=(t,e)=>{const r=e?bs:gs;return r.innerHTML=t,(e?bs:ma).firstChild};Ge[fn]=new Xt;const _s=(t,e,r)=>{let n=e.toLowerCase(),s=!1;n.endsWith("capture")&&(n=n.slice(0,-7),s=!0);const i=`$$${n}`;un.call(Ge[fn],n)||(wa.call(Ge,n,a=>{let l=a.target;for(;l;){const f=l[i];f&&(ps.defineProperty(a,"currentTarget",{configurable:!0,get(){return l}}),f(a)),l=l.parentNode}},{capture:s}),aa.call(Ge[fn],n));const o=a=>{var l;a?"key"in a&&a.key===((l=t[i])==null?void 0:l.key)||(t[i]=a):t[i]=null};return o(r),o},ht=(t,e)=>{let r=Es.call(t);if(e)for(let n=0;n{var r;if(Ss.has(t))return;t.nodeType===8&&((r=t.parentNode)==null||r.removeChild(t));let e=Es.call(t);for(;e;)ks(e),e=e.nextSibling;Ss.add(t)},Cs=(t,e,r)=>{const n=Ge.createTextNode(e),s=ht(t,r);return Lr.call(t,n,s),n},Ca=(t,e)=>{Sa.call(t,e)},Nr=(t,e,r)=>{typeof r!="number"||ua.test(e)?t.style[e]=r:typeof r=="string"?t.style.cssText=r:e.startsWith("-")?t.style.setProperty(e,String(r)):r==null?t.style[e]="":t.style[e]=`${String(r)}px`},Os=(t,e,r)=>{e=e.replace(/xlink(?:H|:h)/,"h").replace(/sName$/,"s"),e.startsWith("xmlns")?xs.call(t,fa,e,String(r)):e.startsWith("xlink")&&xs.call(t,ha,"href",String(r))},As=(t,e,r)=>{const n=r==null;if(r=n?"":r,e in t&&t[e]!==void 0&&t[e]!==null&&!(t instanceof SVGElement)&&un.call(pa,e))try{t[e]=r}catch{}else!n&&r!==""&&(r!==!1||e.includes("-"))?ws.call(t,e,String(r)):xa.call(t,e);const s=t instanceof HTMLInputElement,i=t instanceof HTMLSelectElement,o=t instanceof HTMLTextAreaElement;e==="value"&&(s||i||o)&&(ws.call(t,e,String(r)),t.value=r)};var Oa=Object.defineProperty,Aa=(t,e,r)=>e in t?Oa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ve=(t,e,r)=>(Aa(t,typeof e!="symbol"?e+"":e,r),r);class Zt{constructor(){Ve(this,"r"),Ve(this,"e"),Ve(this,"l"),Ve(this,"g"),Ve(this,"_u"),Ve(this,"_t"),Ve(this,"d"),Ve(this,"k"),Ve(this,"c")}}const Ts=(t,e=[],r=[])=>{var a,l;if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="bigint"||t===!0)return String(t);if(t==null||t===!1)return"";if(typeof t=="object"&&"$"in t)return e.push({p:r,e:[{t:St,n:null,v:null,h:t.$,i:0,l:null,p:null,b:null}],i:[]}),"";let n="",s="";const i={p:r,e:[],i:[]};for(let f in t.props){const h=t.props[f];if(!(f==="key"||f==="ref"||f==="children")){if(f==="className"&&(f="class"),f==="htmlFor"&&(f="for"),f.startsWith("on")){"$"in h?i.e.push({t:Jt,n:f.slice(2),v:null,h:h.$,i:null,l:null,p:null,b:null}):i.i.push({t:Jt,n:f.slice(2),v:null,h:null,i:null,l:h,p:null,b:null});continue}if(h){if(typeof h=="object"&&"$"in h){f==="style"?i.e.push({t:Pr,n:f,v:null,h:h.$,i:null,l:null,p:null,b:null}):f.charCodeAt(0)===da?i.e.push({t:ca,n:f,v:null,h:h.$,i:null,l:null,p:null,b:null}):i.e.push({t:hn,n:f,v:null,h:h.$,i:null,l:null,p:null,b:null});continue}if(f==="style"&&typeof h=="object"){let p="";for(const d in h){if(typeof h[d]=="object"){i.e.push({t:Pr,n:d,v:null,h:h[d].$,i:null,l:null,p:null,b:null});continue}let y="";for(let w=0,_=d.length;w<_;++w){const g=d.charCodeAt(w);g<97?y+=`-${String.fromCharCode(g+32)}`:y+=d[w]}p+=`${y}:${String(h[d])};`}n+=` style="${p}"`;continue}n+=` ${f}="${String(h)}"`}}}if(un.call(ya,t.type))return i.e.length&&e.push(i),`<${t.type}${n} />`;let o=!1;for(let f=0,h=((a=t.props.children)==null?void 0:a.length)||0,p=0;f${s}`};var Ta=Object.defineProperty,Ra=(t,e,r)=>e in t?Ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pa=(t,e,r)=>(Ra(t,typeof e!="symbol"?e+"":e,r),r);const Rs=t=>new Ps(t);class Ps extends Zt{constructor(e){super(),Pa(this,"b"),this.b=e}v(){}p(e){const r=this.b,n=e.b,s=r.length,i=n.length,o=this.t();if(this===e||i===0&&s===0)return o;if(this.b=n,i===0)return $a.call(this),o;if(s===0)return $s.call(e,o),o;let a=0,l=0,f=s-1,h=i-1,p=r[0],d=n[0],y=r[f],w=n[h],_;for(;a<=f&&l<=h;){if(!p){p=r[++a];continue}if(!y){y=r[--f];continue}const g=p.k,C=d.k;if(g===C){Ct.call(p,d),n[l]=p,p=r[++a],d=n[++l];continue}const L=y.k,$=w.k;if(L===$){Ct.call(y,w),n[h]=y,y=r[--f],w=n[--h];continue}if(g===$){Ct.call(p,w),n[h]=p;const M=n[h+1];pn.call(p,M,(M==null?void 0:M.l)||null),p=r[++a],w=n[--h];continue}if(L===C){Ct.call(y,d),n[l]=y;const M=r[a];pn.call(y,M,(M==null?void 0:M.l)||null),y=r[--f],d=n[++l];continue}if(!_){_=new Ar;for(let M=a;M<=f;M++)Rr.call(_,r[M].k,M)}const H=_.get(C);if(H===void 0)kt.call(d,o,p.l||null);else{const M=r[H];pn.call(M,p,null),Ct.call(M,d),n[l]=M,r[H]=null}d=n[++l]}if(a<=f||l<=h)if(a>f){const g=n[h+1];for(let C=l;C<=h;++C)kt.call(n[C],o,g?g.l:null)}else for(let g=a;g<=f;++g)jr.call(r[g]);return o}m(e,r=null){if(this._t)return this._t;for(let n=0,s=this.b.length;ne.s()).join("")}t(){return this._t||(this._t=this.b[0].t()),this._t}}const dn=Ps.prototype,$s=dn.m,Ms=dn.p,$a=dn.x,Ma=new Proxy({},{get(t,e){return{$:e}}}),Ls=(t,e,r,n)=>{const s=t(Ma),i=[],o=ka(Ts(e?e(s):s,i),n);return ks(o),(a,l,f)=>new Ns(o,i,a,l??(a==null?void 0:a.key)??null,f??r??null,null)},La=(t,e)=>{if(("b"in t||"b"in e)&&Ms.call(t,e),t.l||kt.call(t,void 0,null,null),t.k&&t.k===e.k||t.r===e.r)return Ct.call(t,e);const r=kt.call(e,t.t(),t.l,null);return jr.call(t),t.k=e.k,r};class Ns extends Zt{constructor(e,r,n,s,i,o){super(),this.r=e,this.d=n,this.e=r,this.k=s,this.c=Array(r.length),i?this._u=i:this._u=null,o?this.g=o:this.g=null}m(e,r=null,n){var o,a;if(this.l)return this.l;const s=n??vs.call(this.r,!0),i=(o=this.g)==null?void 0:o.call(this,s);i&&(this.c=i);for(let l=0,f=this.e.length;l{const s=t.length;if(!s)return e;const i=r&&n!==void 0;if(i&&r[n])return r[n];for(let o=0;o(b.useEffect(t,e||[]),null),Re=new Map,Ba=b.createContext(!1),Ia=(t,e,r)=>{const n={ref:e};let s=0;for(const i in t){const o=t[i];if(b.isValidElement(o)||Array.isArray(o)&&o.length&&b.isValidElement(o[0])){n[i]=mn(o,!1,r,s++);continue}n[i]=t[i]}return n},yn=(t,e)=>b.createElement(Dr,{suppressHydrationWarning:!0,id:e},t),mn=(t,e,r,n,s)=>{var p;const i=(p=r==null?void 0:r[n])==null?void 0:p.current,o=b.isValidElement(t)&&typeof t.type=="function"&&"_c"in t.type,a=o&&t.type._c;if(typeof window>"u")return o?a?t:yn(yn(t),s):yn(t,s);if(a){const d=t.type(t.props);if(Re.has(d.type)){const y=Re.get(d.type);if(typeof y=="function")return y(d.props)}}const l=i??(s?document.getElementById(s):null)??document.createElement(Dr),f=me.createPortal(b.createElement(b.Fragment,{children:t}),l,s),h={foreign:!0,current:l,portal:f,reset:d=>{d.childNodes.forEach(y=>d.removeChild(y))},unstable:e};return r&&(r[n]=h),h},gn=t=>{var s;if(typeof t!="object"||t===null||!("type"in t))return typeof t=="number"?String(t):t;let e=t.type;if(typeof e=="function")return gn(e(t.props??{}));if(typeof e=="object"&&"$"in e)return e;const r={...t.props};"css"in r&&"__EMOTION_TYPE_PLEASE_DO_NOT_USE__"in r&&(r.style=r.css.styles,e=r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.css);const n=(s=t.props)==null?void 0:s.children;return n!=null&&(r.children=bn(t.props.children).map(i=>gn(i))),{type:e,props:r}},bn=t=>{if(t==null)return[];if(typeof t=="object"&&"type"in t&&t.type===b.Fragment)return bn(t.props.children);if(!Array.isArray(t)||typeof t=="object"&&"$"in t)return[t];const e=t.flat(1/0),r=[];for(let n=0,s=e.length;n"u"?b.useEffect:b.useLayoutEffect;function vn(t,e,r){if(!t||e(t))return t;let n=r?t.return:t.child;for(;n;){const s=vn(n,e,r);if(s)return s;n=r?null:n.sibling}}function Is(){const t=b.useRef();return b.useState(()=>{const e=Function.prototype.bind;Function.prototype.bind=function(r,n){return r===null&&typeof(n==null?void 0:n.type)=="function"&&(t.current=n,Function.prototype.bind=e),e.apply(this,arguments)}}),t.current}function Fa(t){const e=Is(),r=b.useRef({el:null,depth:0});return Bs(()=>{var n;r.current.el=(n=vn(e,s=>(r.current.depth++,typeof s.type=="string"&&(t===void 0||s.type===t)),!0))==null?void 0:n.stateNode},[e]),r}function qa(){const t=Is(),e=b.useRef({el:null,depth:0});return Bs(()=>{var r;e.current.el=(r=vn(t,n=>{var s;return e.current.depth++,((s=n.stateNode)==null?void 0:s.containerInfo)!=null},!0))==null?void 0:r.stateNode.containerInfo},[t]),e}const Fs=(t,e={})=>{const r=(e==null?void 0:e.experimental_noSlot)??ja.noSlot;let n=e==null?void 0:e.block;const s=e!=null&&e.svg?Ds:Dr;t&&(n=Ls(t,gn,e==null?void 0:e.shouldUpdate,e==null?void 0:e.svg));const i=(o,a)=>{var $,H;const l=qa(),f=Fa(),h=o._hmr,p=b.useRef(null),d=b.useRef(null),y=b.useRef([]);o=Ia(o,a,y.current),($=d.current)==null||$.call(d,o);const w=b.useCallback(()=>{var K,ie,F;if(!p.current&&!r)return;const M=n(o,o.key);return h&&((K=p.current)!=null&&K.textContent)&&(p.current.textContent=""),r&&(p.current=((ie=f.current)==null?void 0:ie.el)??((F=l.current)==null?void 0:F.el),(o.scoped||f.current&&l.current&&f.current.depth>l.current.depth)&&(p.current=l.current.el),p.current.childNodes.length&&console.error(new Error(`\`experimental_options.noSlot\` does not support having siblings at the moment. +Check the top-level render call using <`+A+">.")}return E}}function Zo(c,E){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var A=th(E);if(Jo[A])return;Jo[A]=!0;var U="";c&&c._owner&&c._owner!==ts.current&&(U=" It was passed a child from "+T(c._owner.type)+"."),zt(c),M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',A,U),zt(null)}}function ea(c,E){{if(typeof c!="object")return;if(Zn(c))for(var A=0;A",V=" Did you accidentally export a JSX literal instead of a component?"):ce=typeof c,M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ce,V)}var ue=Zu(c,E,A,G,te);if(ue==null)return ue;if(Y){var Te=E.children;if(Te!==void 0)if(U)if(Zn(Te)){for(var Wt=0;Wt"u")throw new Error("See http://million.dev/docs/install to install the compiler.");const Ge=document;Ge.createElement("template");const gs=Ge.createElement("template"),ma=gs.content,bs=Ge.createElementNS("http://www.w3.org/2000/svg","svg"),ut=Node.prototype,$r=Element.prototype,ga=CharacterData.prototype,Mr=ps.getOwnPropertyDescriptor,Lr=ut.insertBefore,vs=ut.cloneNode,ba=ut.replaceChild,va=$r.remove,wa=ut.addEventListener,xa=$r.removeAttribute,ws=$r.setAttribute,xs=$r.setAttributeNS,Ea=Mr(ut,"textContent").set,Es=Mr(ut,"firstChild").get,_a=Mr(ut,"nextSibling").get,Sa=Mr(ga,"data").set,ka=(t,e)=>{const r=e?bs:gs;return r.innerHTML=t,(e?bs:ma).firstChild};Ge[fn]=new Xt;const _s=(t,e,r)=>{let n=e.toLowerCase(),s=!1;n.endsWith("capture")&&(n=n.slice(0,-7),s=!0);const i=`$$${n}`;un.call(Ge[fn],n)||(wa.call(Ge,n,a=>{let l=a.target;for(;l;){const f=l[i];f&&(ps.defineProperty(a,"currentTarget",{configurable:!0,get(){return l}}),f(a)),l=l.parentNode}},{capture:s}),aa.call(Ge[fn],n));const o=a=>{var l;a?"key"in a&&a.key===((l=t[i])==null?void 0:l.key)||(t[i]=a):t[i]=null};return o(r),o},ht=(t,e)=>{let r=Es.call(t);if(e)for(let n=0;n{var r;if(Ss.has(t))return;t.nodeType===8&&((r=t.parentNode)==null||r.removeChild(t));let e=Es.call(t);for(;e;)ks(e),e=e.nextSibling;Ss.add(t)},Cs=(t,e,r)=>{const n=Ge.createTextNode(e),s=ht(t,r);return Lr.call(t,n,s),n},Ca=(t,e)=>{Sa.call(t,e)},Nr=(t,e,r)=>{typeof r!="number"||ua.test(e)?t.style[e]=r:typeof r=="string"?t.style.cssText=r:e.startsWith("-")?t.style.setProperty(e,String(r)):r==null?t.style[e]="":t.style[e]=`${String(r)}px`},Os=(t,e,r)=>{e=e.replace(/xlink(?:H|:h)/,"h").replace(/sName$/,"s"),e.startsWith("xmlns")?xs.call(t,fa,e,String(r)):e.startsWith("xlink")&&xs.call(t,ha,"href",String(r))},As=(t,e,r)=>{const n=r==null;if(r=n?"":r,e in t&&t[e]!==void 0&&t[e]!==null&&!(t instanceof SVGElement)&&un.call(pa,e))try{t[e]=r}catch{}else!n&&r!==""&&(r!==!1||e.includes("-"))?ws.call(t,e,String(r)):xa.call(t,e);const s=t instanceof HTMLInputElement,i=t instanceof HTMLSelectElement,o=t instanceof HTMLTextAreaElement;e==="value"&&(s||i||o)&&(ws.call(t,e,String(r)),t.value=r)};var Oa=Object.defineProperty,Aa=(t,e,r)=>e in t?Oa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ve=(t,e,r)=>(Aa(t,typeof e!="symbol"?e+"":e,r),r);class Zt{constructor(){Ve(this,"r"),Ve(this,"e"),Ve(this,"l"),Ve(this,"g"),Ve(this,"_u"),Ve(this,"_t"),Ve(this,"d"),Ve(this,"k"),Ve(this,"c")}}const Ts=(t,e=[],r=[])=>{var a,l;if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="bigint"||t===!0)return String(t);if(t==null||t===!1)return"";if(typeof t=="object"&&"$"in t)return e.push({p:r,e:[{t:St,n:null,v:null,h:t.$,i:0,l:null,p:null,b:null}],i:[]}),"";let n="",s="";const i={p:r,e:[],i:[]};for(let f in t.props){const h=t.props[f];if(!(f==="key"||f==="ref"||f==="children")){if(f==="className"&&(f="class"),f==="htmlFor"&&(f="for"),f.startsWith("on")){"$"in h?i.e.push({t:Jt,n:f.slice(2),v:null,h:h.$,i:null,l:null,p:null,b:null}):i.i.push({t:Jt,n:f.slice(2),v:null,h:null,i:null,l:h,p:null,b:null});continue}if(h){if(typeof h=="object"&&"$"in h){f==="style"?i.e.push({t:Pr,n:f,v:null,h:h.$,i:null,l:null,p:null,b:null}):f.charCodeAt(0)===da?i.e.push({t:ca,n:f,v:null,h:h.$,i:null,l:null,p:null,b:null}):i.e.push({t:hn,n:f,v:null,h:h.$,i:null,l:null,p:null,b:null});continue}if(f==="style"&&typeof h=="object"){let p="";for(const d in h){if(typeof h[d]=="object"){i.e.push({t:Pr,n:d,v:null,h:h[d].$,i:null,l:null,p:null,b:null});continue}let y="";for(let w=0,_=d.length;w<_;++w){const g=d.charCodeAt(w);g<97?y+=`-${String.fromCharCode(g+32)}`:y+=d[w]}p+=`${y}:${String(h[d])};`}n+=` style="${p}"`;continue}n+=` ${f}="${String(h)}"`}}}if(un.call(ya,t.type))return i.e.length&&e.push(i),`<${t.type}${n} />`;let o=!1;for(let f=0,h=((a=t.props.children)==null?void 0:a.length)||0,p=0;f${s}`};var Ta=Object.defineProperty,Ra=(t,e,r)=>e in t?Ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pa=(t,e,r)=>(Ra(t,typeof e!="symbol"?e+"":e,r),r);const Rs=t=>new Ps(t);class Ps extends Zt{constructor(e){super(),Pa(this,"b"),this.b=e}v(){}p(e){const r=this.b,n=e.b,s=r.length,i=n.length,o=this.t();if(this===e||i===0&&s===0)return o;if(this.b=n,i===0)return $a.call(this),o;if(s===0)return $s.call(e,o),o;let a=0,l=0,f=s-1,h=i-1,p=r[0],d=n[0],y=r[f],w=n[h],_;for(;a<=f&&l<=h;){if(!p){p=r[++a];continue}if(!y){y=r[--f];continue}const g=p.k,k=d.k;if(g===k){Ct.call(p,d),n[l]=p,p=r[++a],d=n[++l];continue}const M=y.k,I=w.k;if(M===I){Ct.call(y,w),n[h]=y,y=r[--f],w=n[--h];continue}if(g===I){Ct.call(p,w),n[h]=p;const $=n[h+1];pn.call(p,$,($==null?void 0:$.l)||null),p=r[++a],w=n[--h];continue}if(M===k){Ct.call(y,d),n[l]=y;const $=r[a];pn.call(y,$,($==null?void 0:$.l)||null),y=r[--f],d=n[++l];continue}if(!_){_=new Ar;for(let $=a;$<=f;$++)Rr.call(_,r[$].k,$)}const j=_.get(k);if(j===void 0)kt.call(d,o,p.l||null);else{const $=r[j];pn.call($,p,null),Ct.call($,d),n[l]=$,r[j]=null}d=n[++l]}if(a<=f||l<=h)if(a>f){const g=n[h+1];for(let k=l;k<=h;++k)kt.call(n[k],o,g?g.l:null)}else for(let g=a;g<=f;++g)jr.call(r[g]);return o}m(e,r=null){if(this._t)return this._t;for(let n=0,s=this.b.length;ne.s()).join("")}t(){return this._t||(this._t=this.b[0].t()),this._t}}const dn=Ps.prototype,$s=dn.m,Ms=dn.p,$a=dn.x,Ma=new Proxy({},{get(t,e){return{$:e}}}),Ls=(t,e,r,n)=>{const s=t(Ma),i=[],o=ka(Ts(e?e(s):s,i),n);return ks(o),(a,l,f)=>new Ns(o,i,a,l??(a==null?void 0:a.key)??null,f??r??null,null)},La=(t,e)=>{if(("b"in t||"b"in e)&&Ms.call(t,e),t.l||kt.call(t,void 0,null,null),t.k&&t.k===e.k||t.r===e.r)return Ct.call(t,e);const r=kt.call(e,t.t(),t.l,null);return jr.call(t),t.k=e.k,r};class Ns extends Zt{constructor(e,r,n,s,i,o){super(),this.r=e,this.d=n,this.e=r,this.k=s,this.c=Array(r.length),i?this._u=i:this._u=null,o?this.g=o:this.g=null}m(e,r=null,n){var o,a;if(this.l)return this.l;const s=n??vs.call(this.r,!0),i=(o=this.g)==null?void 0:o.call(this,s);i&&(this.c=i);for(let l=0,f=this.e.length;l{const s=t.length;if(!s)return e;const i=r&&n!==void 0;if(i&&r[n])return r[n];for(let o=0;o(b.useEffect(t,e||[]),null),Re=new Map,Ba=b.createContext(!1),Ia=(t,e,r)=>{const n={ref:e};let s=0;for(const i in t){const o=t[i];if(b.isValidElement(o)||Array.isArray(o)&&o.length&&b.isValidElement(o[0])){n[i]=mn(o,!1,r,s++);continue}n[i]=t[i]}return n},yn=(t,e)=>b.createElement(Dr,{suppressHydrationWarning:!0,id:e},t),mn=(t,e,r,n,s)=>{var p;const i=(p=r==null?void 0:r[n])==null?void 0:p.current,o=b.isValidElement(t)&&typeof t.type=="function"&&"_c"in t.type,a=o&&t.type._c;if(typeof window>"u")return o?a?t:yn(yn(t),s):yn(t,s);if(a){const d=t.type(t.props);if(Re.has(d.type)){const y=Re.get(d.type);if(typeof y=="function")return y(d.props)}}const l=i??(s?document.getElementById(s):null)??document.createElement(Dr),f=me.createPortal(b.createElement(b.Fragment,{children:t}),l,s),h={foreign:!0,current:l,portal:f,reset:d=>{d.childNodes.forEach(y=>d.removeChild(y))},unstable:e};return r&&(r[n]=h),h},gn=t=>{var s;if(typeof t!="object"||t===null||!("type"in t))return typeof t=="number"?String(t):t;let e=t.type;if(typeof e=="function")return gn(e(t.props??{}));if(typeof e=="object"&&"$"in e)return e;const r={...t.props};"css"in r&&"__EMOTION_TYPE_PLEASE_DO_NOT_USE__"in r&&(r.style=r.css.styles,e=r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.__EMOTION_TYPE_PLEASE_DO_NOT_USE__,delete r.css);const n=(s=t.props)==null?void 0:s.children;return n!=null&&(r.children=bn(t.props.children).map(i=>gn(i))),{type:e,props:r}},bn=t=>{if(t==null)return[];if(typeof t=="object"&&"type"in t&&t.type===b.Fragment)return bn(t.props.children);if(!Array.isArray(t)||typeof t=="object"&&"$"in t)return[t];const e=t.flat(1/0),r=[];for(let n=0,s=e.length;n"u"?b.useEffect:b.useLayoutEffect;function vn(t,e,r){if(!t||e(t))return t;let n=r?t.return:t.child;for(;n;){const s=vn(n,e,r);if(s)return s;n=r?null:n.sibling}}function Is(){const t=b.useRef();return b.useState(()=>{const e=Function.prototype.bind;Function.prototype.bind=function(r,n){return r===null&&typeof(n==null?void 0:n.type)=="function"&&(t.current=n,Function.prototype.bind=e),e.apply(this,arguments)}}),t.current}function Fa(t){const e=Is(),r=b.useRef({el:null,depth:0});return Bs(()=>{var n;r.current.el=(n=vn(e,s=>(r.current.depth++,typeof s.type=="string"&&(t===void 0||s.type===t)),!0))==null?void 0:n.stateNode},[e]),r}function Ua(){const t=Is(),e=b.useRef({el:null,depth:0});return Bs(()=>{var r;e.current.el=(r=vn(t,n=>{var s;return e.current.depth++,((s=n.stateNode)==null?void 0:s.containerInfo)!=null},!0))==null?void 0:r.stateNode.containerInfo},[t]),e}const Fs=(t,e={})=>{const r=(e==null?void 0:e.experimental_noSlot)??ja.noSlot;let n=e==null?void 0:e.block;const s=e!=null&&e.svg?Ds:Dr;t&&(n=Ls(t,gn,e==null?void 0:e.shouldUpdate,e==null?void 0:e.svg));const i=(o,a)=>{var I,j;const l=Ua(),f=Fa(),h=o._hmr,p=b.useRef(null),d=b.useRef(null),y=b.useRef([]);o=Ia(o,a,y.current),(I=d.current)==null||I.call(d,o);const w=b.useCallback(()=>{var K,oe,D;if(!p.current&&!r)return;const $=n(o,o.key);return h&&((K=p.current)!=null&&K.textContent)&&(p.current.textContent=""),r&&(p.current=((oe=f.current)==null?void 0:oe.el)??((D=l.current)==null?void 0:D.el),(o.scoped||f.current&&l.current&&f.current.depth>l.current.depth)&&(p.current=l.current.el),p.current.childNodes.length&&console.error(new Error(`\`experimental_options.noSlot\` does not support having siblings at the moment. The block element should be the only child of the \`${vs.call(p.current).outerHTML}\` element. -To avoid this error, \`experimental_options.noSlot\` should be false`))),(d.current===null||h)&&(kt.call(M,p.current,null),d.current=X=>{La(M,n(X,X.key,e==null?void 0:e.shouldUpdate))}),()=>{jr.call(M)}},[]),_=b.useMemo(()=>r?null:b.createElement((e==null?void 0:e.as)??s,{ref:p}),[]),g=y.current.length,C=new Array(g);for(let M=0;M{const o=b.useRef(null),[a]=b.useState(()=>({current:Array(t.length)})),l=b.useRef(null),f=b.useRef({each:null,children:null,mounted:!1}),[,h]=b.useState(!1);if(l.current&&(t!==f.current.each||!r)){const y=qs(t,e,f,a,r);Ms.call(l.current,Rs(y))}const p=n?Ds:Dr,d=b.createElement(b.Fragment,null,b.createElement(s??p,{...i,ref:o}),...a.current.map(y=>y.portal));return b.useEffect(()=>{if(!o.current||l.current||f.current.mounted)return;const y=qs(t,e,f,a,r);l.current=Rs(y),Tr.call(Re,d)||Rr.call(Re,d,l.current),$s.call(l.current,o.current),f.current.mounted=!0,h(!0)},[o.current]),d},Ha=b.memo;Ha(Ua);const qs=(t,e,r,n,s)=>{var a;const i=Array(t.length),o=r.current;for(let l=0,f=t.length;ly==null?void 0:y.scope),d=(y,w,_)=>p({scope:mn(b.createElement(h.type,y),!1,w.current,_)},h.key?String(h.key):void 0);Rr.call(Re,h.type,d),o.block=d,i[l]=d(h.props,n,l)}return o.each=t,o.children=i,i};function Va(t,e){return t===e||t!==t&&e!==e}function Qa(t,e){for(const r in t)if(!Va(t[r],e[r]))return!0;return!1}function Br(t,{portals:e,...r}){const n=`CompiledBlock(Inner(${r.name}))`,s=Fs(a=>t(a),{...r,scoped:void 0,name:n,shouldUpdate:Qa}),i=(e==null?void 0:e.length)||0,o=e&&i>0?a=>{const l=b.useContext(Ba),[f]=b.useState(()=>[]),h={...a,scoped:l};for(let d=0;db.createElement(s,a);return r.name&&(o.displayName=`Million(CompiledBlock(Outer(${r.name})))`),o}typeof window<"u"&&(window.__MILLION_DATA__={version:"3.0.6"});const tr={MESSAGE:"message",TYPING:"typing",STOP_TYPING:"stop-typing",AGENT_MESSAGE:"agent-message"},Us="user-bot-id",wn="https://api.dialoguebot.tech";console.log("API_URL",wn);var Xe={},re={},fe={};Object.defineProperty(fe,"__esModule",{value:!0}),fe.output=fe.exists=fe.hash=fe.bytes=fe.bool=fe.number=fe.isBytes=void 0;function Ir(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}fe.number=Ir;function Hs(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}fe.bool=Hs;function Vs(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}fe.isBytes=Vs;function xn(t,...e){if(!Vs(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}fe.bytes=xn;function Qs(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ir(t.outputLen),Ir(t.blockLen)}fe.hash=Qs;function zs(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}fe.exists=zs;function Ws(t,e){xn(t);const r=e.outputLen;if(t.length>En&Fr)}:{h:Number(t>>En&Fr)|0,l:Number(t&Fr)|0}}I.fromBig=_n;function Ys(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let s=0;sBigInt(t>>>0)<>>0);I.toBig=Ks;const Gs=(t,e,r)=>t>>>r;I.shrSH=Gs;const Xs=(t,e,r)=>t<<32-r|e>>>r;I.shrSL=Xs;const Js=(t,e,r)=>t>>>r|e<<32-r;I.rotrSH=Js;const Zs=(t,e,r)=>t<<32-r|e>>>r;I.rotrSL=Zs;const ei=(t,e,r)=>t<<64-r|e>>>r-32;I.rotrBH=ei;const ti=(t,e,r)=>t>>>r-32|e<<64-r;I.rotrBL=ti;const ri=(t,e)=>e;I.rotr32H=ri;const ni=(t,e)=>t;I.rotr32L=ni;const si=(t,e,r)=>t<>>32-r;I.rotlSH=si;const ii=(t,e,r)=>e<>>32-r;I.rotlSL=ii;const oi=(t,e,r)=>e<>>64-r;I.rotlBH=oi;const ai=(t,e,r)=>t<>>64-r;I.rotlBL=ai;function ci(t,e,r,n){const s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}I.add=ci;const li=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);I.add3L=li;const ui=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;I.add3H=ui;const hi=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);I.add4L=hi;const fi=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0;I.add4H=fi;const di=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0);I.add5L=di;const pi=(t,e,r,n,s,i)=>e+r+n+s+i+(t/2**32|0)|0;I.add5H=pi;const Wa={fromBig:_n,split:Ys,toBig:Ks,shrSH:Gs,shrSL:Xs,rotrSH:Js,rotrSL:Zs,rotrBH:ei,rotrBL:ti,rotr32H:ri,rotr32L:ni,rotlSH:si,rotlSL:ii,rotlBH:oi,rotlBL:ai,add:ci,add3L:li,add3H:ui,add4L:hi,add4H:fi,add5H:pi,add5L:di};I.default=Wa;var yi={},qr={};Object.defineProperty(qr,"__esModule",{value:!0}),qr.crypto=void 0,qr.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const e=qr,r=fe;function n(m){return m instanceof Uint8Array||m!=null&&typeof m=="object"&&m.constructor.name==="Uint8Array"}t.isBytes=n;const s=m=>new Uint8Array(m.buffer,m.byteOffset,m.byteLength);t.u8=s;const i=m=>new Uint32Array(m.buffer,m.byteOffset,Math.floor(m.byteLength/4));t.u32=i;const o=m=>new DataView(m.buffer,m.byteOffset,m.byteLength);t.createView=o;const a=(m,R)=>m<<32-R|m>>>R;t.rotr=a;const l=(m,R)=>m<>>32-R>>>0;t.rotl=l,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const f=m=>m<<24&4278190080|m<<8&16711680|m>>>8&65280|m>>>24&255;t.byteSwap=f,t.byteSwapIfBE=t.isLE?m=>m:m=>(0,t.byteSwap)(m);function h(m){for(let R=0;RR.toString(16).padStart(2,"0"));function d(m){(0,r.bytes)(m);let R="";for(let S=0;S=y._0&&m<=y._9)return m-y._0;if(m>=y._A&&m<=y._F)return m-(y._A-10);if(m>=y._a&&m<=y._f)return m-(y._a-10)}function _(m){if(typeof m!="string")throw new Error("hex string expected, got "+typeof m);const R=m.length,S=R/2;if(R%2)throw new Error("padded hex string expected, got unpadded hex of length "+R);const v=new Uint8Array(S);for(let x=0,O=0;x{};t.nextTick=g;async function C(m,R,S){let v=Date.now();for(let x=0;x=0&&Om().update($(v)).digest(),S=m();return R.outputLen=S.outputLen,R.blockLen=S.blockLen,R.create=()=>m(),R}t.wrapConstructor=F;function X(m){const R=(v,x)=>m(x).update($(v)).digest(),S=m({});return R.outputLen=S.outputLen,R.blockLen=S.blockLen,R.create=v=>m(v),R}t.wrapConstructorWithOpts=X;function J(m){const R=(v,x)=>m(x).update($(v)).digest(),S=m({});return R.outputLen=S.outputLen,R.blockLen=S.blockLen,R.create=v=>m(v),R}t.wrapXOFConstructorWithOpts=J;function B(m=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(m));throw new Error("crypto.getRandomValues must be defined")}t.randomBytes=B}(yi),Object.defineProperty(re,"__esModule",{value:!0}),re.shake256=re.shake128=re.keccak_512=re.keccak_384=re.keccak_256=re.keccak_224=re.sha3_512=re.sha3_384=re.sha3_256=re.sha3_224=re.Keccak=re.keccakP=void 0;const Ot=fe,rr=I,Qe=yi,mi=[],gi=[],bi=[],Ya=BigInt(0),nr=BigInt(1),Ka=BigInt(2),Ga=BigInt(7),Xa=BigInt(256),Ja=BigInt(113);for(let t=0,e=nr,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],mi.push(2*(5*n+r)),gi.push((t+1)*(t+2)/2%64);let s=Ya;for(let i=0;i<7;i++)e=(e<>Ga)*Ja)%Xa,e&Ka&&(s^=nr<<(nr<r>32?(0,rr.rotlBH)(t,e,r):(0,rr.rotlSH)(t,e,r),wi=(t,e,r)=>r>32?(0,rr.rotlBL)(t,e,r):(0,rr.rotlSL)(t,e,r);function xi(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,f=r[l],h=r[l+1],p=vi(f,h,1)^r[a],d=wi(f,h,1)^r[a+1];for(let y=0;y<50;y+=10)t[o+y]^=p,t[o+y+1]^=d}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=gi[o],l=vi(s,i,a),f=wi(s,i,a),h=mi[o];s=t[h],i=t[h+1],t[h]=l,t[h+1]=f}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Za[n],t[1]^=ec[n]}r.fill(0)}re.keccakP=xi;class sr extends Qe.Hash{constructor(e,r,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ot.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Qe.u32)(this.state)}keccak(){Qe.isLE||(0,Qe.byteSwap32)(this.state32),xi(this.state32,this.rounds),Qe.isLE||(0,Qe.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,Ot.exists)(this);const{blockLen:r,state:n}=this;e=(0,Qe.toBytes)(e);const s=e.length;for(let i=0;i=n&&this.keccak();const o=Math.min(n-this.posOut,i-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Ot.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Ot.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new sr(r,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}re.Keccak=sr;const Je=(t,e,r)=>(0,Qe.wrapConstructor)(()=>new sr(e,t,r));re.sha3_224=Je(6,144,224/8),re.sha3_256=Je(6,136,256/8),re.sha3_384=Je(6,104,384/8),re.sha3_512=Je(6,72,512/8),re.keccak_224=Je(1,144,224/8),re.keccak_256=Je(1,136,256/8),re.keccak_384=Je(1,104,384/8),re.keccak_512=Je(1,72,512/8);const Ei=(t,e,r)=>(0,Qe.wrapXOFConstructorWithOpts)((n={})=>new sr(e,t,n.dkLen===void 0?r:n.dkLen,!0));re.shake128=Ei(31,168,128/8),re.shake256=Ei(31,136,256/8);const{sha3_512:tc}=re,_i=24,ir=32,Sn=(t=4,e=Math.random)=>{let r="";for(;r.lengthSi(tc(t)).toString(36).slice(1),Ci=Array.from({length:26},(t,e)=>String.fromCharCode(e+97)),rc=t=>Ci[Math.floor(t()*Ci.length)],Oi=({globalObj:t=typeof lt<"u"?lt:typeof window<"u"?window:{},random:e=Math.random}={})=>{const r=Object.keys(t).toString(),n=r.length?r+Sn(ir,e):Sn(ir,e);return ki(n).substring(0,ir)},Ai=t=>()=>t++,nc=476782367,Ti=({random:t=Math.random,counter:e=Ai(Math.floor(t()*nc)),length:r=_i,fingerprint:n=Oi({random:t})}={})=>function(){const i=rc(t),o=Date.now().toString(36),a=e().toString(36),l=Sn(r,t),f=`${o+l+a+n}`;return`${i+ki(f).substring(1,r)}`},sc=Ti(),ic=(t,{minLength:e=2,maxLength:r=ir}={})=>{const n=t.length,s=/^[0-9a-z]+$/;try{if(typeof t=="string"&&n>=e&&n<=r&&s.test(t))return!0}finally{}return!1};Xe.getConstants=()=>({defaultLength:_i,bigLength:ir}),Xe.init=Ti,Xe.createId=sc,Xe.bufToBigInt=Si,Xe.createCounter=Ai,Xe.createFingerprint=Oi,Xe.isCuid=ic;const{createId:oc,init:ch,getConstants:lh,isCuid:uh}=Xe;var ac=oc;const Se=()=>{const t=ac(),e=localStorage.getItem(Us);return e||(localStorage.setItem(Us,t),t)},Ri=(t,e)=>{const r=e||Se();return`${t}_${r}`},Pi=t=>{var e;(e=window.open(t,"_blank"))==null||e.focus()},kn=t=>{t=t.replace(/^#/,"");const e=parseInt(t,16);let r=e>>16&255,n=e>>8&255,s=e&255;r/=255,n/=255,s/=255;const i=Math.max(r,n,s),o=Math.min(r,n,s);let a=0,l;const f=(i+o)/2;if(i===o)a=l=0;else{const h=i-o;switch(l=f>.5?h/(2-i-o):h/(i+o),i){case r:a=(n-s)/h+(n{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},At=typeof window>"u"||"Deno"in globalThis;function ke(){}function cc(t,e){return typeof t=="function"?t(e):t}function Cn(t){return typeof t=="number"&&t>=0&&t!==1/0}function $i(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mi(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==On(o,e.options))return!1}else if(!cr(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Li(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(ar(e.options.mutationKey)!==ar(i))return!1}else if(!cr(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function On(t,e){return((e==null?void 0:e.queryKeyHashFn)||ar)(t)}function ar(t){return JSON.stringify(t,(e,r)=>Tn(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function cr(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!cr(t[r],e[r])):!1}function Ni(t,e){if(t===e)return t;const r=ji(t)&&ji(e);if(r||Tn(t)&&Tn(e)){const n=r?t:Object.keys(t),s=n.length,i=r?e:Object.keys(e),o=i.length,a=r?[]:{};let l=0;for(let f=0;f{setTimeout(e,t)})}function Rn(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Ni(t,e):e}function uc(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function hc(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var lr=Symbol(),fc=(No=class extends or{constructor(){super();N(this,yt,void 0);N(this,tt,void 0);N(this,Pt,void 0);P(this,Pt,e=>{if(!At&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){u(this,tt)||this.setEventListener(u(this,Pt))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,tt))==null||e.call(this),P(this,tt,void 0))}setEventListener(e){var r;P(this,Pt,e),(r=u(this,tt))==null||r.call(this),P(this,tt,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){u(this,yt)!==e&&(P(this,yt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof u(this,yt)=="boolean"?u(this,yt):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},yt=new WeakMap,tt=new WeakMap,Pt=new WeakMap,No),Pn=new fc,dc=(jo=class extends or{constructor(){super();N(this,$t,!0);N(this,rt,void 0);N(this,Mt,void 0);P(this,Mt,e=>{if(!At&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){u(this,rt)||this.setEventListener(u(this,Mt))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,rt))==null||e.call(this),P(this,rt,void 0))}setEventListener(e){var r;P(this,Mt,e),(r=u(this,rt))==null||r.call(this),P(this,rt,e(this.setOnline.bind(this)))}setOnline(e){u(this,$t)!==e&&(P(this,$t,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return u(this,$t)}},$t=new WeakMap,rt=new WeakMap,Mt=new WeakMap,jo),Ur=new dc;function pc(t){return Math.min(1e3*2**t,3e4)}function $n(t){return(t??"online")==="online"?Ur.isOnline():!0}var Bi=class{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Mn(t){return t instanceof Bi}function Ii(t){let e=!1,r=0,n=!1,s,i,o;const a=new Promise((g,C)=>{i=g,o=C}),l=g=>{var C;n||(y(new Bi(g)),(C=t.abort)==null||C.call(t))},f=()=>{e=!0},h=()=>{e=!1},p=()=>!Pn.isFocused()||t.networkMode!=="always"&&!Ur.isOnline(),d=g=>{var C;n||(n=!0,(C=t.onSuccess)==null||C.call(t,g),s==null||s(),i(g))},y=g=>{var C;n||(n=!0,(C=t.onError)==null||C.call(t,g),s==null||s(),o(g))},w=()=>new Promise(g=>{var C;s=L=>{const $=n||!p();return $&&g(L),$},(C=t.onPause)==null||C.call(t)}).then(()=>{var g;s=void 0,n||(g=t.onContinue)==null||g.call(t)}),_=()=>{if(n)return;let g;try{g=t.fn()}catch(C){g=Promise.reject(C)}Promise.resolve(g).then(d).catch(C=>{var K;if(n)return;const L=t.retry??(At?0:3),$=t.retryDelay??pc,H=typeof $=="function"?$(r,C):$,M=L===!0||typeof L=="number"&&r{if(p())return w()}).then(()=>{e?y(C):_()})})};return $n(t.networkMode)?_():w().then(_),{promise:a,cancel:l,continue:()=>(s==null?void 0:s())?a:Promise.resolve(),cancelRetry:f,continueRetry:h}}function yc(){let t=[],e=0,r=d=>{d()},n=d=>{d()},s=d=>setTimeout(d,0);const i=d=>{s=d},o=d=>{let y;e++;try{y=d()}finally{e--,e||f()}return y},a=d=>{e?t.push(d):s(()=>{r(d)})},l=d=>(...y)=>{a(()=>{d(...y)})},f=()=>{const d=t;t=[],d.length&&s(()=>{n(()=>{d.forEach(y=>{r(y)})})})};return{batch:o,batchCalls:l,schedule:a,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{n=d},setScheduler:i}}var ye=yc(),Fi=(Do=class{constructor(){N(this,mt,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cn(this.gcTime)&&P(this,mt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(At?1/0:5*60*1e3))}clearGcTimeout(){u(this,mt)&&(clearTimeout(u(this,mt)),P(this,mt,void 0))}},mt=new WeakMap,Do),mc=(Bo=class extends Fi{constructor(e){super();N(this,$e);N(this,Lt,void 0);N(this,Nt,void 0);N(this,Oe,void 0);N(this,be,void 0);N(this,de,void 0);N(this,pr,void 0);N(this,gt,void 0);P(this,gt,!1),P(this,pr,e.defaultOptions),this.setOptions(e.options),P(this,de,[]),P(this,Oe,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,P(this,Lt,e.state||gc(this.options)),this.state=u(this,Lt),this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...u(this,pr),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!u(this,de).length&&this.state.fetchStatus==="idle"&&u(this,Oe).remove(this)}setData(e,r){const n=Rn(this.state.data,e,this.options);return W(this,$e,Ye).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){W(this,$e,Ye).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,s;const r=(n=u(this,be))==null?void 0:n.promise;return(s=u(this,be))==null||s.cancel(e),r?r.then(ke).catch(ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(u(this,Lt))}isActive(){return u(this,de).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?u(this,de).some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!$i(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=u(this,de).find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=u(this,be))==null||r.continue()}onOnline(){var r;const e=u(this,de).find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=u(this,be))==null||r.continue()}addObserver(e){u(this,de).includes(e)||(u(this,de).push(e),this.clearGcTimeout(),u(this,Oe).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){u(this,de).includes(e)&&(P(this,de,u(this,de).filter(r=>r!==e)),u(this,de).length||(u(this,be)&&(u(this,gt)?u(this,be).cancel({revert:!0}):u(this,be).cancelRetry()),this.scheduleGc()),u(this,Oe).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return u(this,de).length}invalidate(){this.state.isInvalidated||W(this,$e,Ye).call(this,{type:"invalidate"})}fetch(e,r){var f,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(u(this,be))return u(this,be).continueRetry(),u(this,be).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=u(this,de).find(y=>y.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s={queryKey:this.queryKey,meta:this.meta},i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(P(this,gt,!0),n.signal)})};i(s);const o=()=>(process.env.NODE_ENV!=="production"&&this.options.queryFn===lr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'`),!this.options.queryFn||this.options.queryFn===lr?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(P(this,gt,!1),this.options.persister?this.options.persister(this.options.queryFn,s,this):this.options.queryFn(s))),a={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(a),(f=this.options.behavior)==null||f.onFetch(a,this),P(this,Nt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&W(this,$e,Ye).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=d=>{var y,w,_,g;Mn(d)&&d.silent||W(this,$e,Ye).call(this,{type:"error",error:d}),Mn(d)||((w=(y=u(this,Oe).config).onError)==null||w.call(y,d,this),(g=(_=u(this,Oe).config).onSettled)==null||g.call(_,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return P(this,be,Ii({fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:d=>{var y,w,_,g;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(d),(w=(y=u(this,Oe).config).onSuccess)==null||w.call(y,d,this),(g=(_=u(this,Oe).config).onSettled)==null||g.call(_,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(d,y)=>{W(this,$e,Ye).call(this,{type:"failed",failureCount:d,error:y})},onPause:()=>{W(this,$e,Ye).call(this,{type:"pause"})},onContinue:()=>{W(this,$e,Ye).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),u(this,be).promise}},Lt=new WeakMap,Nt=new WeakMap,Oe=new WeakMap,be=new WeakMap,de=new WeakMap,pr=new WeakMap,gt=new WeakMap,$e=new WeakSet,Ye=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...qi(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Mn(s)&&s.revert&&u(this,Nt)?{...u(this,Nt),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),ye.batch(()=>{u(this,de).forEach(n=>{n.onQueryUpdate()}),u(this,Oe).notify({query:this,type:"updated",action:e})})},Bo);function qi(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$n(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function gc(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var bc=(Io=class extends or{constructor(e={}){super();N(this,De,void 0);this.config=e,P(this,De,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??On(s,r);let o=this.get(i);return o||(o=new mc({cache:this,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){u(this,De).has(e.queryHash)||(u(this,De).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=u(this,De).get(e.queryHash);r&&(e.destroy(),r===e&&u(this,De).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ye.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return u(this,De).get(e)}getAll(){return[...u(this,De).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Mi(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>Mi(e,n)):r}notify(e){ye.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},De=new WeakMap,Io),vc=(Fo=class extends Fi{constructor(e){super();N(this,Ie);N(this,Be,void 0);N(this,yr,void 0);N(this,_e,void 0);N(this,jt,void 0);this.mutationId=e.mutationId,P(this,yr,e.defaultOptions),P(this,_e,e.mutationCache),P(this,Be,[]),this.state=e.state||wc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...u(this,yr),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){u(this,Be).includes(e)||(u(this,Be).push(e),this.clearGcTimeout(),u(this,_e).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){P(this,Be,u(this,Be).filter(r=>r!==e)),this.scheduleGc(),u(this,_e).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){u(this,Be).length||(this.state.status==="pending"?this.scheduleGc():u(this,_e).remove(this))}continue(){var e;return((e=u(this,jt))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,o,a,l,f,h,p,d,y,w,_,g,C,L,$,H,M,K,ie;const r=()=>(P(this,jt,Ii({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(F,X)=>{W(this,Ie,ct).call(this,{type:"failed",failureCount:F,error:X})},onPause:()=>{W(this,Ie,ct).call(this,{type:"pause"})},onContinue:()=>{W(this,Ie,ct).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),u(this,jt).promise),n=this.state.status==="pending";try{if(!n){W(this,Ie,ct).call(this,{type:"pending",variables:e}),await((i=(s=u(this,_e).config).onMutate)==null?void 0:i.call(s,e,this));const X=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));X!==this.state.context&&W(this,Ie,ct).call(this,{type:"pending",context:X,variables:e})}const F=await r();return await((f=(l=u(this,_e).config).onSuccess)==null?void 0:f.call(l,F,e,this.state.context,this)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,F,e,this.state.context)),await((y=(d=u(this,_e).config).onSettled)==null?void 0:y.call(d,F,null,this.state.variables,this.state.context,this)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,F,null,e,this.state.context)),W(this,Ie,ct).call(this,{type:"success",data:F}),F}catch(F){try{throw await((C=(g=u(this,_e).config).onError)==null?void 0:C.call(g,F,e,this.state.context,this)),await(($=(L=this.options).onError)==null?void 0:$.call(L,F,e,this.state.context)),await((M=(H=u(this,_e).config).onSettled)==null?void 0:M.call(H,void 0,F,this.state.variables,this.state.context,this)),await((ie=(K=this.options).onSettled)==null?void 0:ie.call(K,void 0,F,e,this.state.context)),F}finally{W(this,Ie,ct).call(this,{type:"error",error:F})}}}},Be=new WeakMap,yr=new WeakMap,_e=new WeakMap,jt=new WeakMap,Ie=new WeakSet,ct=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!$n(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ye.batch(()=>{u(this,Be).forEach(n=>{n.onMutationUpdate(e)}),u(this,_e).notify({mutation:this,type:"updated",action:e})})},Fo);function wc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xc=(qo=class extends or{constructor(e={}){super();N(this,Ae,void 0);N(this,mr,void 0);N(this,bt,void 0);this.config=e,P(this,Ae,[]),P(this,mr,0)}build(e,r,n){const s=new vc({mutationCache:this,mutationId:++cn(this,mr)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){u(this,Ae).push(e),this.notify({type:"added",mutation:e})}remove(e){P(this,Ae,u(this,Ae).filter(r=>r!==e)),this.notify({type:"removed",mutation:e})}clear(){ye.batch(()=>{u(this,Ae).forEach(e=>{this.remove(e)})})}getAll(){return u(this,Ae)}find(e){const r={exact:!0,...e};return u(this,Ae).find(n=>Li(r,n))}findAll(e={}){return u(this,Ae).filter(r=>Li(e,r))}notify(e){ye.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){return P(this,bt,(u(this,bt)??Promise.resolve()).then(()=>{const e=u(this,Ae).filter(r=>r.state.isPaused);return ye.batch(()=>e.reduce((r,n)=>r.then(()=>n.continue().catch(ke)),Promise.resolve()))}).then(()=>{P(this,bt,void 0)})),u(this,bt)}},Ae=new WeakMap,mr=new WeakMap,bt=new WeakMap,qo);function Ec(t){return{onFetch:(e,r)=>{const n=async()=>{var w,_,g,C,L;const s=e.options,i=(g=(_=(w=e.fetchOptions)==null?void 0:w.meta)==null?void 0:_.fetchMore)==null?void 0:g.direction,o=((C=e.state.data)==null?void 0:C.pages)||[],a=((L=e.state.data)==null?void 0:L.pageParams)||[],l={pages:[],pageParams:[]};let f=!1;const h=$=>{Object.defineProperty($,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},p=e.options.queryFn&&e.options.queryFn!==lr?e.options.queryFn:()=>(process.env.NODE_ENV!=="production"&&e.options.queryFn===lr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.options.queryHash}'`),Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),d=async($,H,M)=>{if(f)return Promise.reject();if(H==null&&$.pages.length)return Promise.resolve($);const K={queryKey:e.queryKey,pageParam:H,direction:M?"backward":"forward",meta:e.options.meta};h(K);const ie=await p(K),{maxPages:F}=e.options,X=M?hc:uc;return{pages:X($.pages,ie,F),pageParams:X($.pageParams,H,F)}};let y;if(i&&o.length){const $=i==="backward",H=$?_c:Ui,M={pages:o,pageParams:a},K=H(s,M);y=await d(M,K,$)}else{y=await d(l,a[0]??s.initialPageParam);const $=t??o.length;for(let H=1;H<$;H++){const M=Ui(s,y);y=await d(y,M)}}return y};e.options.persister?e.fetchFn=()=>{var s,i;return(i=(s=e.options).persister)==null?void 0:i.call(s,n,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=n}}}function Ui(t,{pages:e,pageParams:r}){const n=e.length-1;return t.getNextPageParam(e[n],e,r[n],r)}function _c(t,{pages:e,pageParams:r}){var n;return(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r)}var Sc=(Uo=class{constructor(t={}){N(this,oe,void 0);N(this,nt,void 0);N(this,st,void 0);N(this,Dt,void 0);N(this,Bt,void 0);N(this,it,void 0);N(this,It,void 0);N(this,Ft,void 0);P(this,oe,t.queryCache||new bc),P(this,nt,t.mutationCache||new xc),P(this,st,t.defaultOptions||{}),P(this,Dt,new Map),P(this,Bt,new Map),P(this,it,0)}mount(){cn(this,it)._++,u(this,it)===1&&(P(this,It,Pn.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,oe).onFocus())})),P(this,Ft,Ur.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,oe).onOnline())})))}unmount(){var t,e;cn(this,it)._--,u(this,it)===0&&((t=u(this,It))==null||t.call(this),P(this,It,void 0),(e=u(this,Ft))==null||e.call(this),P(this,Ft,void 0))}isFetching(t){return u(this,oe).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return u(this,nt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=u(this,oe).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const r=this.defaultQueryOptions(t),n=u(this,oe).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(r.staleTime)&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return u(this,oe).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=u(this,oe).get(n.queryHash),i=s==null?void 0:s.state.data,o=cc(e,i);if(o!==void 0)return u(this,oe).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return ye.batch(()=>u(this,oe).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=u(this,oe).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=u(this,oe);ye.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=u(this,oe),n={type:"active",...t};return ye.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=ye.batch(()=>u(this,oe).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(ke).catch(ke)}invalidateQueries(t={},e={}){return ye.batch(()=>{if(u(this,oe).findAll(t).forEach(n=>{n.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t={},e){const r={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},n=ye.batch(()=>u(this,oe).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(ke)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(ke)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=u(this,oe).build(this,e);return r.isStaleByTime(e.staleTime)?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ke).catch(ke)}fetchInfiniteQuery(t){return t.behavior=Ec(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ke).catch(ke)}resumePausedMutations(){return Ur.isOnline()?u(this,nt).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,oe)}getMutationCache(){return u(this,nt)}getDefaultOptions(){return u(this,st)}setDefaultOptions(t){P(this,st,t)}setQueryDefaults(t,e){u(this,Dt).set(ar(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...u(this,Dt).values()];let r={};return e.forEach(n=>{cr(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){u(this,Bt).set(ar(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...u(this,Bt).values()];let r={};return e.forEach(n=>{cr(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...u(this,st).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=On(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===lr&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...u(this,st).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){u(this,oe).clear(),u(this,nt).clear()}},oe=new WeakMap,nt=new WeakMap,st=new WeakMap,Dt=new WeakMap,Bt=new WeakMap,it=new WeakMap,It=new WeakMap,Ft=new WeakMap,Uo),kc=(Ho=class extends or{constructor(e,r){super();N(this,Et);N(this,vr);N(this,wr);N(this,xr);N(this,Er);N(this,_r);N(this,Sr);N(this,kr);N(this,nn);N(this,xe,void 0);N(this,ne,void 0);N(this,gr,void 0);N(this,ve,void 0);N(this,vt,void 0);N(this,qt,void 0);N(this,Fe,void 0);N(this,br,void 0);N(this,Ut,void 0);N(this,Ht,void 0);N(this,wt,void 0);N(this,xt,void 0);N(this,ot,void 0);N(this,Vt,new Set);this.options=r,P(this,xe,e),P(this,Fe,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(u(this,ne).addObserver(this),Hi(u(this,ne),this.options)?W(this,Et,Or).call(this):this.updateResult(),W(this,Er,cs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ln(u(this,ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ln(u(this,ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,W(this,_r,ls).call(this),W(this,Sr,us).call(this),u(this,ne).removeObserver(this)}setOptions(e,r){const n=this.options,s=u(this,ne);if(this.options=u(this,xe).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");W(this,kr,hs).call(this),u(this,ne).setOptions(this.options),n._defaulted&&!An(this.options,n)&&u(this,xe).getQueryCache().notify({type:"observerOptionsUpdated",query:u(this,ne),observer:this});const i=this.hasListeners();i&&Vi(u(this,ne),s,this.options,n)&&W(this,Et,Or).call(this),this.updateResult(r),i&&(u(this,ne)!==s||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&W(this,vr,is).call(this);const o=W(this,wr,os).call(this);i&&(u(this,ne)!==s||this.options.enabled!==n.enabled||o!==u(this,ot))&&W(this,xr,as).call(this,o)}getOptimisticResult(e){const r=u(this,xe).getQueryCache().build(u(this,xe),e),n=this.createResult(r,e);return Oc(this,n)&&(P(this,ve,n),P(this,qt,this.options),P(this,vt,u(this,ne).state)),n}getCurrentResult(){return u(this,ve)}trackResult(e,r){const n={};return Object.keys(e).forEach(s=>{Object.defineProperty(n,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),r==null||r(s),e[s])})}),n}trackProp(e){u(this,Vt).add(e)}getCurrentQuery(){return u(this,ne)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=u(this,xe).defaultQueryOptions(e),n=u(this,xe).getQueryCache().build(u(this,xe),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){return W(this,Et,Or).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),u(this,ve)))}createResult(e,r){var ie;const n=u(this,ne),s=this.options,i=u(this,ve),o=u(this,vt),a=u(this,qt),f=e!==n?e.state:u(this,gr),{state:h}=e;let p={...h},d=!1,y;if(r._optimisticResults){const F=this.hasListeners(),X=!F&&Hi(e,r),J=F&&Vi(e,n,r,s);(X||J)&&(p={...p,...qi(h.data,e.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:g}=p;if(r.select&&p.data!==void 0)if(i&&p.data===(o==null?void 0:o.data)&&r.select===u(this,br))y=u(this,Ut);else try{P(this,br,r.select),y=r.select(p.data),y=Rn(i==null?void 0:i.data,y,r),P(this,Ut,y),P(this,Fe,null)}catch(F){P(this,Fe,F)}else y=p.data;if(r.placeholderData!==void 0&&y===void 0&&g==="pending"){let F;if(i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))F=i.data;else if(F=typeof r.placeholderData=="function"?r.placeholderData((ie=u(this,Ht))==null?void 0:ie.state.data,u(this,Ht)):r.placeholderData,r.select&&F!==void 0)try{F=r.select(F),P(this,Fe,null)}catch(X){P(this,Fe,X)}F!==void 0&&(g="success",y=Rn(i==null?void 0:i.data,F,r),d=!0)}u(this,Fe)&&(w=u(this,Fe),y=u(this,Ut),_=Date.now(),g="error");const C=p.fetchStatus==="fetching",L=g==="pending",$=g==="error",H=L&&C,M=y!==void 0;return{status:g,fetchStatus:p.fetchStatus,isPending:L,isSuccess:g==="success",isError:$,isInitialLoading:H,isLoading:H,data:y,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!L,isLoadingError:$&&!M,isPaused:p.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:$&&M,isStale:Nn(e,r),refetch:this.refetch}}updateResult(e){const r=u(this,ve),n=this.createResult(u(this,ne),this.options);if(P(this,vt,u(this,ne).state),P(this,qt,this.options),u(this,vt).data!==void 0&&P(this,Ht,u(this,ne)),An(n,r))return;P(this,ve,n);const s={},i=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!u(this,Vt).size)return!0;const l=new Set(a??u(this,Vt));return this.options.throwOnError&&l.add("error"),Object.keys(u(this,ve)).some(f=>{const h=f;return u(this,ve)[h]!==r[h]&&l.has(h)})};(e==null?void 0:e.listeners)!==!1&&i()&&(s.listeners=!0),W(this,nn,na).call(this,{...s,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&W(this,Er,cs).call(this)}},xe=new WeakMap,ne=new WeakMap,gr=new WeakMap,ve=new WeakMap,vt=new WeakMap,qt=new WeakMap,Fe=new WeakMap,br=new WeakMap,Ut=new WeakMap,Ht=new WeakMap,wt=new WeakMap,xt=new WeakMap,ot=new WeakMap,Vt=new WeakMap,Et=new WeakSet,Or=function(e){W(this,kr,hs).call(this);let r=u(this,ne).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(ke)),r},vr=new WeakSet,is=function(){if(W(this,_r,ls).call(this),At||u(this,ve).isStale||!Cn(this.options.staleTime))return;const r=$i(u(this,ve).dataUpdatedAt,this.options.staleTime)+1;P(this,wt,setTimeout(()=>{u(this,ve).isStale||this.updateResult()},r))},wr=new WeakSet,os=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(u(this,ne)):this.options.refetchInterval)??!1},xr=new WeakSet,as=function(e){W(this,Sr,us).call(this),P(this,ot,e),!(At||this.options.enabled===!1||!Cn(u(this,ot))||u(this,ot)===0)&&P(this,xt,setInterval(()=>{(this.options.refetchIntervalInBackground||Pn.isFocused())&&W(this,Et,Or).call(this)},u(this,ot)))},Er=new WeakSet,cs=function(){W(this,vr,is).call(this),W(this,xr,as).call(this,W(this,wr,os).call(this))},_r=new WeakSet,ls=function(){u(this,wt)&&(clearTimeout(u(this,wt)),P(this,wt,void 0))},Sr=new WeakSet,us=function(){u(this,xt)&&(clearInterval(u(this,xt)),P(this,xt,void 0))},kr=new WeakSet,hs=function(){const e=u(this,xe).getQueryCache().build(u(this,xe),this.options);if(e===u(this,ne))return;const r=u(this,ne);P(this,ne,e),P(this,gr,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},nn=new WeakSet,na=function(e){ye.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(u(this,ve))}),u(this,xe).getQueryCache().notify({query:u(this,ne),type:"observerResultsUpdated"})})},Ho);function Cc(t,e){return e.enabled!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Hi(t,e){return Cc(t,e)||t.state.data!==void 0&&Ln(t,e,e.refetchOnMount)}function Ln(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Nn(t,e)}return!1}function Vi(t,e,r,n){return(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&Nn(t,r)}function Nn(t,e){return e.enabled!==!1&&t.isStaleByTime(e.staleTime)}function Oc(t,e){return!An(t.getCurrentResult(),e)}var Qi=ge.createContext(void 0),zi=t=>{const e=ge.useContext(Qi);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ac=({client:t,children:e})=>(ge.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),T.jsx(Qi.Provider,{value:t,children:e})),Wi=ge.createContext(!1),Tc=()=>ge.useContext(Wi);Wi.Provider;function Rc(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Pc=ge.createContext(Rc()),$c=()=>ge.useContext(Pc);function Mc(t,e){return typeof t=="function"?t(...e):!!t}var Lc=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},Nc=t=>{ge.useEffect(()=>{t.clearReset()},[t])},jc=({result:t,errorResetBoundary:e,throwOnError:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&Mc(r,[t.error,n]),Dc=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Bc=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ic=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Fc(t,e,r){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=zi(r),s=Tc(),i=$c(),o=n.defaultQueryOptions(t);o._optimisticResults=s?"isRestoring":"optimistic",Dc(o),Lc(o,i),Nc(i);const[a]=ge.useState(()=>new e(n,o)),l=a.getOptimisticResult(o);if(ge.useSyncExternalStore(ge.useCallback(f=>{const h=s?()=>{}:a.subscribe(ye.batchCalls(f));return a.updateResult(),h},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ge.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),Bc(o,l))throw Ic(o,a,i);if(jc({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash)}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function Yi(t,e){return Fc(t,kc,e)}const Ne=Object.create(null);Ne.open="0",Ne.close="1",Ne.ping="2",Ne.pong="3",Ne.message="4",Ne.upgrade="5",Ne.noop="6";const Hr=Object.create(null);Object.keys(Ne).forEach(t=>{Hr[Ne[t]]=t});const jn={type:"error",data:"parser error"},Ki=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Gi=typeof ArrayBuffer=="function",Xi=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Dn=({type:t,data:e},r,n)=>Ki&&e instanceof Blob?r?n(e):Ji(e,n):Gi&&(e instanceof ArrayBuffer||Xi(e))?r?n(e):Ji(new Blob([e]),n):n(Ne[t]+(e||"")),Ji=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function Zi(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Bn;function qc(t,e){if(Ki&&t.data instanceof Blob)return t.data.arrayBuffer().then(Zi).then(e);if(Gi&&(t.data instanceof ArrayBuffer||Xi(t.data)))return e(Zi(t.data));Dn(t,!1,r=>{Bn||(Bn=new TextEncoder),e(Bn.encode(r))})}const eo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ur=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let e=t.length*.75,r=t.length,n,s=0,i,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const f=new ArrayBuffer(e),h=new Uint8Array(f);for(n=0;n>4,h[s++]=(o&15)<<4|a>>2,h[s++]=(a&3)<<6|l&63;return f},Hc=typeof ArrayBuffer=="function",In=(t,e)=>{if(typeof t!="string")return{type:"message",data:to(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:Vc(t.substring(1),e)}:Hr[r]?t.length>1?{type:Hr[r],data:t.substring(1)}:{type:Hr[r]}:jn},Vc=(t,e)=>{if(Hc){const r=Uc(t);return to(r,e)}else return{base64:!0,data:t}},to=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ro="",Qc=(t,e)=>{const r=t.length,n=new Array(r);let s=0;t.forEach((i,o)=>{Dn(i,!1,a=>{n[o]=a,++s===r&&e(n.join(ro))})})},zc=(t,e)=>{const r=t.split(ro),n=[];for(let s=0;s{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(r)})}})}let Fn;function Vr(t){return t.reduce((e,r)=>e+r.length,0)}function Qr(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let s=0;sMath.pow(2,21)-1){a.enqueue(jn);break}s=h*Math.pow(2,32)+f.getUint32(4),n=3}else{if(Vr(r)t){a.enqueue(jn);break}}}})}const no=4;function le(t){if(t)return Kc(t)}function Kc(t){for(var e in le.prototype)t[e]=le.prototype[e];return t}le.prototype.on=le.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},le.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},le.prototype.off=le.prototype.removeListener=le.prototype.removeAllListeners=le.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,s=0;s(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const Gc=Ce.setTimeout,Xc=Ce.clearTimeout;function zr(t,e){e.useNativeTimers?(t.setTimeoutFn=Gc.bind(Ce),t.clearTimeoutFn=Xc.bind(Ce)):(t.setTimeoutFn=Ce.setTimeout.bind(Ce),t.clearTimeoutFn=Ce.clearTimeout.bind(Ce))}const Jc=1.33;function Zc(t){return typeof t=="string"?el(t):Math.ceil((t.byteLength||t.size)*Jc)}function el(t){let e=0,r=0;for(let n=0,s=t.length;n=57344?r+=3:(n++,r+=4);return r}function tl(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function rl(t){let e={},r=t.split("&");for(let n=0,s=r.length;n0);return e}function lo(){const t=co(+new Date);return t!==ao?(oo=0,ao=t):t+"."+co(oo++)}for(;Wr{this.readyState="paused",e()};if(this.polling||!this.writable){let n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};zc(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Qc(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=lo()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new je(this.uri(),e)}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class je extends le{constructor(e,r){super(),zr(this,r),this.opts=r,this.method=r.method||"GET",this.uri=e,this.data=r.data!==void 0?r.data:null,this.create()}create(){var e;const r=so(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.opts.xd;const n=this.xhr=new ho(r);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(n)),n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=je.requestsCount++,je.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=ol,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete je.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(je.requestsCount=0,je.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fo);else if(typeof addEventListener=="function"){const t="onpagehide"in Ce?"pagehide":"unload";addEventListener(t,fo,!1)}}function fo(){for(let t in je.requests)je.requests.hasOwnProperty(t)&&je.requests[t].abort()}const Hn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Yr=Ce.WebSocket||Ce.MozWebSocket,po=!0,ll="arraybuffer",yo=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ul extends qn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),r=this.opts.protocols,n=yo?{}:so(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=po&&!yo?r?new Yr(e,r):new Yr(e):new Yr(e,r,n)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r{const o={};try{po&&this.ws.send(i)}catch{}s&&Hn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=lo()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}check(){return!!Yr}}class hl extends qn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const r=Yc(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),s=Wc();s.readable.pipeTo(e.writable),this.writer=s.writable.getWriter();const i=()=>{n.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let r=0;r{s&&Hn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const fl={websocket:ul,webtransport:hl,polling:cl},dl=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,pl=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Vn(t){if(t.length>2e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let s=dl.exec(t||""),i={},o=14;for(;o--;)i[pl[o]]=s[o]||"";return r!=-1&&n!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=yl(i,i.path),i.queryKey=ml(i,i.query),i}function yl(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function ml(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,i){s&&(r[s]=i)}),r}let mo=class Yt extends le{constructor(e,r={}){super(),this.binaryType=ll,this.writeBuffer=[],e&&typeof e=="object"&&(r=e,e=null),e?(e=Vn(e),r.hostname=e.host,r.secure=e.protocol==="https"||e.protocol==="wss",r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=Vn(r.host).host),zr(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=rl(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=no,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new fl[e](n)}open(){let e;if(this.opts.rememberUpgrade&&Yt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",r=>this.onClose("transport close",r))}probe(e){let r=this.createTransport(e),n=!1;Yt.priorWebsocketSuccess=!1;const s=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Yt.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(h(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=r.name,this.emitReserved("upgradeError",d)}}))};function i(){n||(n=!0,h(),r.close(),r=null)}const o=p=>{const d=new Error("probe error: "+p);d.transport=r.name,i(),this.emitReserved("upgradeError",d)};function a(){o("transport closed")}function l(){o("socket closed")}function f(p){r&&p.name!==r.name&&i()}const h=()=>{r.removeListener("open",s),r.removeListener("error",o),r.removeListener("close",a),this.off("close",l),this.off("upgrading",f)};r.once("open",s),r.once("error",o),r.once("close",a),this.once("close",l),this.once("upgrading",f),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onOpen(){if(this.readyState="open",Yt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const r=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n0&&r>this.maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}write(e,r,n){return this.sendPacket("message",e,r,n),this}send(e,r,n){return this.sendPacket("message",e,r,n),this}sendPacket(e,r,n,s){if(typeof r=="function"&&(s=r,r=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const i={type:e,data:r,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}onError(e){Yt.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const r=[];let n=0;const s=e.length;for(;ntypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,go=Object.prototype.toString,wl=typeof Blob=="function"||typeof Blob<"u"&&go.call(Blob)==="[object BlobConstructor]",xl=typeof File=="function"||typeof File<"u"&&go.call(File)==="[object FileConstructor]";function Qn(t){return bl&&(t instanceof ArrayBuffer||vl(t))||wl&&t instanceof Blob||xl&&t instanceof File}function Kr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r=0&&t.num{delete this.acks[e];for(let a=0;a{this.io.clearTimeoutFn(i),r.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...r){return new Promise((n,s)=>{const i=(o,a)=>o?s(o):n(a);i.withError=!0,r.push(i),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...i)=>n!==this._queue[0]?void 0:(s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(s)):(this._queue.shift(),r&&r(null,...i)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Q.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Q.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Q.EVENT:case Q.BINARY_EVENT:this.onevent(e);break;case Q.ACK:case Q.BINARY_ACK:this.onack(e);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...s){n||(n=!0,r.packet({type:Q.ACK,id:e,data:s}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Q.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n0&&t.jitter<=1?t.jitter:0,this.attempts=0}Tt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+r:t-r}return Math.min(t,this.max)|0},Tt.prototype.reset=function(){this.attempts=0},Tt.prototype.setMin=function(t){this.ms=t},Tt.prototype.setMax=function(t){this.max=t},Tt.prototype.setJitter=function(t){this.jitter=t};class Kn extends le{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,zr(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Tt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const s=r.parser||Al;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new mo(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=Pe(r,"open",function(){n.onopen(),e&&e()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=Pe(r,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),r.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Pe(e,"ping",this.onping.bind(this)),Pe(e,"data",this.ondata.bind(this)),Pe(e,"error",this.onerror.bind(this)),Pe(e,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){Hn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new vo(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;ne()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const hr={};function Gr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=gl(t,e.path||"/socket.io"),n=r.source,s=r.id,i=r.path,o=hr[s]&&i in hr[s].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Kn(n,e):(hr[s]||(hr[s]=new Kn(n,e)),l=hr[s]),r.query&&!e.query&&(e.query=r.queryKey),l.socket(r.path,e)}Object.assign(Gr,{Manager:Kn,Socket:vo,io:Gr,connect:Gr});var Rl=typeof lt=="object"&<&<.Object===Object&<,Pl=typeof self=="object"&&self&&self.Object===Object&&self;Rl||Pl||Function("return this")();function $l(t){const e=b.useRef(t);e.current=t,b.useEffect(()=>()=>{e.current()},[])}const wo=b.createContext({}),Ml=({children:t,channelId:e,onEndBot:r,isTest:n=!1,onClose:s,isShowClose:i=!0,isForLiveChat:o,userId:a,customStyles:l,isForPreview:f,isForManager:h,adminId:p})=>{const[d,y]=b.useState(!1),[w,_]=b.useState(h?void 0:l),g=zi(),C=b.useMemo(()=>new URLSearchParams(window.location.search),[]),L=b.useMemo(()=>a||Se(),[a]),$=b.useMemo(()=>e||C.get("channelId")||"",[e,C]),H=b.useRef(Gr(wn,{autoConnect:!1,transports:["websocket"],query:{userId:p?`${L}_${p}`:L}})),{data:M,isLoading:K}=Yi({queryKey:["messages",$,a||Se()],queryFn:async()=>{try{return f?[{isBot:!0,message:"Hello, how can I help you?",createdAt:new Date().toISOString()},{isBot:!1,message:"I want to know more about your product",userId:Se(),createdAt:new Date().toISOString()}]:(await(await fetch(`${URL}/api/conversation-live-chat/${a||Se()}/${$}`)).json()).data}catch{return[]}},initialData:[]}),{data:ie}=Yi({queryKey:["custom-style",$,a||Se()],queryFn:async()=>{try{return(await(await fetch(`${wn}/api/custom-chatbox/${$}`)).json()).data}catch{return}},enabled:!n&&!f&&!h}),F=b.useCallback(({message:B,cb:m,extraData:R,type:S})=>{const v=B.trim();if(v.length===0)return;const x=Ri($,a),O={message:S==="list-button"?R||"":v,userId:p||a||Se(),template:{},createdAt:new Date().toISOString(),isTest:n};H.current.emit(tr.MESSAGE,{message:v,address:x,isTest:n,createdAt:O.createdAt}),g.setQueryData(["messages",$,a||Se()],k=>[...k,O]),m&&m(O)},[$,p,n,g,a]),X=b.useCallback(()=>{window.parent&&window.parent.postMessage({type:"TOGGLE_CHAT"},"*"),s==null||s()},[s]),J=b.useCallback(()=>{f||(H.current.emit(tr.MESSAGE,{type:"event",typeName:"endConversation",address:Ri($,a),isTest:n,message:""}),y(!1),g.setQueryData(["messages",$,a||Se()],()=>[]))},[$,f,n,g,a]);return $l(()=>{H.current.disconnect()}),b.useEffect(()=>{if(f)return;const B=H.current;return B.connect(),B.on(tr.MESSAGE,m=>{var R;((R=m.template)==null?void 0:R.type)==="list-button"?y(!0):y(!1),g.setQueryData(["messages",$,a||Se()],S=>[...S,m].filter(v=>v.userId!=="typing"))}),B.on(tr.TYPING,()=>{g.setQueryData(["messages",$,a||Se()],m=>[...m,{userId:"typing"}])}),B.on(tr.STOP_TYPING,()=>{g.setQueryData(["messages",$,a||Se()],m=>m.filter(R=>R.userId!=="typing"))}),()=>{B.disconnect()}},[$,g,a,f]),b.useEffect(()=>{f&&y(!0)},[f]),b.useEffect(()=>{ie&&!h&&_(ie)},[ie,h]),b.useEffect(()=>{l&&!h&&_(l)},[l,h]),T.jsx(wo.Provider,{value:{socket:H.current,messages:M,channelId:$,onEndBot:r,isTest:n,handleSendMessage:F,handleClose:X,disableInput:d,isShowClose:i,isLoadingMessages:K,isForLiveChat:o,userId:a,handleReload:J,customStyles:w,adminId:p,isForManager:h},children:t})},ft=()=>{const t=b.useContext(wo);if(!t)throw new Error("useSocket must be used within SocketProvider");return t};function xo(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;ea(i)))==null?void 0:o.classGroupId}const _o=/^\[(.+)\]$/;function jl(t){if(_o.test(t)){const e=_o.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}}function Dl(t){const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return Il(Object.entries(t.classGroups),r).forEach(([i,o])=>{Xn(o,n,i,e)}),n}function Xn(t,e,r,n){t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:So(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(Bl(s)){Xn(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Xn(o,So(e,i),r,n)})})}function So(t,e){let r=t;return e.split(Gn).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function Bl(t){return t.isThemeGetter}function Il(t,e){return e?t.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[r,s]}):t}function Fl(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;function s(i,o){r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)}return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}}const ko="!";function ql(t){const e=t.separator,r=e.length===1,n=e[0],s=e.length;return function(o){const a=[];let l=0,f=0,h;for(let _=0;_f?h-f:void 0;return{modifiers:a,hasImportantModifier:d,baseClassName:y,maybePostfixModifierPosition:w}}}function Ul(t){if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e}function Hl(t){return{cache:Fl(t.cacheSize),splitModifiers:ql(t),...Nl(t)}}const Vl=/\s+/;function Ql(t,e){const{splitModifiers:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=new Set;return t.trim().split(Vl).map(o=>{const{modifiers:a,hasImportantModifier:l,baseClassName:f,maybePostfixModifierPosition:h}=r(o);let p=n(h?f.substring(0,h):f),d=!!h;if(!p){if(!h)return{isTailwindClass:!1,originalClassName:o};if(p=n(f),!p)return{isTailwindClass:!1,originalClassName:o};d=!1}const y=Ul(a).join(":");return{isTailwindClass:!0,modifierId:l?y+ko:y,classGroupId:p,originalClassName:o,hasPostfixModifier:d}}).reverse().filter(o=>{if(!o.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:f}=o,h=a+l;return i.has(h)?!1:(i.add(h),s(l,f).forEach(p=>i.add(a+p)),!0)}).reverse().map(o=>o.originalClassName).join(" ")}function zl(){let t=0,e,r,n="";for(;tp(h),t());return r=Hl(f),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const f=n(l);if(f)return f;const h=Ql(l,r);return s(l,h),h}return function(){return i(zl.apply(null,arguments))}}function se(t){const e=r=>r[t]||[];return e.isThemeGetter=!0,e}const Oo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yl=/^\d+\/\d+$/,Kl=new Set(["px","full","screen"]),Gl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Zl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ze(t){return dt(t)||Kl.has(t)||Yl.test(t)}function Ze(t){return Rt(t,"length",cu)}function dt(t){return!!t&&!Number.isNaN(Number(t))}function Xr(t){return Rt(t,"number",dt)}function fr(t){return!!t&&Number.isInteger(Number(t))}function tu(t){return t.endsWith("%")&&dt(t.slice(0,-1))}function U(t){return Oo.test(t)}function et(t){return Gl.test(t)}const ru=new Set(["length","size","percentage"]);function nu(t){return Rt(t,ru,Ao)}function su(t){return Rt(t,"position",Ao)}const iu=new Set(["image","url"]);function ou(t){return Rt(t,iu,uu)}function au(t){return Rt(t,"",lu)}function dr(){return!0}function Rt(t,e,r){const n=Oo.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1}function cu(t){return Xl.test(t)&&!Jl.test(t)}function Ao(){return!1}function lu(t){return Zl.test(t)}function uu(t){return eu.test(t)}function hu(){const t=se("colors"),e=se("spacing"),r=se("blur"),n=se("brightness"),s=se("borderColor"),i=se("borderRadius"),o=se("borderSpacing"),a=se("borderWidth"),l=se("contrast"),f=se("grayscale"),h=se("hueRotate"),p=se("invert"),d=se("gap"),y=se("gradientColorStops"),w=se("gradientColorStopPositions"),_=se("inset"),g=se("margin"),C=se("opacity"),L=se("padding"),$=se("saturate"),H=se("scale"),M=se("sepia"),K=se("skew"),ie=se("space"),F=se("translate"),X=()=>["auto","contain","none"],J=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",U,e],m=()=>[U,e],R=()=>["",ze,Ze],S=()=>["auto",dt,U],v=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],x=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],k=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",U],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[dt,Xr],Z=()=>[dt,U];return{cacheSize:500,separator:":",theme:{colors:[dr],spacing:[ze,Ze],blur:["none","",et,U],brightness:z(),borderColor:[t],borderRadius:["none","","full",et,U],borderSpacing:m(),borderWidth:R(),contrast:z(),grayscale:j(),hueRotate:Z(),invert:j(),gap:m(),gradientColorStops:[t],gradientColorStopPositions:[tu,Ze],inset:B(),margin:B(),opacity:z(),padding:m(),saturate:z(),scale:z(),sepia:j(),skew:Z(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",U]}],container:["container"],columns:[{columns:[et]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...v(),U]}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fr,U]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",U]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",fr,U]}],"grid-cols":[{"grid-cols":[dr]}],"col-start-end":[{col:["auto",{span:["full",fr,U]},U]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[dr]}],"row-start-end":[{row:["auto",{span:[fr,U]},U]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",U]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",U]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[L]}],px:[{px:[L]}],py:[{py:[L]}],ps:[{ps:[L]}],pe:[{pe:[L]}],pt:[{pt:[L]}],pr:[{pr:[L]}],pb:[{pb:[L]}],pl:[{pl:[L]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[ie]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ie]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",U,e]}],"min-w":[{"min-w":[U,e,"min","max","fit"]}],"max-w":[{"max-w":[U,e,"none","full","min","max","fit","prose",{screen:[et]},et]}],h:[{h:[U,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[U,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[U,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[U,e,"auto","min","max","fit"]}],"font-size":[{text:["base",et,Ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xr]}],"font-family":[{font:[dr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",U]}],"line-clamp":[{"line-clamp":["none",dt,Xr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ze,U]}],"list-image":[{"list-image":["none",U]}],"list-style-type":[{list:["none","disc","decimal",U]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...x(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ze,Ze]}],"underline-offset":[{"underline-offset":["auto",ze,U]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",U]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",U]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...v(),su]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nu]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ou]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...x(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:x()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...x()]}],"outline-offset":[{"outline-offset":[ze,U]}],"outline-w":[{outline:[ze,Ze]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[ze,Ze]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",et,au]}],"shadow-color":[{shadow:[dr]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":O()}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",et,U]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[$]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[$]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",U]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",U]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",U]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[H]}],"scale-x":[{"scale-x":[H]}],"scale-y":[{"scale-y":[H]}],rotate:[{rotate:[fr,U]}],"translate-x":[{"translate-x":[F]}],"translate-y":[{"translate-y":[F]}],"skew-x":[{"skew-x":[K]}],"skew-y":[{"skew-y":[K]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",U]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",U]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",U]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ze,Ze,Xr]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const fu=Wl(hu);function pt(...t){return fu(Ll(t))}var To={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(lt,function(){var r=1e3,n=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",f="day",h="week",p="month",d="quarter",y="year",w="date",_="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,L={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var v=["th","st","nd","rd"],x=S%100;return"["+S+(v[(x-20)%10]||v[x]||v[0])+"]"}},$=function(S,v,x){var O=String(S);return!O||O.length>=v?S:""+Array(v+1-O.length).join(x)+S},H={s:$,z:function(S){var v=-S.utcOffset(),x=Math.abs(v),O=Math.floor(x/60),k=x%60;return(v<=0?"+":"-")+$(O,2,"0")+":"+$(k,2,"0")},m:function S(v,x){if(v.date()1)return S(D[0])}else{var z=v.name;K[z]=v,k=z}return!O&&k&&(M=k),k||!O&&M},J=function(S,v){if(F(S))return S.clone();var x=typeof v=="object"?v:{};return x.date=S,x.args=arguments,new m(x)},B=H;B.l=X,B.i=F,B.w=function(S,v){return J(S,{locale:v.$L,utc:v.$u,x:v.$x,$offset:v.$offset})};var m=function(){function S(x){this.$L=X(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[ie]=!0}var v=S.prototype;return v.parse=function(x){this.$d=function(O){var k=O.date,j=O.utc;if(k===null)return new Date(NaN);if(B.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var D=k.match(g);if(D){var z=D[2]-1||0,Z=(D[7]||"0").substring(0,3);return j?new Date(Date.UTC(D[1],z,D[3]||1,D[4]||0,D[5]||0,D[6]||0,Z)):new Date(D[1],z,D[3]||1,D[4]||0,D[5]||0,D[6]||0,Z)}}return new Date(k)}(x),this.init()},v.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},v.$utils=function(){return B},v.isValid=function(){return this.$d.toString()!==_},v.isSame=function(x,O){var k=J(x);return this.startOf(O)<=k&&k<=this.endOf(O)},v.isAfter=function(x,O){return J(x){La($,n(X,X.key,e==null?void 0:e.shouldUpdate))}),()=>{jr.call($)}},[]),_=b.useMemo(()=>r?null:b.createElement((e==null?void 0:e.as)??s,{ref:p}),[]),g=y.current.length,k=new Array(g);for(let $=0;${const o=b.useRef(null),[a]=b.useState(()=>({current:Array(t.length)})),l=b.useRef(null),f=b.useRef({each:null,children:null,mounted:!1}),[,h]=b.useState(!1);if(l.current&&(t!==f.current.each||!r)){const y=Us(t,e,f,a,r);Ms.call(l.current,Rs(y))}const p=n?Ds:Dr,d=b.createElement(b.Fragment,null,b.createElement(s??p,{...i,ref:o}),...a.current.map(y=>y.portal));return b.useEffect(()=>{if(!o.current||l.current||f.current.mounted)return;const y=Us(t,e,f,a,r);l.current=Rs(y),Tr.call(Re,d)||Rr.call(Re,d,l.current),$s.call(l.current,o.current),f.current.mounted=!0,h(!0)},[o.current]),d},Ha=b.memo;Ha(qa);const Us=(t,e,r,n,s)=>{var a;const i=Array(t.length),o=r.current;for(let l=0,f=t.length;ly==null?void 0:y.scope),d=(y,w,_)=>p({scope:mn(b.createElement(h.type,y),!1,w.current,_)},h.key?String(h.key):void 0);Rr.call(Re,h.type,d),o.block=d,i[l]=d(h.props,n,l)}return o.each=t,o.children=i,i};function Va(t,e){return t===e||t!==t&&e!==e}function Qa(t,e){for(const r in t)if(!Va(t[r],e[r]))return!0;return!1}function Br(t,{portals:e,...r}){const n=`CompiledBlock(Inner(${r.name}))`,s=Fs(a=>t(a),{...r,scoped:void 0,name:n,shouldUpdate:Qa}),i=(e==null?void 0:e.length)||0,o=e&&i>0?a=>{const l=b.useContext(Ba),[f]=b.useState(()=>[]),h={...a,scoped:l};for(let d=0;db.createElement(s,a);return r.name&&(o.displayName=`Million(CompiledBlock(Outer(${r.name})))`),o}typeof window<"u"&&(window.__MILLION_DATA__={version:"3.0.6"});const tr={MESSAGE:"message",TYPING:"typing",STOP_TYPING:"stop-typing",AGENT_MESSAGE:"agent-message"},qs="user-bot-id",wn="https://api.dialoguebot.tech";console.log("API_URL",wn);var Xe={},re={},fe={};Object.defineProperty(fe,"__esModule",{value:!0}),fe.output=fe.exists=fe.hash=fe.bytes=fe.bool=fe.number=fe.isBytes=void 0;function Ir(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}fe.number=Ir;function Hs(t){if(typeof t!="boolean")throw new Error(`boolean expected, not ${t}`)}fe.bool=Hs;function Vs(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}fe.isBytes=Vs;function xn(t,...e){if(!Vs(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}fe.bytes=xn;function Qs(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ir(t.outputLen),Ir(t.blockLen)}fe.hash=Qs;function zs(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}fe.exists=zs;function Ws(t,e){xn(t);const r=e.outputLen;if(t.length>En&Fr)}:{h:Number(t>>En&Fr)|0,l:Number(t&Fr)|0}}F.fromBig=_n;function Ys(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let s=0;sBigInt(t>>>0)<>>0);F.toBig=Ks;const Gs=(t,e,r)=>t>>>r;F.shrSH=Gs;const Xs=(t,e,r)=>t<<32-r|e>>>r;F.shrSL=Xs;const Js=(t,e,r)=>t>>>r|e<<32-r;F.rotrSH=Js;const Zs=(t,e,r)=>t<<32-r|e>>>r;F.rotrSL=Zs;const ei=(t,e,r)=>t<<64-r|e>>>r-32;F.rotrBH=ei;const ti=(t,e,r)=>t>>>r-32|e<<64-r;F.rotrBL=ti;const ri=(t,e)=>e;F.rotr32H=ri;const ni=(t,e)=>t;F.rotr32L=ni;const si=(t,e,r)=>t<>>32-r;F.rotlSH=si;const ii=(t,e,r)=>e<>>32-r;F.rotlSL=ii;const oi=(t,e,r)=>e<>>64-r;F.rotlBH=oi;const ai=(t,e,r)=>t<>>64-r;F.rotlBL=ai;function ci(t,e,r,n){const s=(e>>>0)+(n>>>0);return{h:t+r+(s/2**32|0)|0,l:s|0}}F.add=ci;const li=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);F.add3L=li;const ui=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;F.add3H=ui;const hi=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);F.add4L=hi;const fi=(t,e,r,n,s)=>e+r+n+s+(t/2**32|0)|0;F.add4H=fi;const di=(t,e,r,n,s)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(s>>>0);F.add5L=di;const pi=(t,e,r,n,s,i)=>e+r+n+s+i+(t/2**32|0)|0;F.add5H=pi;const Wa={fromBig:_n,split:Ys,toBig:Ks,shrSH:Gs,shrSL:Xs,rotrSH:Js,rotrSL:Zs,rotrBH:ei,rotrBL:ti,rotr32H:ri,rotr32L:ni,rotlSH:si,rotlSL:ii,rotlBH:oi,rotlBL:ai,add:ci,add3L:li,add3H:ui,add4L:hi,add4H:fi,add5H:pi,add5L:di};F.default=Wa;var yi={},Ur={};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.crypto=void 0,Ur.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,function(t){/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const e=Ur,r=fe;function n(m){return m instanceof Uint8Array||m!=null&&typeof m=="object"&&m.constructor.name==="Uint8Array"}t.isBytes=n;const s=m=>new Uint8Array(m.buffer,m.byteOffset,m.byteLength);t.u8=s;const i=m=>new Uint32Array(m.buffer,m.byteOffset,Math.floor(m.byteLength/4));t.u32=i;const o=m=>new DataView(m.buffer,m.byteOffset,m.byteLength);t.createView=o;const a=(m,T)=>m<<32-T|m>>>T;t.rotr=a;const l=(m,T)=>m<>>32-T>>>0;t.rotl=l,t.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;const f=m=>m<<24&4278190080|m<<8&16711680|m>>>8&65280|m>>>24&255;t.byteSwap=f,t.byteSwapIfBE=t.isLE?m=>m:m=>(0,t.byteSwap)(m);function h(m){for(let T=0;TT.toString(16).padStart(2,"0"));function d(m){(0,r.bytes)(m);let T="";for(let S=0;S=y._0&&m<=y._9)return m-y._0;if(m>=y._A&&m<=y._F)return m-(y._A-10);if(m>=y._a&&m<=y._f)return m-(y._a-10)}function _(m){if(typeof m!="string")throw new Error("hex string expected, got "+typeof m);const T=m.length,S=T/2;if(T%2)throw new Error("padded hex string expected, got unpadded hex of length "+T);const x=new Uint8Array(S);for(let v=0,O=0;v{};t.nextTick=g;async function k(m,T,S){let x=Date.now();for(let v=0;v=0&&Om().update(I(x)).digest(),S=m();return T.outputLen=S.outputLen,T.blockLen=S.blockLen,T.create=()=>m(),T}t.wrapConstructor=D;function X(m){const T=(x,v)=>m(v).update(I(x)).digest(),S=m({});return T.outputLen=S.outputLen,T.blockLen=S.blockLen,T.create=x=>m(x),T}t.wrapConstructorWithOpts=X;function J(m){const T=(x,v)=>m(v).update(I(x)).digest(),S=m({});return T.outputLen=S.outputLen,T.blockLen=S.blockLen,T.create=x=>m(x),T}t.wrapXOFConstructorWithOpts=J;function H(m=32){if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(new Uint8Array(m));throw new Error("crypto.getRandomValues must be defined")}t.randomBytes=H}(yi),Object.defineProperty(re,"__esModule",{value:!0}),re.shake256=re.shake128=re.keccak_512=re.keccak_384=re.keccak_256=re.keccak_224=re.sha3_512=re.sha3_384=re.sha3_256=re.sha3_224=re.Keccak=re.keccakP=void 0;const Ot=fe,rr=F,Qe=yi,mi=[],gi=[],bi=[],Ya=BigInt(0),nr=BigInt(1),Ka=BigInt(2),Ga=BigInt(7),Xa=BigInt(256),Ja=BigInt(113);for(let t=0,e=nr,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],mi.push(2*(5*n+r)),gi.push((t+1)*(t+2)/2%64);let s=Ya;for(let i=0;i<7;i++)e=(e<>Ga)*Ja)%Xa,e&Ka&&(s^=nr<<(nr<r>32?(0,rr.rotlBH)(t,e,r):(0,rr.rotlSH)(t,e,r),wi=(t,e,r)=>r>32?(0,rr.rotlBL)(t,e,r):(0,rr.rotlSL)(t,e,r);function xi(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,l=(o+2)%10,f=r[l],h=r[l+1],p=vi(f,h,1)^r[a],d=wi(f,h,1)^r[a+1];for(let y=0;y<50;y+=10)t[o+y]^=p,t[o+y+1]^=d}let s=t[2],i=t[3];for(let o=0;o<24;o++){const a=gi[o],l=vi(s,i,a),f=wi(s,i,a),h=mi[o];s=t[h],i=t[h+1],t[h]=l,t[h+1]=f}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Za[n],t[1]^=ec[n]}r.fill(0)}re.keccakP=xi;class sr extends Qe.Hash{constructor(e,r,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ot.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Qe.u32)(this.state)}keccak(){Qe.isLE||(0,Qe.byteSwap32)(this.state32),xi(this.state32,this.rounds),Qe.isLE||(0,Qe.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,Ot.exists)(this);const{blockLen:r,state:n}=this;e=(0,Qe.toBytes)(e);const s=e.length;for(let i=0;i=n&&this.keccak();const o=Math.min(n-this.posOut,i-s);e.set(r.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Ot.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Ot.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new sr(r,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}}re.Keccak=sr;const Je=(t,e,r)=>(0,Qe.wrapConstructor)(()=>new sr(e,t,r));re.sha3_224=Je(6,144,224/8),re.sha3_256=Je(6,136,256/8),re.sha3_384=Je(6,104,384/8),re.sha3_512=Je(6,72,512/8),re.keccak_224=Je(1,144,224/8),re.keccak_256=Je(1,136,256/8),re.keccak_384=Je(1,104,384/8),re.keccak_512=Je(1,72,512/8);const Ei=(t,e,r)=>(0,Qe.wrapXOFConstructorWithOpts)((n={})=>new sr(e,t,n.dkLen===void 0?r:n.dkLen,!0));re.shake128=Ei(31,168,128/8),re.shake256=Ei(31,136,256/8);const{sha3_512:tc}=re,_i=24,ir=32,Sn=(t=4,e=Math.random)=>{let r="";for(;r.lengthSi(tc(t)).toString(36).slice(1),Ci=Array.from({length:26},(t,e)=>String.fromCharCode(e+97)),rc=t=>Ci[Math.floor(t()*Ci.length)],Oi=({globalObj:t=typeof lt<"u"?lt:typeof window<"u"?window:{},random:e=Math.random}={})=>{const r=Object.keys(t).toString(),n=r.length?r+Sn(ir,e):Sn(ir,e);return ki(n).substring(0,ir)},Ai=t=>()=>t++,nc=476782367,Ti=({random:t=Math.random,counter:e=Ai(Math.floor(t()*nc)),length:r=_i,fingerprint:n=Oi({random:t})}={})=>function(){const i=rc(t),o=Date.now().toString(36),a=e().toString(36),l=Sn(r,t),f=`${o+l+a+n}`;return`${i+ki(f).substring(1,r)}`},sc=Ti(),ic=(t,{minLength:e=2,maxLength:r=ir}={})=>{const n=t.length,s=/^[0-9a-z]+$/;try{if(typeof t=="string"&&n>=e&&n<=r&&s.test(t))return!0}finally{}return!1};Xe.getConstants=()=>({defaultLength:_i,bigLength:ir}),Xe.init=Ti,Xe.createId=sc,Xe.bufToBigInt=Si,Xe.createCounter=Ai,Xe.createFingerprint=Oi,Xe.isCuid=ic;const{createId:oc,init:ch,getConstants:lh,isCuid:uh}=Xe;var ac=oc;const Se=()=>{const t=ac(),e=localStorage.getItem(qs);return e||(localStorage.setItem(qs,t),t)},Ri=(t,e)=>{const r=e||Se();return`${t}_${r}`},Pi=t=>{var e;(e=window.open(t,"_blank"))==null||e.focus()},kn=t=>{t=t.replace(/^#/,"");const e=parseInt(t,16);let r=e>>16&255,n=e>>8&255,s=e&255;r/=255,n/=255,s/=255;const i=Math.max(r,n,s),o=Math.min(r,n,s);let a=0,l;const f=(i+o)/2;if(i===o)a=l=0;else{const h=i-o;switch(l=f>.5?h/(2-i-o):h/(i+o),i){case r:a=(n-s)/h+(n{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},At=typeof window>"u"||"Deno"in globalThis;function ke(){}function cc(t,e){return typeof t=="function"?t(e):t}function Cn(t){return typeof t=="number"&&t>=0&&t!==1/0}function $i(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Mi(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==On(o,e.options))return!1}else if(!cr(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Li(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(ar(e.options.mutationKey)!==ar(i))return!1}else if(!cr(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function On(t,e){return((e==null?void 0:e.queryKeyHashFn)||ar)(t)}function ar(t){return JSON.stringify(t,(e,r)=>Tn(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function cr(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!cr(t[r],e[r])):!1}function Ni(t,e){if(t===e)return t;const r=ji(t)&&ji(e);if(r||Tn(t)&&Tn(e)){const n=r?t:Object.keys(t),s=n.length,i=r?e:Object.keys(e),o=i.length,a=r?[]:{};let l=0;for(let f=0;f{setTimeout(e,t)})}function Rn(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Ni(t,e):e}function uc(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function hc(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var lr=Symbol(),fc=(No=class extends or{constructor(){super();L(this,yt,void 0);L(this,tt,void 0);L(this,Pt,void 0);P(this,Pt,e=>{if(!At&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){u(this,tt)||this.setEventListener(u(this,Pt))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,tt))==null||e.call(this),P(this,tt,void 0))}setEventListener(e){var r;P(this,Pt,e),(r=u(this,tt))==null||r.call(this),P(this,tt,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){u(this,yt)!==e&&(P(this,yt,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof u(this,yt)=="boolean"?u(this,yt):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},yt=new WeakMap,tt=new WeakMap,Pt=new WeakMap,No),Pn=new fc,dc=(jo=class extends or{constructor(){super();L(this,$t,!0);L(this,rt,void 0);L(this,Mt,void 0);P(this,Mt,e=>{if(!At&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){u(this,rt)||this.setEventListener(u(this,Mt))}onUnsubscribe(){var e;this.hasListeners()||((e=u(this,rt))==null||e.call(this),P(this,rt,void 0))}setEventListener(e){var r;P(this,Mt,e),(r=u(this,rt))==null||r.call(this),P(this,rt,e(this.setOnline.bind(this)))}setOnline(e){u(this,$t)!==e&&(P(this,$t,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return u(this,$t)}},$t=new WeakMap,rt=new WeakMap,Mt=new WeakMap,jo),qr=new dc;function pc(t){return Math.min(1e3*2**t,3e4)}function $n(t){return(t??"online")==="online"?qr.isOnline():!0}var Bi=class{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Mn(t){return t instanceof Bi}function Ii(t){let e=!1,r=0,n=!1,s,i,o;const a=new Promise((g,k)=>{i=g,o=k}),l=g=>{var k;n||(y(new Bi(g)),(k=t.abort)==null||k.call(t))},f=()=>{e=!0},h=()=>{e=!1},p=()=>!Pn.isFocused()||t.networkMode!=="always"&&!qr.isOnline(),d=g=>{var k;n||(n=!0,(k=t.onSuccess)==null||k.call(t,g),s==null||s(),i(g))},y=g=>{var k;n||(n=!0,(k=t.onError)==null||k.call(t,g),s==null||s(),o(g))},w=()=>new Promise(g=>{var k;s=M=>{const I=n||!p();return I&&g(M),I},(k=t.onPause)==null||k.call(t)}).then(()=>{var g;s=void 0,n||(g=t.onContinue)==null||g.call(t)}),_=()=>{if(n)return;let g;try{g=t.fn()}catch(k){g=Promise.reject(k)}Promise.resolve(g).then(d).catch(k=>{var K;if(n)return;const M=t.retry??(At?0:3),I=t.retryDelay??pc,j=typeof I=="function"?I(r,k):I,$=M===!0||typeof M=="number"&&r{if(p())return w()}).then(()=>{e?y(k):_()})})};return $n(t.networkMode)?_():w().then(_),{promise:a,cancel:l,continue:()=>(s==null?void 0:s())?a:Promise.resolve(),cancelRetry:f,continueRetry:h}}function yc(){let t=[],e=0,r=d=>{d()},n=d=>{d()},s=d=>setTimeout(d,0);const i=d=>{s=d},o=d=>{let y;e++;try{y=d()}finally{e--,e||f()}return y},a=d=>{e?t.push(d):s(()=>{r(d)})},l=d=>(...y)=>{a(()=>{d(...y)})},f=()=>{const d=t;t=[],d.length&&s(()=>{n(()=>{d.forEach(y=>{r(y)})})})};return{batch:o,batchCalls:l,schedule:a,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{n=d},setScheduler:i}}var ye=yc(),Fi=(Do=class{constructor(){L(this,mt,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cn(this.gcTime)&&P(this,mt,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(At?1/0:5*60*1e3))}clearGcTimeout(){u(this,mt)&&(clearTimeout(u(this,mt)),P(this,mt,void 0))}},mt=new WeakMap,Do),mc=(Bo=class extends Fi{constructor(e){super();L(this,$e);L(this,Lt,void 0);L(this,Nt,void 0);L(this,Oe,void 0);L(this,be,void 0);L(this,de,void 0);L(this,pr,void 0);L(this,gt,void 0);P(this,gt,!1),P(this,pr,e.defaultOptions),this.setOptions(e.options),P(this,de,[]),P(this,Oe,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,P(this,Lt,e.state||gc(this.options)),this.state=u(this,Lt),this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...u(this,pr),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!u(this,de).length&&this.state.fetchStatus==="idle"&&u(this,Oe).remove(this)}setData(e,r){const n=Rn(this.state.data,e,this.options);return W(this,$e,Ye).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){W(this,$e,Ye).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,s;const r=(n=u(this,be))==null?void 0:n.promise;return(s=u(this,be))==null||s.cancel(e),r?r.then(ke).catch(ke):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(u(this,Lt))}isActive(){return u(this,de).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?u(this,de).some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!$i(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=u(this,de).find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=u(this,be))==null||r.continue()}onOnline(){var r;const e=u(this,de).find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=u(this,be))==null||r.continue()}addObserver(e){u(this,de).includes(e)||(u(this,de).push(e),this.clearGcTimeout(),u(this,Oe).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){u(this,de).includes(e)&&(P(this,de,u(this,de).filter(r=>r!==e)),u(this,de).length||(u(this,be)&&(u(this,gt)?u(this,be).cancel({revert:!0}):u(this,be).cancelRetry()),this.scheduleGc()),u(this,Oe).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return u(this,de).length}invalidate(){this.state.isInvalidated||W(this,$e,Ye).call(this,{type:"invalidate"})}fetch(e,r){var f,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(u(this,be))return u(this,be).continueRetry(),u(this,be).promise}if(e&&this.setOptions(e),!this.options.queryFn){const d=u(this,de).find(y=>y.options.queryFn);d&&this.setOptions(d.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s={queryKey:this.queryKey,meta:this.meta},i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(P(this,gt,!0),n.signal)})};i(s);const o=()=>(process.env.NODE_ENV!=="production"&&this.options.queryFn===lr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'`),!this.options.queryFn||this.options.queryFn===lr?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(P(this,gt,!1),this.options.persister?this.options.persister(this.options.queryFn,s,this):this.options.queryFn(s))),a={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(a),(f=this.options.behavior)==null||f.onFetch(a,this),P(this,Nt,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&W(this,$e,Ye).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=d=>{var y,w,_,g;Mn(d)&&d.silent||W(this,$e,Ye).call(this,{type:"error",error:d}),Mn(d)||((w=(y=u(this,Oe).config).onError)==null||w.call(y,d,this),(g=(_=u(this,Oe).config).onSettled)==null||g.call(_,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return P(this,be,Ii({fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:d=>{var y,w,_,g;if(d===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(d),(w=(y=u(this,Oe).config).onSuccess)==null||w.call(y,d,this),(g=(_=u(this,Oe).config).onSettled)==null||g.call(_,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(d,y)=>{W(this,$e,Ye).call(this,{type:"failed",failureCount:d,error:y})},onPause:()=>{W(this,$e,Ye).call(this,{type:"pause"})},onContinue:()=>{W(this,$e,Ye).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),u(this,be).promise}},Lt=new WeakMap,Nt=new WeakMap,Oe=new WeakMap,be=new WeakMap,de=new WeakMap,pr=new WeakMap,gt=new WeakMap,$e=new WeakSet,Ye=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Ui(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Mn(s)&&s.revert&&u(this,Nt)?{...u(this,Nt),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),ye.batch(()=>{u(this,de).forEach(n=>{n.onQueryUpdate()}),u(this,Oe).notify({query:this,type:"updated",action:e})})},Bo);function Ui(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$n(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function gc(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var bc=(Io=class extends or{constructor(e={}){super();L(this,De,void 0);this.config=e,P(this,De,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??On(s,r);let o=this.get(i);return o||(o=new mc({cache:this,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){u(this,De).has(e.queryHash)||(u(this,De).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=u(this,De).get(e.queryHash);r&&(e.destroy(),r===e&&u(this,De).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ye.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return u(this,De).get(e)}getAll(){return[...u(this,De).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Mi(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>Mi(e,n)):r}notify(e){ye.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){ye.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ye.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},De=new WeakMap,Io),vc=(Fo=class extends Fi{constructor(e){super();L(this,Ie);L(this,Be,void 0);L(this,yr,void 0);L(this,_e,void 0);L(this,jt,void 0);this.mutationId=e.mutationId,P(this,yr,e.defaultOptions),P(this,_e,e.mutationCache),P(this,Be,[]),this.state=e.state||wc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...u(this,yr),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){u(this,Be).includes(e)||(u(this,Be).push(e),this.clearGcTimeout(),u(this,_e).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){P(this,Be,u(this,Be).filter(r=>r!==e)),this.scheduleGc(),u(this,_e).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){u(this,Be).length||(this.state.status==="pending"?this.scheduleGc():u(this,_e).remove(this))}continue(){var e;return((e=u(this,jt))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,o,a,l,f,h,p,d,y,w,_,g,k,M,I,j,$,K,oe;const r=()=>(P(this,jt,Ii({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(D,X)=>{W(this,Ie,ct).call(this,{type:"failed",failureCount:D,error:X})},onPause:()=>{W(this,Ie,ct).call(this,{type:"pause"})},onContinue:()=>{W(this,Ie,ct).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),u(this,jt).promise),n=this.state.status==="pending";try{if(!n){W(this,Ie,ct).call(this,{type:"pending",variables:e}),await((i=(s=u(this,_e).config).onMutate)==null?void 0:i.call(s,e,this));const X=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,e));X!==this.state.context&&W(this,Ie,ct).call(this,{type:"pending",context:X,variables:e})}const D=await r();return await((f=(l=u(this,_e).config).onSuccess)==null?void 0:f.call(l,D,e,this.state.context,this)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,D,e,this.state.context)),await((y=(d=u(this,_e).config).onSettled)==null?void 0:y.call(d,D,null,this.state.variables,this.state.context,this)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,D,null,e,this.state.context)),W(this,Ie,ct).call(this,{type:"success",data:D}),D}catch(D){try{throw await((k=(g=u(this,_e).config).onError)==null?void 0:k.call(g,D,e,this.state.context,this)),await((I=(M=this.options).onError)==null?void 0:I.call(M,D,e,this.state.context)),await(($=(j=u(this,_e).config).onSettled)==null?void 0:$.call(j,void 0,D,this.state.variables,this.state.context,this)),await((oe=(K=this.options).onSettled)==null?void 0:oe.call(K,void 0,D,e,this.state.context)),D}finally{W(this,Ie,ct).call(this,{type:"error",error:D})}}}},Be=new WeakMap,yr=new WeakMap,_e=new WeakMap,jt=new WeakMap,Ie=new WeakSet,ct=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!$n(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ye.batch(()=>{u(this,Be).forEach(n=>{n.onMutationUpdate(e)}),u(this,_e).notify({mutation:this,type:"updated",action:e})})},Fo);function wc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var xc=(Uo=class extends or{constructor(e={}){super();L(this,Ae,void 0);L(this,mr,void 0);L(this,bt,void 0);this.config=e,P(this,Ae,[]),P(this,mr,0)}build(e,r,n){const s=new vc({mutationCache:this,mutationId:++cn(this,mr)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){u(this,Ae).push(e),this.notify({type:"added",mutation:e})}remove(e){P(this,Ae,u(this,Ae).filter(r=>r!==e)),this.notify({type:"removed",mutation:e})}clear(){ye.batch(()=>{u(this,Ae).forEach(e=>{this.remove(e)})})}getAll(){return u(this,Ae)}find(e){const r={exact:!0,...e};return u(this,Ae).find(n=>Li(r,n))}findAll(e={}){return u(this,Ae).filter(r=>Li(e,r))}notify(e){ye.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){return P(this,bt,(u(this,bt)??Promise.resolve()).then(()=>{const e=u(this,Ae).filter(r=>r.state.isPaused);return ye.batch(()=>e.reduce((r,n)=>r.then(()=>n.continue().catch(ke)),Promise.resolve()))}).then(()=>{P(this,bt,void 0)})),u(this,bt)}},Ae=new WeakMap,mr=new WeakMap,bt=new WeakMap,Uo);function Ec(t){return{onFetch:(e,r)=>{const n=async()=>{var w,_,g,k,M;const s=e.options,i=(g=(_=(w=e.fetchOptions)==null?void 0:w.meta)==null?void 0:_.fetchMore)==null?void 0:g.direction,o=((k=e.state.data)==null?void 0:k.pages)||[],a=((M=e.state.data)==null?void 0:M.pageParams)||[],l={pages:[],pageParams:[]};let f=!1;const h=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>(e.signal.aborted?f=!0:e.signal.addEventListener("abort",()=>{f=!0}),e.signal)})},p=e.options.queryFn&&e.options.queryFn!==lr?e.options.queryFn:()=>(process.env.NODE_ENV!=="production"&&e.options.queryFn===lr&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.options.queryHash}'`),Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`))),d=async(I,j,$)=>{if(f)return Promise.reject();if(j==null&&I.pages.length)return Promise.resolve(I);const K={queryKey:e.queryKey,pageParam:j,direction:$?"backward":"forward",meta:e.options.meta};h(K);const oe=await p(K),{maxPages:D}=e.options,X=$?hc:uc;return{pages:X(I.pages,oe,D),pageParams:X(I.pageParams,j,D)}};let y;if(i&&o.length){const I=i==="backward",j=I?_c:qi,$={pages:o,pageParams:a},K=j(s,$);y=await d($,K,I)}else{y=await d(l,a[0]??s.initialPageParam);const I=t??o.length;for(let j=1;j{var s,i;return(i=(s=e.options).persister)==null?void 0:i.call(s,n,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=n}}}function qi(t,{pages:e,pageParams:r}){const n=e.length-1;return t.getNextPageParam(e[n],e,r[n],r)}function _c(t,{pages:e,pageParams:r}){var n;return(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r)}var Sc=(qo=class{constructor(t={}){L(this,ie,void 0);L(this,nt,void 0);L(this,st,void 0);L(this,Dt,void 0);L(this,Bt,void 0);L(this,it,void 0);L(this,It,void 0);L(this,Ft,void 0);P(this,ie,t.queryCache||new bc),P(this,nt,t.mutationCache||new xc),P(this,st,t.defaultOptions||{}),P(this,Dt,new Map),P(this,Bt,new Map),P(this,it,0)}mount(){cn(this,it)._++,u(this,it)===1&&(P(this,It,Pn.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,ie).onFocus())})),P(this,Ft,qr.subscribe(async t=>{t&&(await this.resumePausedMutations(),u(this,ie).onOnline())})))}unmount(){var t,e;cn(this,it)._--,u(this,it)===0&&((t=u(this,It))==null||t.call(this),P(this,It,void 0),(e=u(this,Ft))==null||e.call(this),P(this,Ft,void 0))}isFetching(t){return u(this,ie).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return u(this,nt).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=u(this,ie).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const r=this.defaultQueryOptions(t),n=u(this,ie).build(this,r);return t.revalidateIfStale&&n.isStaleByTime(r.staleTime)&&this.prefetchQuery(r),Promise.resolve(e)}}getQueriesData(t){return u(this,ie).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=u(this,ie).get(n.queryHash),i=s==null?void 0:s.state.data,o=cc(e,i);if(o!==void 0)return u(this,ie).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return ye.batch(()=>u(this,ie).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=u(this,ie).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=u(this,ie);ye.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=u(this,ie),n={type:"active",...t};return ye.batch(()=>(r.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries(n,e)))}cancelQueries(t={},e={}){const r={revert:!0,...e},n=ye.batch(()=>u(this,ie).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(ke).catch(ke)}invalidateQueries(t={},e={}){return ye.batch(()=>{if(u(this,ie).findAll(t).forEach(n=>{n.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,e)})}refetchQueries(t={},e){const r={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},n=ye.batch(()=>u(this,ie).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(ke)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(ke)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=u(this,ie).build(this,e);return r.isStaleByTime(e.staleTime)?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ke).catch(ke)}fetchInfiniteQuery(t){return t.behavior=Ec(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ke).catch(ke)}resumePausedMutations(){return qr.isOnline()?u(this,nt).resumePausedMutations():Promise.resolve()}getQueryCache(){return u(this,ie)}getMutationCache(){return u(this,nt)}getDefaultOptions(){return u(this,st)}setDefaultOptions(t){P(this,st,t)}setQueryDefaults(t,e){u(this,Dt).set(ar(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...u(this,Dt).values()];let r={};return e.forEach(n=>{cr(t,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(t,e){u(this,Bt).set(ar(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...u(this,Bt).values()];let r={};return e.forEach(n=>{cr(t,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...u(this,st).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=On(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===lr&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...u(this,st).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){u(this,ie).clear(),u(this,nt).clear()}},ie=new WeakMap,nt=new WeakMap,st=new WeakMap,Dt=new WeakMap,Bt=new WeakMap,it=new WeakMap,It=new WeakMap,Ft=new WeakMap,qo),kc=(Ho=class extends or{constructor(e,r){super();L(this,Et);L(this,vr);L(this,wr);L(this,xr);L(this,Er);L(this,_r);L(this,Sr);L(this,kr);L(this,nn);L(this,xe,void 0);L(this,ne,void 0);L(this,gr,void 0);L(this,ve,void 0);L(this,vt,void 0);L(this,Ut,void 0);L(this,Fe,void 0);L(this,br,void 0);L(this,qt,void 0);L(this,Ht,void 0);L(this,wt,void 0);L(this,xt,void 0);L(this,ot,void 0);L(this,Vt,new Set);this.options=r,P(this,xe,e),P(this,Fe,null),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(u(this,ne).addObserver(this),Hi(u(this,ne),this.options)?W(this,Et,Or).call(this):this.updateResult(),W(this,Er,cs).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ln(u(this,ne),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ln(u(this,ne),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,W(this,_r,ls).call(this),W(this,Sr,us).call(this),u(this,ne).removeObserver(this)}setOptions(e,r){const n=this.options,s=u(this,ne);if(this.options=u(this,xe).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");W(this,kr,hs).call(this),u(this,ne).setOptions(this.options),n._defaulted&&!An(this.options,n)&&u(this,xe).getQueryCache().notify({type:"observerOptionsUpdated",query:u(this,ne),observer:this});const i=this.hasListeners();i&&Vi(u(this,ne),s,this.options,n)&&W(this,Et,Or).call(this),this.updateResult(r),i&&(u(this,ne)!==s||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&W(this,vr,is).call(this);const o=W(this,wr,os).call(this);i&&(u(this,ne)!==s||this.options.enabled!==n.enabled||o!==u(this,ot))&&W(this,xr,as).call(this,o)}getOptimisticResult(e){const r=u(this,xe).getQueryCache().build(u(this,xe),e),n=this.createResult(r,e);return Oc(this,n)&&(P(this,ve,n),P(this,Ut,this.options),P(this,vt,u(this,ne).state)),n}getCurrentResult(){return u(this,ve)}trackResult(e,r){const n={};return Object.keys(e).forEach(s=>{Object.defineProperty(n,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),r==null||r(s),e[s])})}),n}trackProp(e){u(this,Vt).add(e)}getCurrentQuery(){return u(this,ne)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=u(this,xe).defaultQueryOptions(e),n=u(this,xe).getQueryCache().build(u(this,xe),r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){return W(this,Et,Or).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),u(this,ve)))}createResult(e,r){var oe;const n=u(this,ne),s=this.options,i=u(this,ve),o=u(this,vt),a=u(this,Ut),f=e!==n?e.state:u(this,gr),{state:h}=e;let p={...h},d=!1,y;if(r._optimisticResults){const D=this.hasListeners(),X=!D&&Hi(e,r),J=D&&Vi(e,n,r,s);(X||J)&&(p={...p,...Ui(h.data,e.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:g}=p;if(r.select&&p.data!==void 0)if(i&&p.data===(o==null?void 0:o.data)&&r.select===u(this,br))y=u(this,qt);else try{P(this,br,r.select),y=r.select(p.data),y=Rn(i==null?void 0:i.data,y,r),P(this,qt,y),P(this,Fe,null)}catch(D){P(this,Fe,D)}else y=p.data;if(r.placeholderData!==void 0&&y===void 0&&g==="pending"){let D;if(i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof r.placeholderData=="function"?r.placeholderData((oe=u(this,Ht))==null?void 0:oe.state.data,u(this,Ht)):r.placeholderData,r.select&&D!==void 0)try{D=r.select(D),P(this,Fe,null)}catch(X){P(this,Fe,X)}D!==void 0&&(g="success",y=Rn(i==null?void 0:i.data,D,r),d=!0)}u(this,Fe)&&(w=u(this,Fe),y=u(this,qt),_=Date.now(),g="error");const k=p.fetchStatus==="fetching",M=g==="pending",I=g==="error",j=M&&k,$=y!==void 0;return{status:g,fetchStatus:p.fetchStatus,isPending:M,isSuccess:g==="success",isError:I,isInitialLoading:j,isLoading:j,data:y,dataUpdatedAt:p.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>f.dataUpdateCount||p.errorUpdateCount>f.errorUpdateCount,isFetching:k,isRefetching:k&&!M,isLoadingError:I&&!$,isPaused:p.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:I&&$,isStale:Nn(e,r),refetch:this.refetch}}updateResult(e){const r=u(this,ve),n=this.createResult(u(this,ne),this.options);if(P(this,vt,u(this,ne).state),P(this,Ut,this.options),u(this,vt).data!==void 0&&P(this,Ht,u(this,ne)),An(n,r))return;P(this,ve,n);const s={},i=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!u(this,Vt).size)return!0;const l=new Set(a??u(this,Vt));return this.options.throwOnError&&l.add("error"),Object.keys(u(this,ve)).some(f=>{const h=f;return u(this,ve)[h]!==r[h]&&l.has(h)})};(e==null?void 0:e.listeners)!==!1&&i()&&(s.listeners=!0),W(this,nn,na).call(this,{...s,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&W(this,Er,cs).call(this)}},xe=new WeakMap,ne=new WeakMap,gr=new WeakMap,ve=new WeakMap,vt=new WeakMap,Ut=new WeakMap,Fe=new WeakMap,br=new WeakMap,qt=new WeakMap,Ht=new WeakMap,wt=new WeakMap,xt=new WeakMap,ot=new WeakMap,Vt=new WeakMap,Et=new WeakSet,Or=function(e){W(this,kr,hs).call(this);let r=u(this,ne).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(ke)),r},vr=new WeakSet,is=function(){if(W(this,_r,ls).call(this),At||u(this,ve).isStale||!Cn(this.options.staleTime))return;const r=$i(u(this,ve).dataUpdatedAt,this.options.staleTime)+1;P(this,wt,setTimeout(()=>{u(this,ve).isStale||this.updateResult()},r))},wr=new WeakSet,os=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(u(this,ne)):this.options.refetchInterval)??!1},xr=new WeakSet,as=function(e){W(this,Sr,us).call(this),P(this,ot,e),!(At||this.options.enabled===!1||!Cn(u(this,ot))||u(this,ot)===0)&&P(this,xt,setInterval(()=>{(this.options.refetchIntervalInBackground||Pn.isFocused())&&W(this,Et,Or).call(this)},u(this,ot)))},Er=new WeakSet,cs=function(){W(this,vr,is).call(this),W(this,xr,as).call(this,W(this,wr,os).call(this))},_r=new WeakSet,ls=function(){u(this,wt)&&(clearTimeout(u(this,wt)),P(this,wt,void 0))},Sr=new WeakSet,us=function(){u(this,xt)&&(clearInterval(u(this,xt)),P(this,xt,void 0))},kr=new WeakSet,hs=function(){const e=u(this,xe).getQueryCache().build(u(this,xe),this.options);if(e===u(this,ne))return;const r=u(this,ne);P(this,ne,e),P(this,gr,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},nn=new WeakSet,na=function(e){ye.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(u(this,ve))}),u(this,xe).getQueryCache().notify({query:u(this,ne),type:"observerResultsUpdated"})})},Ho);function Cc(t,e){return e.enabled!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Hi(t,e){return Cc(t,e)||t.state.data!==void 0&&Ln(t,e,e.refetchOnMount)}function Ln(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Nn(t,e)}return!1}function Vi(t,e,r,n){return(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&Nn(t,r)}function Nn(t,e){return e.enabled!==!1&&t.isStaleByTime(e.staleTime)}function Oc(t,e){return!An(t.getCurrentResult(),e)}var Qi=ge.createContext(void 0),zi=t=>{const e=ge.useContext(Qi);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Ac=({client:t,children:e})=>(ge.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),R.jsx(Qi.Provider,{value:t,children:e})),Wi=ge.createContext(!1),Tc=()=>ge.useContext(Wi);Wi.Provider;function Rc(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Pc=ge.createContext(Rc()),$c=()=>ge.useContext(Pc);function Mc(t,e){return typeof t=="function"?t(...e):!!t}var Lc=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},Nc=t=>{ge.useEffect(()=>{t.clearReset()},[t])},jc=({result:t,errorResetBoundary:e,throwOnError:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&Mc(r,[t.error,n]),Dc=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Bc=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,Ic=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Fc(t,e,r){if(process.env.NODE_ENV!=="production"&&(typeof t!="object"||Array.isArray(t)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=zi(r),s=Tc(),i=$c(),o=n.defaultQueryOptions(t);o._optimisticResults=s?"isRestoring":"optimistic",Dc(o),Lc(o,i),Nc(i);const[a]=ge.useState(()=>new e(n,o)),l=a.getOptimisticResult(o);if(ge.useSyncExternalStore(ge.useCallback(f=>{const h=s?()=>{}:a.subscribe(ye.batchCalls(f));return a.updateResult(),h},[a,s]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ge.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),Bc(o,l))throw Ic(o,a,i);if(jc({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash)}))throw l.error;return o.notifyOnChangeProps?l:a.trackResult(l)}function Yi(t,e){return Fc(t,kc,e)}const Ne=Object.create(null);Ne.open="0",Ne.close="1",Ne.ping="2",Ne.pong="3",Ne.message="4",Ne.upgrade="5",Ne.noop="6";const Hr=Object.create(null);Object.keys(Ne).forEach(t=>{Hr[Ne[t]]=t});const jn={type:"error",data:"parser error"},Ki=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Gi=typeof ArrayBuffer=="function",Xi=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Dn=({type:t,data:e},r,n)=>Ki&&e instanceof Blob?r?n(e):Ji(e,n):Gi&&(e instanceof ArrayBuffer||Xi(e))?r?n(e):Ji(new Blob([e]),n):n(Ne[t]+(e||"")),Ji=(t,e)=>{const r=new FileReader;return r.onload=function(){const n=r.result.split(",")[1];e("b"+(n||""))},r.readAsDataURL(t)};function Zi(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Bn;function Uc(t,e){if(Ki&&t.data instanceof Blob)return t.data.arrayBuffer().then(Zi).then(e);if(Gi&&(t.data instanceof ArrayBuffer||Xi(t.data)))return e(Zi(t.data));Dn(t,!1,r=>{Bn||(Bn=new TextEncoder),e(Bn.encode(r))})}const eo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ur=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t{let e=t.length*.75,r=t.length,n,s=0,i,o,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const f=new ArrayBuffer(e),h=new Uint8Array(f);for(n=0;n>4,h[s++]=(o&15)<<4|a>>2,h[s++]=(a&3)<<6|l&63;return f},Hc=typeof ArrayBuffer=="function",In=(t,e)=>{if(typeof t!="string")return{type:"message",data:to(t,e)};const r=t.charAt(0);return r==="b"?{type:"message",data:Vc(t.substring(1),e)}:Hr[r]?t.length>1?{type:Hr[r],data:t.substring(1)}:{type:Hr[r]}:jn},Vc=(t,e)=>{if(Hc){const r=qc(t);return to(r,e)}else return{base64:!0,data:t}},to=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},ro="",Qc=(t,e)=>{const r=t.length,n=new Array(r);let s=0;t.forEach((i,o)=>{Dn(i,!1,a=>{n[o]=a,++s===r&&e(n.join(ro))})})},zc=(t,e)=>{const r=t.split(ro),n=[];for(let s=0;s{const n=r.length;let s;if(n<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,n);else if(n<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}t.data&&typeof t.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(r)})}})}let Fn;function Vr(t){return t.reduce((e,r)=>e+r.length,0)}function Qr(t,e){if(t[0].length===e)return t.shift();const r=new Uint8Array(e);let n=0;for(let s=0;sMath.pow(2,21)-1){a.enqueue(jn);break}s=h*Math.pow(2,32)+f.getUint32(4),n=3}else{if(Vr(r)t){a.enqueue(jn);break}}}})}const no=4;function le(t){if(t)return Kc(t)}function Kc(t){for(var e in le.prototype)t[e]=le.prototype[e];return t}le.prototype.on=le.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},le.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},le.prototype.off=le.prototype.removeListener=le.prototype.removeAllListeners=le.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var n,s=0;s(t.hasOwnProperty(n)&&(r[n]=t[n]),r),{})}const Gc=Ce.setTimeout,Xc=Ce.clearTimeout;function zr(t,e){e.useNativeTimers?(t.setTimeoutFn=Gc.bind(Ce),t.clearTimeoutFn=Xc.bind(Ce)):(t.setTimeoutFn=Ce.setTimeout.bind(Ce),t.clearTimeoutFn=Ce.clearTimeout.bind(Ce))}const Jc=1.33;function Zc(t){return typeof t=="string"?el(t):Math.ceil((t.byteLength||t.size)*Jc)}function el(t){let e=0,r=0;for(let n=0,s=t.length;n=57344?r+=3:(n++,r+=4);return r}function tl(t){let e="";for(let r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}function rl(t){let e={},r=t.split("&");for(let n=0,s=r.length;n0);return e}function lo(){const t=co(+new Date);return t!==ao?(oo=0,ao=t):t+"."+co(oo++)}for(;Wr{this.readyState="paused",e()};if(this.polling||!this.writable){let n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||r()})),this.writable||(n++,this.once("drain",function(){--n||r()}))}else r()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const r=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};zc(e,this.socket.binaryType).forEach(r),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Qc(e,r=>{this.doWrite(r,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",r=this.query||{};return this.opts.timestampRequests!==!1&&(r[this.opts.timestampParam]=lo()),!this.supportsBinary&&!r.sid&&(r.b64=1),this.createUri(e,r)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new je(this.uri(),e)}doWrite(e,r){const n=this.request({method:"POST",data:e});n.on("success",r),n.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(r,n)=>{this.onError("xhr poll error",r,n)}),this.pollXhr=e}}class je extends le{constructor(e,r){super(),zr(this,r),this.opts=r,this.method=r.method||"GET",this.uri=e,this.data=r.data!==void 0?r.data:null,this.create()}create(){var e;const r=so(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");r.xdomain=!!this.opts.xd;const n=this.xhr=new ho(r);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&n.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var s;n.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(n)),n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=je.requestsCount++,je.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=ol,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete je.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(je.requestsCount=0,je.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fo);else if(typeof addEventListener=="function"){const t="onpagehide"in Ce?"pagehide":"unload";addEventListener(t,fo,!1)}}function fo(){for(let t in je.requests)je.requests.hasOwnProperty(t)&&je.requests[t].abort()}const Hn=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,r)=>r(e,0),Yr=Ce.WebSocket||Ce.MozWebSocket,po=!0,ll="arraybuffer",yo=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ul extends Un{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),r=this.opts.protocols,n=yo?{}:so(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=po&&!yo?r?new Yr(e,r):new Yr(e):new Yr(e,r,n)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r{const o={};try{po&&this.ws.send(i)}catch{}s&&Hn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",r=this.query||{};return this.opts.timestampRequests&&(r[this.opts.timestampParam]=lo()),this.supportsBinary||(r.b64=1),this.createUri(e,r)}check(){return!!Yr}}class hl extends Un{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const r=Yc(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(r).getReader(),s=Wc();s.readable.pipeTo(e.writable),this.writer=s.writable.getWriter();const i=()=>{n.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let r=0;r{s&&Hn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const fl={websocket:ul,webtransport:hl,polling:cl},dl=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,pl=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Vn(t){if(t.length>2e3)throw"URI too long";const e=t,r=t.indexOf("["),n=t.indexOf("]");r!=-1&&n!=-1&&(t=t.substring(0,r)+t.substring(r,n).replace(/:/g,";")+t.substring(n,t.length));let s=dl.exec(t||""),i={},o=14;for(;o--;)i[pl[o]]=s[o]||"";return r!=-1&&n!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=yl(i,i.path),i.queryKey=ml(i,i.query),i}function yl(t,e){const r=/\/{2,9}/g,n=e.replace(r,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function ml(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,s,i){s&&(r[s]=i)}),r}let mo=class Yt extends le{constructor(e,r={}){super(),this.binaryType=ll,this.writeBuffer=[],e&&typeof e=="object"&&(r=e,e=null),e?(e=Vn(e),r.hostname=e.host,r.secure=e.protocol==="https"||e.protocol==="wss",r.port=e.port,e.query&&(r.query=e.query)):r.host&&(r.hostname=Vn(r.host).host),zr(this,r),this.secure=r.secure!=null?r.secure:typeof location<"u"&&location.protocol==="https:",r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.hostname=r.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=r.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=r.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},r),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=rl(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const r=Object.assign({},this.opts.query);r.EIO=no,r.transport=e,this.id&&(r.sid=this.id);const n=Object.assign({},this.opts,{query:r,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new fl[e](n)}open(){let e;if(this.opts.rememberUpgrade&&Yt.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",r=>this.onClose("transport close",r))}probe(e){let r=this.createTransport(e),n=!1;Yt.priorWebsocketSuccess=!1;const s=()=>{n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",p=>{if(!n)if(p.type==="pong"&&p.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",r),!r)return;Yt.priorWebsocketSuccess=r.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(h(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})}else{const d=new Error("probe error");d.transport=r.name,this.emitReserved("upgradeError",d)}}))};function i(){n||(n=!0,h(),r.close(),r=null)}const o=p=>{const d=new Error("probe error: "+p);d.transport=r.name,i(),this.emitReserved("upgradeError",d)};function a(){o("transport closed")}function l(){o("socket closed")}function f(p){r&&p.name!==r.name&&i()}const h=()=>{r.removeListener("open",s),r.removeListener("error",o),r.removeListener("close",a),this.off("close",l),this.off("upgrading",f)};r.once("open",s),r.once("error",o),r.once("close",a),this.once("close",l),this.once("upgrading",f),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||r.open()},200):r.open()}onOpen(){if(this.readyState="open",Yt.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const r=this.upgrades.length;for(;e{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let r=1;for(let n=0;n0&&r>this.maxPayload)return this.writeBuffer.slice(0,n);r+=2}return this.writeBuffer}write(e,r,n){return this.sendPacket("message",e,r,n),this}send(e,r,n){return this.sendPacket("message",e,r,n),this}sendPacket(e,r,n,s){if(typeof r=="function"&&(s=r,r=void 0),typeof n=="function"&&(s=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const i={type:e,data:r,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},r=()=>{this.off("upgrade",r),this.off("upgradeError",r),e()},n=()=>{this.once("upgrade",r),this.once("upgradeError",r)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}onError(e){Yt.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,r){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,r),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const r=[];let n=0;const s=e.length;for(;ntypeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,go=Object.prototype.toString,wl=typeof Blob=="function"||typeof Blob<"u"&&go.call(Blob)==="[object BlobConstructor]",xl=typeof File=="function"||typeof File<"u"&&go.call(File)==="[object FileConstructor]";function Qn(t){return bl&&(t instanceof ArrayBuffer||vl(t))||wl&&t instanceof Blob||xl&&t instanceof File}function Kr(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let r=0,n=t.length;r=0&&t.num{delete this.acks[e];for(let a=0;a{this.io.clearTimeoutFn(i),r.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...r){return new Promise((n,s)=>{const i=(o,a)=>o?s(o):n(a);i.withError=!0,r.push(i),this.emit(e,...r)})}_addToQueue(e){let r;typeof e[e.length-1]=="function"&&(r=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...i)=>n!==this._queue[0]?void 0:(s!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),r&&r(s)):(this._queue.shift(),r&&r(null,...i)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const r=this._queue[0];r.pending&&!e||(r.pending=!0,r.tryCount++,this.flags=r.flags,this.emit.apply(this,r.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:Q.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,r){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,r),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case Q.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Q.EVENT:case Q.BINARY_EVENT:this.onevent(e);break;case Q.ACK:case Q.BINARY_ACK:this.onack(e);break;case Q.DISCONNECT:this.ondisconnect();break;case Q.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const r=e.data||[];e.id!=null&&r.push(this.ack(e.id)),this.connected?this.emitEvent(r):this.receiveBuffer.push(Object.freeze(r))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const r=this._anyListeners.slice();for(const n of r)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const r=this;let n=!1;return function(...s){n||(n=!0,r.packet({type:Q.ACK,id:e,data:s}))}}onack(e){const r=this.acks[e.id];typeof r=="function"&&(delete this.acks[e.id],r.withError&&e.data.unshift(null),r.apply(this,e.data))}onconnect(e,r){this.id=e,this.recovered=r&&this._pid===r,this._pid=r,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Q.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const r=this._anyListeners;for(let n=0;n0&&t.jitter<=1?t.jitter:0,this.attempts=0}Tt.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=Math.floor(e*10)&1?t+r:t-r}return Math.min(t,this.max)|0},Tt.prototype.reset=function(){this.attempts=0},Tt.prototype.setMin=function(t){this.ms=t},Tt.prototype.setMax=function(t){this.max=t},Tt.prototype.setJitter=function(t){this.jitter=t};class Kn extends le{constructor(e,r){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(r=e,e=void 0),r=r||{},r.path=r.path||"/socket.io",this.opts=r,zr(this,r),this.reconnection(r.reconnection!==!1),this.reconnectionAttempts(r.reconnectionAttempts||1/0),this.reconnectionDelay(r.reconnectionDelay||1e3),this.reconnectionDelayMax(r.reconnectionDelayMax||5e3),this.randomizationFactor((n=r.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Tt({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(r.timeout==null?2e4:r.timeout),this._readyState="closed",this.uri=e;const s=r.parser||Al;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=r.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var r;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(r=this.backoff)===null||r===void 0||r.setMin(e),this)}randomizationFactor(e){var r;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(r=this.backoff)===null||r===void 0||r.setJitter(e),this)}reconnectionDelayMax(e){var r;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(r=this.backoff)===null||r===void 0||r.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new mo(this.uri,this.opts);const r=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const s=Pe(r,"open",function(){n.onopen(),e&&e()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=Pe(r,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),r.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Pe(e,"ping",this.onping.bind(this)),Pe(e,"data",this.ondata.bind(this)),Pe(e,"error",this.onerror.bind(this)),Pe(e,"close",this.onclose.bind(this)),Pe(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(r){this.onclose("parse error",r)}}ondecoded(e){Hn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,r){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new vo(this,e,r),this.nsps[e]=n),n}_destroy(e){const r=Object.keys(this.nsps);for(const n of r)if(this.nsps[n].active)return;this._close()}_packet(e){const r=this.encoder.encode(e);for(let n=0;ne()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,r){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,r),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const r=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},r);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const hr={};function Gr(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const r=gl(t,e.path||"/socket.io"),n=r.source,s=r.id,i=r.path,o=hr[s]&&i in hr[s].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return a?l=new Kn(n,e):(hr[s]||(hr[s]=new Kn(n,e)),l=hr[s]),r.query&&!e.query&&(e.query=r.queryKey),l.socket(r.path,e)}Object.assign(Gr,{Manager:Kn,Socket:vo,io:Gr,connect:Gr});var Rl=typeof lt=="object"&<&<.Object===Object&<,Pl=typeof self=="object"&&self&&self.Object===Object&&self;Rl||Pl||Function("return this")();function $l(t){const e=b.useRef(t);e.current=t,b.useEffect(()=>()=>{e.current()},[])}const wo=b.createContext({}),Ml=({children:t,channelId:e,onEndBot:r,isTest:n=!1,onClose:s,isShowClose:i=!0,isForLiveChat:o,userId:a,customStyles:l,isForPreview:f,isForManager:h,adminId:p,...d})=>{const[y,w]=b.useState(!1),[_,g]=b.useState(h?void 0:l),k=zi(),M=b.useMemo(()=>new URLSearchParams(window.location.search),[]),I=b.useMemo(()=>a||Se(),[a]),j=b.useMemo(()=>e||M.get("channelId")||"",[e,M]),$=b.useRef(Gr(d.API_URL||wn,{autoConnect:!1,transports:["websocket"],query:{userId:p?`${I}_${p}`:I}})),{data:K,isLoading:oe}=Yi({queryKey:["messages",j,a||Se()],queryFn:async()=>{try{return f?[{isBot:!0,message:"Hello, how can I help you?",createdAt:new Date().toISOString()},{isBot:!1,message:"I want to know more about your product",userId:Se(),createdAt:new Date().toISOString()}]:(await(await fetch(`${URL}/api/conversation-live-chat/${a||Se()}/${j}`)).json()).data}catch{return[]}},initialData:[]}),{data:D}=Yi({queryKey:["custom-style",j,a||Se()],queryFn:async()=>{try{return(await(await fetch(`${d.API_URL||wn}/api/custom-chatbox/${j}`)).json()).data}catch{return}},enabled:!n&&!f&&!h}),X=b.useCallback(({message:m,cb:T,extraData:S,type:x})=>{const v=m.trim();if(v.length===0)return;const O=Ri(j,a),C={message:x==="list-button"?S||"":v,userId:p||a||Se(),template:{},createdAt:new Date().toISOString(),isTest:n};$.current.emit(tr.MESSAGE,{message:v,address:O,isTest:n,createdAt:C.createdAt}),k.setQueryData(["messages",j,a||Se()],N=>[...N,C]),T&&T(C)},[j,p,n,k,a]),J=b.useCallback(()=>{window.parent&&window.parent.postMessage({type:"TOGGLE_CHAT"},"*"),s==null||s()},[s]),H=b.useCallback(()=>{f||($.current.emit(tr.MESSAGE,{type:"event",typeName:"endConversation",address:Ri(j,a),isTest:n,message:""}),w(!1),k.setQueryData(["messages",j,a||Se()],()=>[]))},[j,f,n,k,a]);return $l(()=>{$.current.disconnect()}),b.useEffect(()=>{if(f)return;const m=$.current;return m.connect(),m.on(tr.MESSAGE,T=>{var S;((S=T.template)==null?void 0:S.type)==="list-button"?w(!0):w(!1),k.setQueryData(["messages",j,a||Se()],x=>[...x,T].filter(v=>v.userId!=="typing"))}),m.on(tr.TYPING,()=>{k.setQueryData(["messages",j,a||Se()],T=>[...T,{userId:"typing"}])}),m.on(tr.STOP_TYPING,()=>{k.setQueryData(["messages",j,a||Se()],T=>T.filter(S=>S.userId!=="typing"))}),()=>{m.disconnect()}},[j,k,a,f]),b.useEffect(()=>{f&&w(!0)},[f]),b.useEffect(()=>{D&&!h&&g(D)},[D,h]),b.useEffect(()=>{l&&!h&&g(l)},[l,h]),R.jsx(wo.Provider,{value:{socket:$.current,messages:K,channelId:j,onEndBot:r,isTest:n,handleSendMessage:X,handleClose:J,disableInput:y,isShowClose:i,isLoadingMessages:oe,isForLiveChat:o,userId:a,handleReload:H,customStyles:_,adminId:p,isForManager:h},children:t})},ft=()=>{const t=b.useContext(wo);if(!t)throw new Error("useSocket must be used within SocketProvider");return t};function xo(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;ea(i)))==null?void 0:o.classGroupId}const _o=/^\[(.+)\]$/;function jl(t){if(_o.test(t)){const e=_o.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}}function Dl(t){const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return Il(Object.entries(t.classGroups),r).forEach(([i,o])=>{Xn(o,n,i,e)}),n}function Xn(t,e,r,n){t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:So(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(Bl(s)){Xn(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Xn(o,So(e,i),r,n)})})}function So(t,e){let r=t;return e.split(Gn).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r}function Bl(t){return t.isThemeGetter}function Il(t,e){return e?t.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[r,s]}):t}function Fl(t){if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;function s(i,o){r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)}return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}}const ko="!";function Ul(t){const e=t.separator,r=e.length===1,n=e[0],s=e.length;return function(o){const a=[];let l=0,f=0,h;for(let _=0;_f?h-f:void 0;return{modifiers:a,hasImportantModifier:d,baseClassName:y,maybePostfixModifierPosition:w}}}function ql(t){if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e}function Hl(t){return{cache:Fl(t.cacheSize),splitModifiers:Ul(t),...Nl(t)}}const Vl=/\s+/;function Ql(t,e){const{splitModifiers:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=new Set;return t.trim().split(Vl).map(o=>{const{modifiers:a,hasImportantModifier:l,baseClassName:f,maybePostfixModifierPosition:h}=r(o);let p=n(h?f.substring(0,h):f),d=!!h;if(!p){if(!h)return{isTailwindClass:!1,originalClassName:o};if(p=n(f),!p)return{isTailwindClass:!1,originalClassName:o};d=!1}const y=ql(a).join(":");return{isTailwindClass:!0,modifierId:l?y+ko:y,classGroupId:p,originalClassName:o,hasPostfixModifier:d}}).reverse().filter(o=>{if(!o.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:f}=o,h=a+l;return i.has(h)?!1:(i.add(h),s(l,f).forEach(p=>i.add(a+p)),!0)}).reverse().map(o=>o.originalClassName).join(" ")}function zl(){let t=0,e,r,n="";for(;tp(h),t());return r=Hl(f),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const f=n(l);if(f)return f;const h=Ql(l,r);return s(l,h),h}return function(){return i(zl.apply(null,arguments))}}function se(t){const e=r=>r[t]||[];return e.isThemeGetter=!0,e}const Oo=/^\[(?:([a-z-]+):)?(.+)\]$/i,Yl=/^\d+\/\d+$/,Kl=new Set(["px","full","screen"]),Gl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xl=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Zl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function ze(t){return dt(t)||Kl.has(t)||Yl.test(t)}function Ze(t){return Rt(t,"length",cu)}function dt(t){return!!t&&!Number.isNaN(Number(t))}function Xr(t){return Rt(t,"number",dt)}function fr(t){return!!t&&Number.isInteger(Number(t))}function tu(t){return t.endsWith("%")&&dt(t.slice(0,-1))}function q(t){return Oo.test(t)}function et(t){return Gl.test(t)}const ru=new Set(["length","size","percentage"]);function nu(t){return Rt(t,ru,Ao)}function su(t){return Rt(t,"position",Ao)}const iu=new Set(["image","url"]);function ou(t){return Rt(t,iu,uu)}function au(t){return Rt(t,"",lu)}function dr(){return!0}function Rt(t,e,r){const n=Oo.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1}function cu(t){return Xl.test(t)&&!Jl.test(t)}function Ao(){return!1}function lu(t){return Zl.test(t)}function uu(t){return eu.test(t)}function hu(){const t=se("colors"),e=se("spacing"),r=se("blur"),n=se("brightness"),s=se("borderColor"),i=se("borderRadius"),o=se("borderSpacing"),a=se("borderWidth"),l=se("contrast"),f=se("grayscale"),h=se("hueRotate"),p=se("invert"),d=se("gap"),y=se("gradientColorStops"),w=se("gradientColorStopPositions"),_=se("inset"),g=se("margin"),k=se("opacity"),M=se("padding"),I=se("saturate"),j=se("scale"),$=se("sepia"),K=se("skew"),oe=se("space"),D=se("translate"),X=()=>["auto","contain","none"],J=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto",q,e],m=()=>[q,e],T=()=>["",ze,Ze],S=()=>["auto",dt,q],x=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],v=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],C=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",q],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[dt,Xr],Z=()=>[dt,q];return{cacheSize:500,separator:":",theme:{colors:[dr],spacing:[ze,Ze],blur:["none","",et,q],brightness:z(),borderColor:[t],borderRadius:["none","","full",et,q],borderSpacing:m(),borderWidth:T(),contrast:z(),grayscale:N(),hueRotate:Z(),invert:N(),gap:m(),gradientColorStops:[t],gradientColorStopPositions:[tu,Ze],inset:H(),margin:H(),opacity:z(),padding:m(),saturate:z(),scale:z(),sepia:N(),skew:Z(),space:m(),translate:m()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[et]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...x(),q]}],overflow:[{overflow:J()}],"overflow-x":[{"overflow-x":J()}],"overflow-y":[{"overflow-y":J()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fr,q]}],basis:[{basis:H()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",fr,q]}],"grid-cols":[{"grid-cols":[dr]}],"col-start-end":[{col:["auto",{span:["full",fr,q]},q]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[dr]}],"row-start-end":[{row:["auto",{span:[fr,q]},q]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[oe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[oe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,e]}],"min-w":[{"min-w":[q,e,"min","max","fit"]}],"max-w":[{"max-w":[q,e,"none","full","min","max","fit","prose",{screen:[et]},et]}],h:[{h:[q,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,e,"auto","min","max","fit"]}],"font-size":[{text:["base",et,Ze]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Xr]}],"font-family":[{font:[dr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",q]}],"line-clamp":[{"line-clamp":["none",dt,Xr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ze,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...v(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ze,Ze]}],"underline-offset":[{"underline-offset":["auto",ze,q]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...x(),su]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",nu]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ou]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...v(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:v()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...v()]}],"outline-offset":[{"outline-offset":[ze,q]}],"outline-w":[{outline:[ze,Ze]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ze,Ze]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",et,au]}],"shadow-color":[{shadow:[dr]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":O()}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",et,q]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[p]}],saturate:[{saturate:[I]}],sepia:[{sepia:[$]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[$]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",q]}],duration:[{duration:Z()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:Z()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[fr,q]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[K]}],"skew-y":[{"skew-y":[K]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ze,Ze,Xr]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const fu=Wl(hu);function pt(...t){return fu(Ll(t))}var To={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(lt,function(){var r=1e3,n=6e4,s=36e5,i="millisecond",o="second",a="minute",l="hour",f="day",h="week",p="month",d="quarter",y="year",w="date",_="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(S){var x=["th","st","nd","rd"],v=S%100;return"["+S+(x[(v-20)%10]||x[v]||x[0])+"]"}},I=function(S,x,v){var O=String(S);return!O||O.length>=x?S:""+Array(x+1-O.length).join(v)+S},j={s:I,z:function(S){var x=-S.utcOffset(),v=Math.abs(x),O=Math.floor(v/60),C=v%60;return(x<=0?"+":"-")+I(O,2,"0")+":"+I(C,2,"0")},m:function S(x,v){if(x.date()1)return S(B[0])}else{var z=x.name;K[z]=x,C=z}return!O&&C&&($=C),C||!O&&$},J=function(S,x){if(D(S))return S.clone();var v=typeof x=="object"?x:{};return v.date=S,v.args=arguments,new m(v)},H=j;H.l=X,H.i=D,H.w=function(S,x){return J(S,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var m=function(){function S(v){this.$L=X(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[oe]=!0}var x=S.prototype;return x.parse=function(v){this.$d=function(O){var C=O.date,N=O.utc;if(C===null)return new Date(NaN);if(H.u(C))return new Date;if(C instanceof Date)return new Date(C);if(typeof C=="string"&&!/Z$/i.test(C)){var B=C.match(g);if(B){var z=B[2]-1||0,Z=(B[7]||"0").substring(0,3);return N?new Date(Date.UTC(B[1],z,B[3]||1,B[4]||0,B[5]||0,B[6]||0,Z)):new Date(B[1],z,B[3]||1,B[4]||0,B[5]||0,B[6]||0,Z)}}return new Date(C)}(v),this.init()},x.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},x.$utils=function(){return H},x.isValid=function(){return this.$d.toString()!==_},x.isSame=function(v,O){var C=J(v);return this.startOf(O)<=C&&C<=this.endOf(O)},x.isAfter=function(v,O){return J(v)T.jsx("slot",{children:T.jsx("div",{className:t.v0,children:T.jsxs("div",{className:t.v1,children:[T.jsx("span",{className:t.v2,children:t.v3}),T.jsxs("div",{className:t.v4,style:t.v5,children:[t.v6,t.v7]})]})})}),{name:"Message_1",portals:["v3","v6","v7"]}),en=({message:t,children:e})=>{const{customStyles:r,adminId:n,isForManager:s}=ft(),i=t.isBot;return T.jsx(wu,{v0:pt("flex min-h-9 justify-end pl-8",{"justify-start pr-8 pl-0":i}),v1:pt("flex flex-col gap-1 w-full items-end",{"items-start":i}),v2:pt("flex items-center text-xs text-muted-foreground",{"justify-end":!i}),v3:s?t.isBot?"From bot":"From user":null,v4:pt("bg-primary rounded-md text-white flex items-center justify-end w-max p-2 max-w-72 text-wrap ",{"bg-muted text-neutral-900 justify-start":i}),v5:{wordBreak:"break-word",backgroundColor:i||r==null?void 0:r.color},v6:t.message,v7:e})};function tn(){return tn=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>xu(r,e))}const Ro=b.forwardRef((t,e)=>{const{children:r,...n}=t,s=b.Children.toArray(r),i=s.find(Su);if(i){const o=i.props.children,a=s.map(l=>l===i?b.Children.count(o)>1?b.Children.only(null):b.isValidElement(o)?o.props.children:null:l);return b.createElement(Jn,tn({},n,{ref:e}),b.isValidElement(o)?b.cloneElement(o,void 0,a):null)}return b.createElement(Jn,tn({},n,{ref:e}),r)});Ro.displayName="Slot";const Jn=b.forwardRef((t,e)=>{const{children:r,...n}=t;return b.isValidElement(r)?b.cloneElement(r,{...ku(n,r.props),ref:e?Eu(e,r.ref):r.ref}):b.Children.count(r)>1?b.Children.only(null):null});Jn.displayName="SlotClone";const _u=({children:t})=>b.createElement(b.Fragment,null,t);function Su(t){return b.isValidElement(t)&&t.type===_u}function ku(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{i(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function Po(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;etypeof t=="boolean"?"".concat(t):t===0?"0":t,Mo=Cu,Ou=((t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return Mo(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(f=>{const h=r==null?void 0:r[f],p=i==null?void 0:i[f];if(h===null)return null;const d=$o(h)||$o(p);return s[f][d]}),a=r&&Object.entries(r).reduce((f,h)=>{let[p,d]=h;return d===void 0||(f[p]=d),f},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((f,h)=>{let{class:p,className:d,...y}=h;return Object.entries(y).every(w=>{let[_,g]=w;return Array.isArray(g)?g.includes({...i,...a}[_]):{...i,...a}[_]===g})?[...f,p,d]:f},[]);return Mo(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)})("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",message:"bg-background shadow-sm border text-primary border-primary hover:bg-primary/10 !rounded-full"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),rn=ge.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},i)=>{const o=n?Ro:"button";return T.jsx(o,{className:pt(Ou({variant:e,size:r,className:t})),ref:i,...s})});rn.displayName="Button";const Au=({message:t})=>{const{handleSendMessage:e,customStyles:r}=ft(),n=r!=null&&r.color?kn(r.color):null;return T.jsxs("div",{className:"space-y-2","data-buttons":!0,children:[T.jsx(en,{message:t}),T.jsx("div",{className:"flex gap-1 items-center w-[80%] justify-center flex-wrap mx-auto",children:t.template.data.map(s=>T.jsx(rn,{variant:"message",size:"sm",onClick:()=>{if(s.type==="postback"){if(!s.payload)return;e({message:s.payload,extraData:s.title,type:"list-button"})}if(s.type==="web_url"){if(!s.url)return;Pi(s.url)}},style:{"--primary":n?`${n.h} ${n.s}% ${n.l}%`:void 0},children:s.title}))})]})},Tu=Br(t=>T.jsxs("div",{className:"w-full space-y-1 text-center",children:[T.jsx("img",{src:t.v0,alt:t.v1,className:"rounded-md object-cover h-full w-full"}),T.jsx("h3",{className:"font-semibold",children:t.v2}),T.jsx("p",{className:"text-sm",children:t.v3}),t.v4]}),{name:"Card_1",portals:["v2","v3","v4"]}),Ru=({card:t})=>{const{handleSendMessage:e,customStyles:r}=ft(),n=r!=null&&r.color?kn(r.color):null;return T.jsx(Tu,{v0:t.image_url,v1:t.title,v2:t.title,v3:t.subtitle,v4:t.buttons&&t.buttons.length>0&&T.jsx("div",{className:"w-full mt-2",children:t.buttons.map((s,i)=>T.jsx(rn,{variant:"message",className:"!rounded-md w-full",onClick:()=>{if(s.type==="postback"){if(!s.payload)return;e({message:s.payload,extraData:s.title,type:"list-button"})}if(s.type==="web_url"){if(!s.url)return;Pi(s.url)}},style:{"--primary":n?`${n.h} ${n.s}% ${n.l}%`:void 0},children:s.title},i))})})},Pu=({message:t})=>T.jsx("div",{className:"flex flex-col space-y-2 gap-1",children:t.template.data.map((e,r)=>T.jsx(en,{message:t,children:T.jsx(Ru,{card:e})},r))}),$u=()=>T.jsx(en,{message:{isBot:!0,message:"",template:{},userId:"typing",createdAt:new Date().toISOString()},children:T.jsxs("div",{className:"flex space-x-1 h-full flex-1 items-center",children:[T.jsx("div",{className:"w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.3s]"}),T.jsx("div",{className:"w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.15s]"}),T.jsx("div",{className:"w-1 h-1 bg-neutral-800 rounded-full animate-bounce"})]})}),Mu=()=>{const t=b.useRef(null),{messages:e,isLoadingMessages:r}=ft();b.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth"})},[e]);const n=(s,i)=>{var o,a;return(s==null?void 0:s.userId)==="typing"?T.jsx($u,{}):((o=s==null?void 0:s.template)==null?void 0:o.type)==="list-button"?T.jsx(Au,{message:s},`${s.createdAt}+${i}`):((a=s==null?void 0:s.template)==null?void 0:a.type)==="list-card"?T.jsx(Pu,{message:s},`${s.createdAt}+${i}`):T.jsx(en,{message:s},`${s.createdAt}+${i}`)};return T.jsx("div",{className:"p-2 flex-1 pr-3 overflow-y-auto",children:r?T.jsx("div",{children:T.jsx(mu,{className:"animate-spin w-4 h-4"})}):T.jsxs("div",{className:"flex flex-col gap-1",children:[e.length>0&&T.jsx("div",{className:"text-center text-xs text-neutral-500 py-2",children:Jr(e[0].createdAt).format("DD/MM/YYYY HH:mm")}),e.map((s,i)=>T.jsxs(b.Fragment,{children:[i>0&&Jr(s.createdAt).diff(Jr(e[i-1].createdAt),"minutes")>10&&T.jsx("div",{className:"text-center text-xs text-neutral-500 py-2",children:Jr(s.createdAt).format("DD/MM/YYYY HH:mm")}),n(s,i)]},i)),T.jsx("div",{ref:t})]})})},Lu=Br(t=>T.jsx("header",{className:"flex items-center bg-primary select-none h-[3.75rem]",style:t.v0,children:T.jsxs("div",{className:"flex items-center px-2 gap-2 justify-between w-full",children:[T.jsxs("div",{className:"flex items-center p-2 gap-2",children:[t.v1,T.jsx("span",{className:"font-medium text-white",children:t.v2})]}),T.jsxs("div",{className:"flex items-center gap-3",children:[t.v3,t.v4]})]})}),{name:"Header_1",portals:["v1","v2","v3","v4"]}),Nu=()=>{const{handleClose:t,isShowClose:e,handleReload:r,customStyles:n,isForManager:s}=ft();return T.jsx(Lu,{v0:{backgroundColor:n==null?void 0:n.color},v1:n!=null&&n.logoUrl?T.jsx("img",{src:n==null?void 0:n.logoUrl,alt:"logo",className:"w-10 h-10 rounded-full overflow-hidden object-cover"}):T.jsx("svg",{width:"40",height:"40",className:"text-neutral-700 fill-neutral-700 bg-neutral-700 rounded-full",children:T.jsx("text",{"text-anchor":"middle",x:"50%",y:"50%",dy:"0.35em",fill:"#ffffff","font-size":"1rem",children:"B"})}),v2:(n==null?void 0:n.name)||"DialogueBot",v3:!s&&T.jsx("div",{className:"w-6 h-6 flex items-center justify-center cursor-pointer",onClick:r,children:T.jsx(gu,{className:"w-4 h-4 text-white"})}),v4:e&&T.jsx("div",{className:"w-6 h-6 flex items-center justify-center cursor-pointer",onClick:t,children:T.jsx(vu,{className:"w-4 h-4 text-white"})})})},Lo=ge.forwardRef(({className:t,type:e,...r},n)=>T.jsx("input",{type:e,className:pt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...r}));Lo.displayName="Input";const ju=()=>{const{handleSendMessage:t,disableInput:e,customStyles:r}=ft(),[n,s]=b.useState(""),i=a=>{a.key==="Enter"&&(a.preventDefault(),t({message:n}),s(""))},o=r!=null&&r.color?kn(r.color):null;return T.jsxs("div",{className:"flex items-center py-2 px-3 gap-2 border-input border-t",children:[T.jsx(Lo,{className:"flex-1",placeholder:"Type a message...",value:n,onChange:a=>s(a.target.value),onKeyDown:i,disabled:e,style:{"--primary":o?`${o.h} ${o.s}% ${o.l}%`:void 0}}),T.jsx(rn,{size:"icon",className:"flex-shrink-0",onClick:()=>{t({message:n,cb:()=>s("")})},disabled:e,style:{"--primary":o?`${o.h} ${o.s}% ${o.l}%`:void 0},children:T.jsx(bu,{className:"w-4 h-4"})})]})},Du=new Sc,Bu=Br(t=>T.jsx("div",{className:t.v0,style:t.v1,children:T.jsxs("div",{className:"flex flex-col h-full overflow-hidden w-full flex-1",children:[t.v2,T.jsxs("div",{className:"flex-1 flex flex-col min-h-[1px]",children:[t.v3,t.v4]})]})}),{name:"ChatBox_1",portals:["v2","v3","v4"]}),Iu=({className:t})=>{const{customStyles:e,isForManager:r}=ft();return T.jsx(Bu,{v0:pt("select-none w-full h-screen flex flex-col shadow chatbox",t),v1:{width:e==null?void 0:e.windowSize.width,height:e==null?void 0:e.windowSize.height},v2:T.jsx(Nu,{}),v3:T.jsx(Mu,{}),v4:!r&&T.jsx(ju,{})})},Fu=t=>T.jsx(Ac,{client:Du,children:T.jsx(Ml,{...t,children:T.jsx(Iu,{className:t.className})})});ee.ChatBox=Fu,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})}); + */const vu=Zr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wu=Br(t=>R.jsx("slot",{children:R.jsx("div",{className:t.v0,children:R.jsxs("div",{className:t.v1,children:[R.jsx("span",{className:t.v2,children:t.v3}),R.jsxs("div",{className:t.v4,style:t.v5,children:[t.v6,t.v7]})]})})}),{name:"Message_1",portals:["v3","v6","v7"]}),en=({message:t,children:e})=>{const{customStyles:r,adminId:n,isForManager:s}=ft(),i=t.isBot;return R.jsx(wu,{v0:pt("flex min-h-9 justify-end pl-8",{"justify-start pr-8 pl-0":i}),v1:pt("flex flex-col gap-1 w-full items-end",{"items-start":i}),v2:pt("flex items-center text-xs text-muted-foreground",{"justify-end":!i}),v3:s?t.isBot?"From bot":"From user":null,v4:pt("bg-primary rounded-md text-white flex items-center justify-end w-max p-2 max-w-72 text-wrap ",{"bg-muted text-neutral-900 justify-start":i}),v5:{wordBreak:"break-word",backgroundColor:i||r==null?void 0:r.color},v6:t.message,v7:e})};function tn(){return tn=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>xu(r,e))}const Ro=b.forwardRef((t,e)=>{const{children:r,...n}=t,s=b.Children.toArray(r),i=s.find(Su);if(i){const o=i.props.children,a=s.map(l=>l===i?b.Children.count(o)>1?b.Children.only(null):b.isValidElement(o)?o.props.children:null:l);return b.createElement(Jn,tn({},n,{ref:e}),b.isValidElement(o)?b.cloneElement(o,void 0,a):null)}return b.createElement(Jn,tn({},n,{ref:e}),r)});Ro.displayName="Slot";const Jn=b.forwardRef((t,e)=>{const{children:r,...n}=t;return b.isValidElement(r)?b.cloneElement(r,{...ku(n,r.props),ref:e?Eu(e,r.ref):r.ref}):b.Children.count(r)>1?b.Children.only(null):null});Jn.displayName="SlotClone";const _u=({children:t})=>b.createElement(b.Fragment,null,t);function Su(t){return b.isValidElement(t)&&t.type===_u}function ku(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{i(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function Po(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;etypeof t=="boolean"?"".concat(t):t===0?"0":t,Mo=Cu,Ou=((t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return Mo(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(f=>{const h=r==null?void 0:r[f],p=i==null?void 0:i[f];if(h===null)return null;const d=$o(h)||$o(p);return s[f][d]}),a=r&&Object.entries(r).reduce((f,h)=>{let[p,d]=h;return d===void 0||(f[p]=d),f},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((f,h)=>{let{class:p,className:d,...y}=h;return Object.entries(y).every(w=>{let[_,g]=w;return Array.isArray(g)?g.includes({...i,...a}[_]):{...i,...a}[_]===g})?[...f,p,d]:f},[]);return Mo(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)})("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",message:"bg-background shadow-sm border text-primary border-primary hover:bg-primary/10 !rounded-full"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),rn=ge.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},i)=>{const o=n?Ro:"button";return R.jsx(o,{className:pt(Ou({variant:e,size:r,className:t})),ref:i,...s})});rn.displayName="Button";const Au=({message:t})=>{const{handleSendMessage:e,customStyles:r}=ft(),n=r!=null&&r.color?kn(r.color):null;return R.jsxs("div",{className:"space-y-2","data-buttons":!0,children:[R.jsx(en,{message:t}),R.jsx("div",{className:"flex gap-1 items-center w-[80%] justify-center flex-wrap mx-auto",children:t.template.data.map(s=>R.jsx(rn,{variant:"message",size:"sm",onClick:()=>{if(s.type==="postback"){if(!s.payload)return;e({message:s.payload,extraData:s.title,type:"list-button"})}if(s.type==="web_url"){if(!s.url)return;Pi(s.url)}},style:{"--primary":n?`${n.h} ${n.s}% ${n.l}%`:void 0},children:s.title}))})]})},Tu=Br(t=>R.jsxs("div",{className:"w-full space-y-1 text-center",children:[R.jsx("img",{src:t.v0,alt:t.v1,className:"rounded-md object-cover h-full w-full"}),R.jsx("h3",{className:"font-semibold",children:t.v2}),R.jsx("p",{className:"text-sm",children:t.v3}),t.v4]}),{name:"Card_1",portals:["v2","v3","v4"]}),Ru=({card:t})=>{const{handleSendMessage:e,customStyles:r}=ft(),n=r!=null&&r.color?kn(r.color):null;return R.jsx(Tu,{v0:t.image_url,v1:t.title,v2:t.title,v3:t.subtitle,v4:t.buttons&&t.buttons.length>0&&R.jsx("div",{className:"w-full mt-2",children:t.buttons.map((s,i)=>R.jsx(rn,{variant:"message",className:"!rounded-md w-full",onClick:()=>{if(s.type==="postback"){if(!s.payload)return;e({message:s.payload,extraData:s.title,type:"list-button"})}if(s.type==="web_url"){if(!s.url)return;Pi(s.url)}},style:{"--primary":n?`${n.h} ${n.s}% ${n.l}%`:void 0},children:s.title},i))})})},Pu=({message:t})=>R.jsx("div",{className:"flex flex-col space-y-2 gap-1",children:t.template.data.map((e,r)=>R.jsx(en,{message:t,children:R.jsx(Ru,{card:e})},r))}),$u=()=>R.jsx(en,{message:{isBot:!0,message:"",template:{},userId:"typing",createdAt:new Date().toISOString()},children:R.jsxs("div",{className:"flex space-x-1 h-full flex-1 items-center",children:[R.jsx("div",{className:"w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.3s]"}),R.jsx("div",{className:"w-1 h-1 bg-neutral-800 rounded-full animate-bounce [animation-delay:-0.15s]"}),R.jsx("div",{className:"w-1 h-1 bg-neutral-800 rounded-full animate-bounce"})]})}),Mu=()=>{const t=b.useRef(null),{messages:e,isLoadingMessages:r}=ft();b.useEffect(()=>{t.current&&t.current.scrollIntoView({behavior:"smooth"})},[e]);const n=(s,i)=>{var o,a;return(s==null?void 0:s.userId)==="typing"?R.jsx($u,{}):((o=s==null?void 0:s.template)==null?void 0:o.type)==="list-button"?R.jsx(Au,{message:s},`${s.createdAt}+${i}`):((a=s==null?void 0:s.template)==null?void 0:a.type)==="list-card"?R.jsx(Pu,{message:s},`${s.createdAt}+${i}`):R.jsx(en,{message:s},`${s.createdAt}+${i}`)};return R.jsx("div",{className:"p-2 flex-1 pr-3 overflow-y-auto",children:r?R.jsx("div",{children:R.jsx(mu,{className:"animate-spin w-4 h-4"})}):R.jsxs("div",{className:"flex flex-col gap-1",children:[e.length>0&&R.jsx("div",{className:"text-center text-xs text-neutral-500 py-2",children:Jr(e[0].createdAt).format("DD/MM/YYYY HH:mm")}),e.map((s,i)=>R.jsxs(b.Fragment,{children:[i>0&&Jr(s.createdAt).diff(Jr(e[i-1].createdAt),"minutes")>10&&R.jsx("div",{className:"text-center text-xs text-neutral-500 py-2",children:Jr(s.createdAt).format("DD/MM/YYYY HH:mm")}),n(s,i)]},i)),R.jsx("div",{ref:t})]})})},Lu=Br(t=>R.jsx("header",{className:"flex items-center bg-primary select-none h-[3.75rem]",style:t.v0,children:R.jsxs("div",{className:"flex items-center px-2 gap-2 justify-between w-full",children:[R.jsxs("div",{className:"flex items-center p-2 gap-2",children:[t.v1,R.jsx("span",{className:"font-medium text-white",children:t.v2})]}),R.jsxs("div",{className:"flex items-center gap-3",children:[t.v3,t.v4]})]})}),{name:"Header_1",portals:["v1","v2","v3","v4"]}),Nu=()=>{const{handleClose:t,isShowClose:e,handleReload:r,customStyles:n,isForManager:s}=ft();return R.jsx(Lu,{v0:{backgroundColor:n==null?void 0:n.color},v1:n!=null&&n.logoUrl?R.jsx("img",{src:n==null?void 0:n.logoUrl,alt:"logo",className:"w-10 h-10 rounded-full overflow-hidden object-cover"}):R.jsx("svg",{width:"40",height:"40",className:"text-neutral-700 fill-neutral-700 bg-neutral-700 rounded-full",children:R.jsx("text",{"text-anchor":"middle",x:"50%",y:"50%",dy:"0.35em",fill:"#ffffff","font-size":"1rem",children:"B"})}),v2:(n==null?void 0:n.name)||"DialogueBot",v3:!s&&R.jsx("div",{className:"w-6 h-6 flex items-center justify-center cursor-pointer",onClick:r,children:R.jsx(gu,{className:"w-4 h-4 text-white"})}),v4:e&&R.jsx("div",{className:"w-6 h-6 flex items-center justify-center cursor-pointer",onClick:t,children:R.jsx(vu,{className:"w-4 h-4 text-white"})})})},Lo=ge.forwardRef(({className:t,type:e,...r},n)=>R.jsx("input",{type:e,className:pt("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...r}));Lo.displayName="Input";const ju=()=>{const{handleSendMessage:t,disableInput:e,customStyles:r}=ft(),[n,s]=b.useState(""),i=a=>{a.key==="Enter"&&(a.preventDefault(),t({message:n}),s(""))},o=r!=null&&r.color?kn(r.color):null;return R.jsxs("div",{className:"flex items-center py-2 px-3 gap-2 border-input border-t",children:[R.jsx(Lo,{className:"flex-1",placeholder:"Type a message...",value:n,onChange:a=>s(a.target.value),onKeyDown:i,disabled:e,style:{"--primary":o?`${o.h} ${o.s}% ${o.l}%`:void 0}}),R.jsx(rn,{size:"icon",className:"flex-shrink-0",onClick:()=>{t({message:n,cb:()=>s("")})},disabled:e,style:{"--primary":o?`${o.h} ${o.s}% ${o.l}%`:void 0},children:R.jsx(bu,{className:"w-4 h-4"})})]})},Du=new Sc,Bu=Br(t=>R.jsx("div",{className:t.v0,style:t.v1,children:R.jsxs("div",{className:"flex flex-col h-full overflow-hidden w-full flex-1",children:[t.v2,R.jsxs("div",{className:"flex-1 flex flex-col min-h-[1px]",children:[t.v3,t.v4]})]})}),{name:"ChatBox_1",portals:["v2","v3","v4"]}),Iu=({className:t})=>{const{customStyles:e,isForManager:r}=ft();return R.jsx(Bu,{v0:pt("select-none w-full h-screen flex flex-col shadow chatbox",t),v1:{width:e==null?void 0:e.windowSize.width,height:e==null?void 0:e.windowSize.height},v2:R.jsx(Nu,{}),v3:R.jsx(Mu,{}),v4:!r&&R.jsx(ju,{})})},Fu=t=>R.jsx(Ac,{client:Du,children:R.jsx(Ml,{...t,children:R.jsx(Iu,{className:t.className})})});ee.ChatBox=Fu,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=index.umd.js.map diff --git a/dist-components/index.umd.js.map b/dist-components/index.umd.js.map index b291de0..4d4a054 100644 --- a/dist-components/index.umd.js.map +++ b/dist-components/index.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../node_modules/million/dist/shared/million.fb41761f.mjs","../node_modules/million/dist/packages/experimental.mjs","../node_modules/million/dist/shared/million.9efd57f2.mjs","../node_modules/million/dist/packages/react.mjs","../src/constants/index.ts","../node_modules/@noble/hashes/_assert.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/crypto.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/sha3.js","../node_modules/@paralleldrive/cuid2/src/index.js","../node_modules/@paralleldrive/cuid2/index.js","../src/utils/index.ts","../node_modules/@tanstack/query-core/build/modern/subscribable.js","../node_modules/@tanstack/query-core/build/modern/utils.js","../node_modules/@tanstack/query-core/build/modern/focusManager.js","../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../node_modules/@tanstack/query-core/build/modern/retryer.js","../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../node_modules/@tanstack/query-core/build/modern/removable.js","../node_modules/@tanstack/query-core/build/modern/query.js","../node_modules/@tanstack/query-core/build/modern/queryCache.js","../node_modules/@tanstack/query-core/build/modern/mutation.js","../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../node_modules/@tanstack/query-core/build/modern/queryClient.js","../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../node_modules/@tanstack/react-query/build/modern/isRestoring.js","../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../node_modules/@tanstack/react-query/build/modern/utils.js","../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../node_modules/@tanstack/react-query/build/modern/suspense.js","../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../node_modules/@tanstack/react-query/build/modern/useQuery.js","../node_modules/engine.io-parser/build/esm/commons.js","../node_modules/engine.io-parser/build/esm/encodePacket.browser.js","../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js","../node_modules/engine.io-parser/build/esm/decodePacket.browser.js","../node_modules/engine.io-parser/build/esm/index.js","../node_modules/@socket.io/component-emitter/index.mjs","../node_modules/engine.io-client/build/esm/globalThis.browser.js","../node_modules/engine.io-client/build/esm/util.js","../node_modules/engine.io-client/build/esm/contrib/parseqs.js","../node_modules/engine.io-client/build/esm/transport.js","../node_modules/engine.io-client/build/esm/contrib/yeast.js","../node_modules/engine.io-client/build/esm/contrib/has-cors.js","../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js","../node_modules/engine.io-client/build/esm/transports/polling.js","../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js","../node_modules/engine.io-client/build/esm/transports/websocket.js","../node_modules/engine.io-client/build/esm/transports/webtransport.js","../node_modules/engine.io-client/build/esm/transports/index.js","../node_modules/engine.io-client/build/esm/contrib/parseuri.js","../node_modules/engine.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/url.js","../node_modules/socket.io-parser/build/esm/is-binary.js","../node_modules/socket.io-parser/build/esm/binary.js","../node_modules/socket.io-parser/build/esm/index.js","../node_modules/socket.io-client/build/esm/on.js","../node_modules/socket.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/contrib/backo2.js","../node_modules/socket.io-client/build/esm/manager.js","../node_modules/socket.io-client/build/esm/index.js","../node_modules/lodash.debounce/index.js","../node_modules/usehooks-ts/dist/index.js","../src/context/socket.ctx.tsx","../src/hooks/useSocket.ts","../node_modules/clsx/dist/clsx.mjs","../node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/lib/utils.ts","../node_modules/dayjs/dayjs.min.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/loader-circle.js","../node_modules/lucide-react/dist/esm/icons/refresh-ccw.js","../node_modules/lucide-react/dist/esm/icons/send.js","../node_modules/lucide-react/dist/esm/icons/x.js","../src/components/message.tsx","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/components/ui/button.tsx","../src/components/buttons-message.tsx","../src/components/cards-message.tsx","../src/components/typing-message.tsx","../src/components/body.tsx","../src/components/header.tsx","../src/components/ui/input.tsx","../src/components/send-area.tsx","../src/chatbox/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use client';\nconst Object$ = Object;\nconst Map$ = Map;\nconst Set$ = Set;\nconst SetHas$ = Set$.prototype.has;\nconst SetAdd$ = Set$.prototype.add;\nconst MapHas$ = Map$.prototype.has;\nconst MapGet$ = Map$.prototype.get;\nconst MapSet$ = Map$.prototype.set;\nconst ChildFlag = 1;\nconst AttributeFlag = 2;\nconst EventFlag = 4;\nconst StyleAttributeFlag = 8;\nconst SvgAttributeFlag = 16;\nconst BlockFlag = 32;\nconst TEXT_NODE_CACHE = \"__t\";\nconst EVENT_PATCH = \"__p\";\nconst EVENTS_REGISTRY = \"__e\";\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\nconst XLINK_NS = \"http://www.w3.org/1999/xlink\";\nconst XML_NS = \"http://www.w3.org/2000/xmlns/\";\nconst X_CHAR = 120;\nconst NON_PROPS = new Set$([\"href\", \"list\", \"form\", \"tabIndex\", \"download\"]);\nconst VOID_ELEMENTS = new Set$([\"area\", \"base\", \"basefont\", \"bgsound\", \"br\", \"col\", \"command\", \"embed\", \"frame\", \"hr\", \"image\", \"img\", \"input\", \"isindex\", \"keygen\", \"link\", \"menuitem\", \"meta\", \"nextid\", \"param\", \"source\", \"track\", \"wbr\"]);\n\nif (typeof window === \"undefined\") {\n throw new Error(\n \"See http://million.dev/docs/install to install the compiler.\"\n );\n}\nconst document$ = document;\ndocument$.createElement(\"template\");\nconst HTM_TEMPLATE = /* @__PURE__ */ document$.createElement(\"template\");\nconst HTM_TEMPLATE_CONTENT = HTM_TEMPLATE.content;\nconst SVG_TEMPLATE = /* @__PURE__ */ document$.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"svg\"\n);\nconst node$ = Node.prototype;\nconst element$ = Element.prototype;\nconst characterData$ = CharacterData.prototype;\nconst getOwnPropertyDescriptor$ = Object$.getOwnPropertyDescriptor;\nconst insertBefore$ = node$.insertBefore;\nconst cloneNode$ = node$.cloneNode;\nconst replaceChild$ = node$.replaceChild;\nconst remove$$1 = element$.remove;\nconst addEventListener$ = node$.addEventListener;\nconst removeAttribute$ = element$.removeAttribute;\nconst setAttribute$ = element$.setAttribute;\nconst setAttributeNS$ = element$.setAttributeNS;\nconst setTextContent$ = getOwnPropertyDescriptor$(node$, \"textContent\").set;\nconst firstChild$ = getOwnPropertyDescriptor$(node$, \"firstChild\").get;\nconst nextSibling$ = getOwnPropertyDescriptor$(node$, \"nextSibling\").get;\nconst characterDataSet$ = getOwnPropertyDescriptor$(\n characterData$,\n \"data\"\n).set;\nconst stringToDOM = (content, svg) => {\n const template = svg ? SVG_TEMPLATE : HTM_TEMPLATE;\n template.innerHTML = content;\n const dom = svg ? SVG_TEMPLATE : HTM_TEMPLATE_CONTENT;\n return dom.firstChild;\n};\ndocument$[EVENTS_REGISTRY] = new Set$();\nconst createEventListener = (el, name, value) => {\n let event = name.toLowerCase();\n let capture = false;\n if (event.endsWith(\"capture\")) {\n event = event.slice(0, -7);\n capture = true;\n }\n const key = `$$${event}`;\n if (!SetHas$.call(document$[EVENTS_REGISTRY], event)) {\n addEventListener$.call(\n document$,\n event,\n (nativeEvent) => {\n let el2 = nativeEvent.target;\n while (el2) {\n const handler = el2[key];\n if (handler) {\n Object$.defineProperty(nativeEvent, \"currentTarget\", {\n configurable: true,\n get() {\n return el2;\n }\n });\n handler(nativeEvent);\n }\n el2 = el2.parentNode;\n }\n },\n { capture }\n );\n SetAdd$.call(document$[EVENTS_REGISTRY], event);\n }\n const patch = (newValue) => {\n if (!newValue) {\n el[key] = null;\n } else if (!(\"key\" in newValue && newValue.key === el[key]?.key)) {\n el[key] = newValue;\n }\n };\n patch(value);\n return patch;\n};\nconst childAt = (el, index) => {\n let child = firstChild$.call(el);\n if (index) {\n for (let j = 0; j < index; ++j) {\n if (!child)\n break;\n child = nextSibling$.call(child);\n }\n }\n return child;\n};\nconst visitedNodes = /* @__PURE__ */ new WeakSet();\nconst removeComments = (el) => {\n if (visitedNodes.has(el)) {\n return;\n }\n if (el.nodeType === 8) {\n el.parentNode?.removeChild(el);\n }\n let child = firstChild$.call(el);\n while (child) {\n removeComments(child);\n child = child.nextSibling;\n }\n visitedNodes.add(el);\n};\nconst insertText = (el, value, index) => {\n const node = document$.createTextNode(value);\n const child = childAt(el, index);\n insertBefore$.call(el, node, child);\n return node;\n};\nconst setText = (el, value) => {\n characterDataSet$.call(el, value);\n};\nconst setStyleAttribute = (el, name, value) => {\n if (typeof value !== \"number\" || IS_NON_DIMENSIONAL.test(name)) {\n el.style[name] = value;\n } else if (typeof value === \"string\") {\n el.style.cssText = value;\n } else if (name.startsWith(\"-\")) {\n el.style.setProperty(name, String(value));\n } else if (value === void 0 || value === null) {\n el.style[name] = \"\";\n } else {\n el.style[name] = `${String(value)}px`;\n }\n};\nconst setSvgAttribute = (el, name, value) => {\n name = name.replace(/xlink(?:H|:h)/, \"h\").replace(/sName$/, \"s\");\n if (name.startsWith(\"xmlns\")) {\n setAttributeNS$.call(el, XML_NS, name, String(value));\n } else if (name.startsWith(\"xlink\")) {\n setAttributeNS$.call(el, XLINK_NS, \"href\", String(value));\n }\n};\nconst setAttribute = (el, name, value) => {\n const isValueNully = value === void 0 || value === null;\n value = isValueNully ? \"\" : value;\n if (name in el && el[name] !== void 0 && el[name] !== null && !(el instanceof SVGElement) && SetHas$.call(NON_PROPS, name)) {\n try {\n el[name] = value;\n } catch (_err) {\n }\n } else if (!isValueNully && value !== \"\" && (value !== false || name.includes(\"-\"))) {\n setAttribute$.call(el, name, String(value));\n } else {\n removeAttribute$.call(el, name);\n }\n const isInput = el instanceof HTMLInputElement;\n const isSelect = el instanceof HTMLSelectElement;\n const isTextArea = el instanceof HTMLTextAreaElement;\n if (name === \"value\" && (isInput || isSelect || isTextArea)) {\n setAttribute$.call(el, name, String(value));\n el.value = value;\n }\n};\n\nvar __defProp$1 = Object.defineProperty;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField$1 = (obj, key, value) => {\n __defNormalProp$1(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass AbstractBlock {\n constructor() {\n /* root */\n __publicField$1(this, \"r\");\n /* edits */\n __publicField$1(this, \"e\");\n /* el */\n __publicField$1(this, \"l\");\n /* getElements */\n __publicField$1(this, \"g\");\n /* _shouldUpdate */\n __publicField$1(this, \"_u\");\n /* _parent */\n __publicField$1(this, \"_t\");\n /* props */\n __publicField$1(this, \"d\");\n /* key */\n __publicField$1(this, \"k\");\n /* cache */\n __publicField$1(this, \"c\");\n }\n}\n\nconst renderToTemplate = (vnode, edits = [], path = []) => {\n if (typeof vnode === \"string\")\n return vnode;\n if (typeof vnode === \"number\" || typeof vnode === \"bigint\" || vnode === true) {\n return String(vnode);\n }\n if (vnode === null || vnode === void 0 || vnode === false)\n return \"\";\n if (typeof vnode === \"object\" && \"$\" in vnode) {\n edits.push({\n p: path,\n e: [\n {\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: vnode.$,\n /* index */\n i: 0,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n }\n ],\n i: []\n });\n return \"\";\n }\n let props = \"\";\n let children = \"\";\n const current = {\n p: path,\n // The location of the edit in in the virtual node tree\n e: [],\n // Occur on mount + patch\n i: []\n // Occur before mount\n };\n for (let name in vnode.props) {\n const value = vnode.props[name];\n if (name === \"key\" || name === \"ref\" || name === \"children\") {\n continue;\n }\n if (name === \"className\")\n name = \"class\";\n if (name === \"htmlFor\")\n name = \"for\";\n if (name.startsWith(\"on\")) {\n const isValueHole = \"$\" in value;\n if (isValueHole) {\n current.e.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.i.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i: null,\n /* listener */\n l: value,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (value) {\n if (typeof value === \"object\" && \"$\" in value) {\n if (name === \"style\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else if (name.charCodeAt(0) === X_CHAR) {\n current.e.push({\n /* type */\n t: SvgAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.e.push({\n /* type */\n t: AttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (name === \"style\" && typeof value === \"object\") {\n let style = \"\";\n for (const key in value) {\n if (typeof value[key] === \"object\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: key,\n /* value */\n v: null,\n /* hole */\n h: value[key].$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n let kebabKey = \"\";\n for (let i = 0, j = key.length; i < j; ++i) {\n const char = key.charCodeAt(i);\n if (char < 97) {\n kebabKey += `-${String.fromCharCode(char + 32)}`;\n } else {\n kebabKey += key[i];\n }\n }\n style += `${kebabKey}:${String(value[key])};`;\n }\n props += ` style=\"${style}\"`;\n continue;\n }\n props += ` ${name}=\"${String(value)}\"`;\n }\n }\n if (SetHas$.call(VOID_ELEMENTS, vnode.type)) {\n if (current.e.length)\n edits.push(current);\n return `<${vnode.type}${props} />`;\n }\n let canMergeString = false;\n for (let i = 0, j = vnode.props.children?.length || 0, k = 0; i < j; ++i) {\n const child = vnode.props.children?.[i];\n if (child === null || child === void 0 || child === false)\n continue;\n if (typeof child === \"object\" && \"$\" in child) {\n current.e.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: child.$,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n if (child instanceof AbstractBlock) {\n current.i.push({\n /* type */\n t: BlockFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: child\n });\n continue;\n }\n if (typeof child === \"string\" || typeof child === \"number\" || typeof child === \"bigint\") {\n const value = typeof child === \"number\" || typeof child === \"bigint\" ? String(child) : child;\n if (canMergeString) {\n current.i.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: value,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n canMergeString = true;\n children += value;\n k++;\n continue;\n }\n canMergeString = false;\n const newPath = path.slice();\n newPath.push(k++);\n children += renderToTemplate(child, edits, newPath);\n }\n if (current.i.length || current.e.length)\n edits.push(current);\n return `<${vnode.type}${props}>${children}`;\n};\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nconst mapArray = (children) => {\n return new ArrayBlock(children);\n};\nclass ArrayBlock extends AbstractBlock {\n constructor(children) {\n super();\n __publicField(this, \"b\");\n this.b = children;\n }\n v() {\n }\n p(fragment) {\n const oldChildren = this.b;\n const newChildren = fragment.b;\n const oldChildrenLength = oldChildren.length;\n const newChildrenLength = newChildren.length;\n const parent = this.t();\n if (this === fragment)\n return parent;\n if (newChildrenLength === 0 && oldChildrenLength === 0)\n return parent;\n this.b = newChildren;\n if (newChildrenLength === 0) {\n arrayRemove$.call(this);\n return parent;\n }\n if (oldChildrenLength === 0) {\n arrayMount$.call(fragment, parent);\n return parent;\n }\n let oldHead = 0;\n let newHead = 0;\n let oldTail = oldChildrenLength - 1;\n let newTail = newChildrenLength - 1;\n let oldHeadChild = oldChildren[0];\n let newHeadChild = newChildren[0];\n let oldTailChild = oldChildren[oldTail];\n let newTailChild = newChildren[newTail];\n let oldKeyMap;\n while (oldHead <= oldTail && newHead <= newTail) {\n if (!oldHeadChild) {\n oldHeadChild = oldChildren[++oldHead];\n continue;\n }\n if (!oldTailChild) {\n oldTailChild = oldChildren[--oldTail];\n continue;\n }\n const oldHeadKey = oldHeadChild.k;\n const newHeadKey = newHeadChild.k;\n if (oldHeadKey === newHeadKey) {\n patch$.call(oldHeadChild, newHeadChild);\n newChildren[newHead] = oldHeadChild;\n oldHeadChild = oldChildren[++oldHead];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n const oldTailKey = oldTailChild.k;\n const newTailKey = newTailChild.k;\n if (oldTailKey === newTailKey) {\n patch$.call(oldTailChild, newTailChild);\n newChildren[newTail] = oldTailChild;\n oldTailChild = oldChildren[--oldTail];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldHeadKey === newTailKey) {\n patch$.call(oldHeadChild, newTailChild);\n newChildren[newTail] = oldHeadChild;\n const nextChild = newChildren[newTail + 1];\n move$.call(oldHeadChild, nextChild, nextChild?.l || null);\n oldHeadChild = oldChildren[++oldHead];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldTailKey === newHeadKey) {\n patch$.call(oldTailChild, newHeadChild);\n newChildren[newHead] = oldTailChild;\n const nextChild = oldChildren[oldHead];\n move$.call(oldTailChild, nextChild, nextChild?.l || null);\n oldTailChild = oldChildren[--oldTail];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n if (!oldKeyMap) {\n oldKeyMap = new Map$();\n for (let i = oldHead; i <= oldTail; i++) {\n MapSet$.call(oldKeyMap, oldChildren[i].k, i);\n }\n }\n const oldIndex = oldKeyMap.get(newHeadKey);\n if (oldIndex === void 0) {\n mount$.call(newHeadChild, parent, oldHeadChild.l || null);\n } else {\n const oldChild = oldChildren[oldIndex];\n move$.call(oldChild, oldHeadChild, null);\n patch$.call(oldChild, newHeadChild);\n newChildren[newHead] = oldChild;\n oldChildren[oldIndex] = null;\n }\n newHeadChild = newChildren[++newHead];\n }\n if (oldHead <= oldTail || newHead <= newTail) {\n if (oldHead > oldTail) {\n const nextChild = newChildren[newTail + 1];\n for (let i = newHead; i <= newTail; ++i) {\n mount$.call(newChildren[i], parent, nextChild ? nextChild.l : null);\n }\n } else {\n for (let i = oldHead; i <= oldTail; ++i) {\n remove$.call(oldChildren[i]);\n }\n }\n }\n return parent;\n }\n m(parent, refNode = null) {\n if (this._t)\n return this._t;\n for (let i = 0, j = this.b.length; i < j; ++i) {\n const block = this.b[i];\n mount$.call(block, parent, refNode);\n }\n this._t = parent;\n return parent;\n }\n x() {\n const parent = this.t();\n if (parent) {\n setTextContent$.call(parent, \"\");\n } else {\n for (let i = 0, j = this.b.length; i < j; ++i) {\n remove$.call(this.b[i]);\n }\n }\n this.b = [];\n }\n u() {\n return true;\n }\n s() {\n return this.b.map((block) => block.s()).join(\"\");\n }\n t() {\n if (!this._t)\n this._t = this.b[0].t();\n return this._t;\n }\n}\nconst array$ = ArrayBlock.prototype;\nconst arrayMount$ = array$.m;\nconst arrayPatch$ = array$.p;\nconst arrayRemove$ = array$.x;\n\nconst HOLE_PROXY = new Proxy(\n {},\n {\n // A universal getter will return a Hole instance if props[any] is accessed\n // Allows code to identify holes in virtual nodes (\"digs\" them out)\n get(_, key) {\n return { $: key };\n }\n }\n);\nconst block = (fn, unwrap, shouldUpdate, svg) => {\n const vnode = fn(HOLE_PROXY);\n const edits = [];\n const root = stringToDOM(\n renderToTemplate(unwrap ? unwrap(vnode) : vnode, edits),\n svg\n );\n removeComments(root);\n return (props, key, shouldUpdateCurrentBlock) => {\n return new Block(\n root,\n edits,\n props,\n key ?? props?.key ?? null,\n shouldUpdateCurrentBlock ?? shouldUpdate ?? null,\n null\n );\n };\n};\nconst mount = (block2, parent, hydrateNode) => {\n if (\"b\" in block2 && parent) {\n return arrayMount$.call(block2, parent, null);\n }\n return mount$.call(block2, parent, null, hydrateNode);\n};\nconst patch = (oldBlock, newBlock) => {\n if (\"b\" in oldBlock || \"b\" in newBlock) {\n arrayPatch$.call(oldBlock, newBlock);\n }\n if (!oldBlock.l)\n mount$.call(oldBlock, void 0, null, null);\n if (oldBlock.k && oldBlock.k === newBlock.k || oldBlock.r === newBlock.r) {\n return patch$.call(oldBlock, newBlock);\n }\n const el = mount$.call(newBlock, oldBlock.t(), oldBlock.l, null);\n remove$.call(oldBlock);\n oldBlock.k = newBlock.k;\n return el;\n};\nclass Block extends AbstractBlock {\n constructor(root, edits, props, key, shouldUpdate, getElements) {\n super();\n this.r = root;\n this.d = props;\n this.e = edits;\n this.k = key;\n this.c = Array(edits.length);\n if (shouldUpdate) {\n this._u = shouldUpdate;\n } else {\n this._u = null;\n }\n if (getElements) {\n this.g = getElements;\n } else {\n this.g = null;\n }\n }\n m(parent, refNode = null, hydrateNode) {\n if (this.l)\n return this.l;\n const root = hydrateNode ?? cloneNode$.call(this.r, true);\n const elements = this.g?.(root);\n if (elements)\n this.c = elements;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = elements?.[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const value = this.d[edit.h];\n if (edit.t & ChildFlag) {\n if (value instanceof AbstractBlock) {\n const child = childAt(el, edit.i);\n if (hydrateNode) {\n value.m(el, child, child);\n } else {\n value.m(el, child);\n }\n continue;\n }\n if (!el[TEXT_NODE_CACHE])\n el[TEXT_NODE_CACHE] = new Array(l);\n if (value && typeof value === \"object\" && \"foreign\" in value) {\n if (hydrateNode) {\n const child = childAt(el, edit.i);\n value.reset(child);\n }\n const targetEl = value.current;\n el[TEXT_NODE_CACHE][k] = targetEl;\n if (!hydrateNode) {\n insertBefore$.call(el, targetEl, childAt(el, edit.i));\n }\n continue;\n }\n if (hydrateNode) {\n el[TEXT_NODE_CACHE][k] = childAt(el, edit.i);\n continue;\n }\n el[TEXT_NODE_CACHE][k] = insertText(\n el,\n // eslint-disable-next-line eqeqeq\n value == null || value === false ? \"\" : String(value),\n edit.i\n );\n } else if (edit.t & EventFlag) {\n const patch2 = createEventListener(el, edit.n, value);\n el[EVENT_PATCH + edit.n] = patch2;\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, value);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof value === \"string\" || typeof value === \"number\") {\n setStyleAttribute(el, edit.n, value);\n } else {\n for (const style in value) {\n setStyleAttribute(el, style, value[style]);\n }\n }\n } else {\n setSvgAttribute(el, edit.n, value);\n }\n }\n const initsLength = current.i?.length;\n if (!initsLength)\n continue;\n for (let k = 0; k < initsLength; ++k) {\n const init = current.i[k];\n if (init.t & ChildFlag) {\n if (init.v && !hydrateNode)\n insertText(el, init.v, init.i);\n } else if (init.t & EventFlag) {\n createEventListener(el, init.n, init.l);\n } else {\n const child = childAt(el, init.i);\n if (hydrateNode) {\n init.b.m(el, child, child);\n } else {\n init.b.m(el, child);\n }\n }\n }\n }\n if (parent && !hydrateNode) {\n insertBefore$.call(parent, root, refNode);\n }\n this.l = root;\n return root;\n }\n p(newBlock) {\n const root = this.l;\n if (!newBlock.d)\n return root;\n const props = this.d;\n if (!shouldUpdate$.call(this, props, newBlock.d))\n return root;\n this.d = newBlock.d;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = this.c[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const oldValue = props[edit.h];\n const newValue = newBlock.d[edit.h];\n if (newValue === oldValue)\n continue;\n if (edit.t & EventFlag) {\n el[EVENT_PATCH + edit.n](newValue);\n continue;\n }\n if (edit.t & ChildFlag) {\n if (oldValue instanceof AbstractBlock) {\n const firstEdit = newBlock.e?.[i]?.e[k];\n const newChildBlock = newBlock.d[firstEdit.h];\n oldValue.p(newChildBlock);\n continue;\n }\n if (newValue && typeof newValue === \"object\" && \"foreign\" in newValue) {\n const targetEl = el[TEXT_NODE_CACHE][k];\n if (newValue.unstable && oldValue !== newValue) {\n const newTargetEl = newValue.current;\n el[TEXT_NODE_CACHE][k] = newTargetEl;\n replaceChild$.call(el, newTargetEl, targetEl);\n } else {\n newValue.current = targetEl;\n }\n continue;\n }\n setText(\n el[TEXT_NODE_CACHE][k],\n // eslint-disable-next-line eqeqeq\n newValue == null || newValue === false ? \"\" : String(newValue)\n );\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, newValue);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof newValue === \"string\" || typeof newValue === \"number\") {\n setStyleAttribute(el, edit.n, newValue);\n } else {\n for (const style in newValue) {\n if (newValue[style] !== oldValue[style]) {\n setStyleAttribute(el, style, newValue[style]);\n }\n }\n }\n } else {\n setSvgAttribute(el, edit.n, newValue);\n }\n }\n }\n return root;\n }\n v(block2 = null, refNode = null) {\n insertBefore$.call(this.t(), this.l, block2 ? block2.l : refNode);\n }\n x() {\n remove$$1.call(this.l);\n this.l = null;\n }\n u(_oldProps, _newProps) {\n if (!this._u)\n return true;\n return this._u(_oldProps, _newProps);\n }\n s() {\n return String(this.l?.outerHTML);\n }\n t() {\n if (!this._t)\n this._t = this.l?.parentElement;\n return this._t;\n }\n}\nconst getCurrentElement = (path, root, cache, key) => {\n const pathLength = path.length;\n if (!pathLength)\n return root;\n const isCacheAndKeyExists = cache && key !== void 0;\n if (isCacheAndKeyExists && cache[key]) {\n return cache[key];\n }\n for (let i = 0; i < pathLength; ++i) {\n const siblings = path[i];\n root = childAt(root, siblings);\n }\n if (isCacheAndKeyExists)\n cache[key] = root;\n return root;\n};\nconst withKey = (value, key) => {\n value.key = key;\n return value;\n};\nconst block$ = Block.prototype;\nconst mount$ = block$.m;\nconst patch$ = block$.p;\nconst move$ = block$.v;\nconst remove$ = block$.x;\nconst shouldUpdate$ = block$.u;\n\nexport { ArrayBlock as A, Block as B, MapHas$ as M, MapSet$ as a, block as b, cloneNode$ as c, arrayPatch$ as d, mapArray as e, arrayMount$ as f, MapGet$ as g, mount as h, removeComments as i, renderToTemplate as j, AbstractBlock as k, firstChild$ as l, mount$ as m, nextSibling$ as n, patch as p, remove$ as r, stringToDOM as s, withKey as w };\n","'use client';\nconst experimental_options = {\n noSlot: false\n};\n\nexport { experimental_options };\n","'use client';\nimport { useEffect, createContext, isValidElement, createElement, Fragment, useRef, useLayoutEffect as useLayoutEffect$1, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nconst RENDER_SCOPE = \"slot\";\nconst SVG_RENDER_SCOPE = \"g\";\nconst Effect = ({\n effect,\n deps\n}) => {\n useEffect(effect, deps || []);\n return null;\n};\nconst REGISTRY = /* @__PURE__ */ new Map();\n\nconst scopedContext = createContext(false);\nconst processProps = (props, ref, portals) => {\n const processedProps = { ref };\n let currentIndex = 0;\n for (const key in props) {\n const value = props[key];\n if (isValidElement(value) || Array.isArray(value) && value.length && isValidElement(value[0])) {\n processedProps[key] = renderReactScope(\n value,\n false,\n portals,\n currentIndex++\n );\n continue;\n }\n processedProps[key] = props[key];\n }\n return processedProps;\n};\nconst wrap = (vnode, key) => {\n return createElement(\n RENDER_SCOPE,\n { suppressHydrationWarning: true, id: key },\n vnode\n );\n};\nconst renderReactScope = (vnode, unstable, portals, currentIndex, key) => {\n const el = portals?.[currentIndex]?.current;\n const isBlock = isValidElement(vnode) && typeof vnode.type === \"function\" && \"_c\" in vnode.type;\n const isCallable = isBlock && vnode.type._c;\n if (typeof window === \"undefined\") {\n if (isBlock) {\n if (isCallable) {\n return vnode;\n }\n return wrap(wrap(vnode), key);\n }\n return wrap(vnode, key);\n }\n if (isCallable) {\n const puppetComponent = vnode.type(vnode.props);\n if (REGISTRY.has(puppetComponent.type)) {\n const puppetBlock = REGISTRY.get(puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n return puppetBlock(puppetComponent.props);\n }\n }\n }\n const current = el ?? (key ? document.getElementById(key) : null) ?? document.createElement(RENDER_SCOPE);\n const reactPortal = createPortal(\n createElement(Fragment, { children: vnode }),\n current,\n key\n );\n const millionPortal = {\n foreign: true,\n current,\n portal: reactPortal,\n reset: (child) => {\n child.childNodes.forEach((cn) => child.removeChild(cn));\n },\n unstable\n };\n if (portals) {\n portals[currentIndex] = millionPortal;\n }\n return millionPortal;\n};\nconst unwrap = (vnode) => {\n if (typeof vnode !== \"object\" || vnode === null || !(\"type\" in vnode)) {\n if (typeof vnode === \"number\") {\n return String(vnode);\n }\n return vnode;\n }\n let type = vnode.type;\n if (typeof type === \"function\") {\n return unwrap(type(vnode.props ?? {}));\n }\n if (typeof type === \"object\" && \"$\" in type)\n return type;\n const props = { ...vnode.props };\n if (\"css\" in props && \"__EMOTION_TYPE_PLEASE_DO_NOT_USE__\" in props) {\n props.style = props.css.styles;\n type = props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.css;\n }\n const children = vnode.props?.children;\n if (children !== void 0 && children !== null) {\n props.children = flatten(vnode.props.children).map(\n (child) => unwrap(child)\n );\n }\n return {\n type,\n // lets pretend no function go through\n props\n };\n};\nconst flatten = (rawChildren) => {\n if (rawChildren === void 0 || rawChildren === null)\n return [];\n if (typeof rawChildren === \"object\" && \"type\" in rawChildren && rawChildren.type === Fragment) {\n return flatten(rawChildren.props.children);\n }\n if (!Array.isArray(rawChildren) || typeof rawChildren === \"object\" && \"$\" in rawChildren) {\n return [rawChildren];\n }\n const flattenedChildren = rawChildren.flat(Infinity);\n const children = [];\n for (let i = 0, l = flattenedChildren.length; i < l; ++i) {\n children.push(...flatten(flattenedChildren[i]));\n }\n return children;\n};\n\nconst useLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect$1;\nfunction traverse(fiber, selector, ascending) {\n if (!fiber || selector(fiber))\n return fiber;\n let child = ascending ? fiber.return : fiber.child;\n while (child) {\n const match = traverse(child, selector, ascending);\n if (match)\n return match;\n child = ascending ? null : child.sibling;\n }\n}\nfunction useFiber() {\n const fiber = useRef();\n useState(() => {\n const bind = Function.prototype.bind;\n Function.prototype.bind = function(self, maybeFiber) {\n if (self === null && typeof maybeFiber?.type === \"function\") {\n fiber.current = maybeFiber;\n Function.prototype.bind = bind;\n }\n return bind.apply(this, arguments);\n };\n });\n return fiber.current;\n}\nfunction useNearestParent(type) {\n const fiber = useFiber();\n const parentRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n parentRef.current.el = traverse(\n fiber,\n (node) => {\n parentRef.current.depth++;\n return typeof node.type === \"string\" && (type === void 0 || node.type === type);\n },\n true\n )?.stateNode;\n }, [fiber]);\n return parentRef;\n}\nfunction useContainer() {\n const fiber = useFiber();\n const rootRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n rootRef.current.el = traverse(\n fiber,\n (node) => {\n rootRef.current.depth++;\n return node.stateNode?.containerInfo != null;\n },\n true\n )?.stateNode.containerInfo;\n }, [fiber]);\n return rootRef;\n}\n\nexport { Effect as E, RENDER_SCOPE as R, SVG_RENDER_SCOPE as S, REGISTRY as a, useContainer as b, useNearestParent as c, processProps as p, renderReactScope as r, scopedContext as s, unwrap as u };\n","'use client';\nimport { b as block$1, M as MapHas$, a as MapSet$, c as cloneNode$, m as mount$, p as patch, r as remove$, d as arrayPatch$, e as mapArray, f as arrayMount$, g as MapGet$, h as mount } from '../shared/million.fb41761f.mjs';\nexport { i as removeComments } from '../shared/million.fb41761f.mjs';\nimport { useRef, useCallback, useMemo, createElement, Fragment, useState, useEffect, memo, useContext } from 'react';\nimport { experimental_options } from './experimental.mjs';\nimport { S as SVG_RENDER_SCOPE, R as RENDER_SCOPE, u as unwrap, a as REGISTRY, b as useContainer, c as useNearestParent, p as processProps, E as Effect, r as renderReactScope, s as scopedContext } from '../shared/million.9efd57f2.mjs';\nimport 'react-dom';\n\nconst block = (fn, options = {}) => {\n const noSlot = options?.experimental_noSlot ?? experimental_options.noSlot;\n let blockTarget = options?.block;\n const defaultType = options?.svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n if (fn) {\n blockTarget = block$1(\n fn,\n unwrap,\n options?.shouldUpdate,\n options?.svg\n );\n }\n const MillionBlock = (props, forwardedRef) => {\n const container = useContainer();\n const parentRef = useNearestParent();\n const hmrTimestamp = props._hmr;\n const ref = useRef(null);\n const patch$1 = useRef(null);\n const portalRef = useRef([]);\n props = processProps(props, forwardedRef, portalRef.current);\n patch$1.current?.(props);\n const effect = useCallback(() => {\n if (!ref.current && !noSlot)\n return;\n const currentBlock = blockTarget(props, props.key);\n if (hmrTimestamp && ref.current?.textContent) {\n ref.current.textContent = \"\";\n }\n if (noSlot) {\n ref.current = parentRef.current?.el ?? container.current?.el;\n if (props.scoped || parentRef.current && container.current && parentRef.current.depth > container.current.depth) {\n ref.current = container.current.el;\n }\n if (ref.current.childNodes.length) {\n console.error(\n new Error(`\\`experimental_options.noSlot\\` does not support having siblings at the moment.\nThe block element should be the only child of the \\`${cloneNode$.call(ref.current).outerHTML}\\` element.\nTo avoid this error, \\`experimental_options.noSlot\\` should be false`)\n );\n }\n }\n if (patch$1.current === null || hmrTimestamp) {\n mount$.call(currentBlock, ref.current, null);\n patch$1.current = (props2) => {\n patch(\n currentBlock,\n blockTarget(\n props2,\n props2.key,\n options?.shouldUpdate\n )\n );\n };\n }\n return () => {\n remove$.call(currentBlock);\n };\n }, []);\n const marker = useMemo(() => {\n if (noSlot) {\n return null;\n }\n return createElement(options?.as ?? defaultType, { ref });\n }, []);\n const childrenSize = portalRef.current.length;\n const children = new Array(childrenSize);\n for (let i = 0; i < childrenSize; ++i) {\n children[i] = portalRef.current[i]?.portal;\n }\n const vnode = createElement(\n Fragment,\n {},\n marker,\n createElement(Effect, {\n effect,\n deps: hmrTimestamp ? [hmrTimestamp] : []\n }),\n children\n );\n return vnode;\n };\n if (!MapHas$.call(REGISTRY, MillionBlock)) {\n MapSet$.call(REGISTRY, MillionBlock, block);\n }\n if (options?.name) {\n if (fn) {\n fn.displayName = `Million(Render(${options.name}))`;\n }\n MillionBlock.displayName = `Million(Block(${options.name}))`;\n }\n return MillionBlock;\n};\n\nconst MillionArray = ({\n each,\n children,\n memo: memo2,\n svg,\n as,\n ...rest\n}) => {\n const ref = useRef(null);\n const [portals] = useState(() => ({\n current: Array(each.length)\n }));\n const fragmentRef = useRef(null);\n const cache = useRef({\n each: null,\n children: null,\n mounted: false\n });\n const [, setMountPortals] = useState(false);\n if (fragmentRef.current && (each !== cache.current.each || !memo2)) {\n const newChildren = createChildren(each, children, cache, portals, memo2);\n arrayPatch$.call(fragmentRef.current, mapArray(newChildren));\n }\n const defaultType = svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n const MillionFor = createElement(\n Fragment,\n null,\n createElement(as ?? defaultType, { ...rest, ref }),\n ...portals.current.map((p) => p.portal)\n );\n useEffect(() => {\n if (!ref.current || fragmentRef.current)\n return;\n if (cache.current.mounted)\n return;\n const newChildren = createChildren(each, children, cache, portals, memo2);\n fragmentRef.current = mapArray(newChildren);\n if (!MapHas$.call(REGISTRY, MillionFor)) {\n MapSet$.call(REGISTRY, MillionFor, fragmentRef.current);\n }\n arrayMount$.call(fragmentRef.current, ref.current);\n cache.current.mounted = true;\n setMountPortals(true);\n }, [ref.current]);\n return MillionFor;\n};\nconst typedMemo = memo;\nconst For = typedMemo(MillionArray);\nconst createChildren = (each, getComponent, cache, portals, memo2) => {\n const children = Array(each.length);\n const currentCache = cache.current;\n for (let i = 0, l = each.length; i < l; ++i) {\n if (memo2 && currentCache.each && currentCache.each[i] === each[i]) {\n children[i] = currentCache.children?.[i];\n continue;\n }\n const vnode = getComponent(each[i], i);\n if (MapHas$.call(REGISTRY, vnode.type)) {\n if (!currentCache.block) {\n currentCache.block = MapGet$.call(REGISTRY, vnode.type);\n }\n children[i] = currentCache.block(vnode.props, portals, i);\n continue;\n }\n if (typeof vnode.type === \"function\" && \"_c\" in vnode.type) {\n const puppetComponent = vnode.type(vnode.props);\n if (MapHas$.call(REGISTRY, puppetComponent.type)) {\n const puppetBlock = MapGet$.call(REGISTRY, puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n children[i] = puppetBlock(puppetComponent.props);\n continue;\n }\n }\n }\n const block = block$1((props) => props?.scope);\n const currentBlock = (props, portals2, index) => {\n return block(\n {\n scope: renderReactScope(\n createElement(vnode.type, props),\n false,\n portals2.current,\n index\n )\n },\n vnode.key ? String(vnode.key) : void 0\n );\n };\n MapSet$.call(REGISTRY, vnode.type, currentBlock);\n currentCache.block = currentBlock;\n children[i] = currentBlock(vnode.props, portals, i);\n }\n currentCache.each = each;\n currentCache.children = children;\n return children;\n};\n\nfunction isEqual(a, b) {\n return a === b || a !== a && b !== b;\n}\nfunction shouldCompiledBlockUpdate(prev, next) {\n for (const key in prev) {\n if (!isEqual(prev[key], next[key])) {\n return true;\n }\n }\n return false;\n}\nfunction compiledBlock(render, { portals, ...options }) {\n const blockName = `CompiledBlock(Inner(${options.name}))`;\n const RenderBlock = block((props) => render(props), {\n ...options,\n scoped: void 0,\n name: blockName,\n shouldUpdate: shouldCompiledBlockUpdate\n });\n const portalCount = portals?.length || 0;\n const Component = portals && portalCount > 0 ? (props) => {\n const scoped = useContext(scopedContext);\n const [current] = useState(() => []);\n const derived = { ...props, scoped };\n for (let i = 0; i < portalCount; i++) {\n const index = portals[i];\n const scope = renderReactScope(\n derived[index],\n false,\n current,\n i\n );\n derived[index] = scope;\n }\n const targets = [];\n for (let i = 0, len = current.length; i < len; i++) {\n targets[i] = current[i].portal;\n }\n return createElement(\n Fragment,\n null,\n createElement(RenderBlock, derived),\n targets\n );\n } : (props) => createElement(RenderBlock, props);\n if (options.name) {\n Component.displayName = `Million(CompiledBlock(Outer(${options.name})))`;\n }\n return Component;\n}\n\nconst INTERNALS = {\n block: block$1,\n patch,\n mount\n};\nif (typeof window !== \"undefined\") {\n window.__MILLION_DATA__ = {\n version: \"3.0.6\"\n };\n}\n\nexport { For, INTERNALS, REGISTRY, block, compiledBlock, renderReactScope, unwrap };\n","export const EVENTS_SOCKET = {\r\n MESSAGE: 'message',\r\n TYPING: 'typing',\r\n STOP_TYPING: 'stop-typing',\r\n AGENT_MESSAGE: 'agent-message',\r\n}\r\n\r\nexport const USER_ID_KEY = 'user-bot-id'\r\n\r\nexport const API_URL = import.meta.env.DEV\r\n ? 'http://localhost:8080'\r\n : 'https://api.dialoguebot.tech'\r\n\r\nconsole.log('API_URL', API_URL)\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = exports.isBytes = void 0;\nfunction number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`positive integer expected, not ${n}`);\n}\nexports.number = number;\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`boolean expected, not ${b}`);\n}\nexports.bool = bool;\n// copied from utils\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\nfunction bytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);\n}\nexports.bytes = bytes;\nfunction hash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(h.outputLen);\n number(h.blockLen);\n}\nexports.hash = hash;\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexports.exists = exists;\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexports.output = output;\nconst assert = { number, bool, bytes, hash, exists, output };\nexports.default = assert;\n//# sourceMappingURL=_assert.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.add = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = exports.split = exports.fromBig = void 0;\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nexports.fromBig = fromBig;\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nexports.split = split;\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\nexports.toBig = toBig;\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nexports.shrSH = shrSH;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.shrSL = shrSL;\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nexports.rotrSH = rotrSH;\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.rotrSL = rotrSL;\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nexports.rotrBH = rotrBH;\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\nexports.rotrBL = rotrBL;\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nexports.rotr32H = rotr32H;\nconst rotr32L = (h, _l) => h;\nexports.rotr32L = rotr32L;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nexports.rotlSH = rotlSH;\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nexports.rotlSL = rotlSL;\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nexports.rotlBH = rotlBH;\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nexports.rotlBL = rotlBL;\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\nexports.add = add;\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nexports.add3L = add3L;\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nexports.add3H = add3H;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nexports.add4L = add4L;\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nexports.add4H = add4H;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nexports.add5L = add5L;\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\nexports.add5H = add5H;\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexports.default = u64;\n//# sourceMappingURL=_u64.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.crypto = void 0;\nexports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","\"use strict\";\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.byteSwap32 = exports.byteSwapIfBE = exports.byteSwap = exports.isLE = exports.rotl = exports.rotr = exports.createView = exports.u32 = exports.u8 = exports.isBytes = void 0;\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nconst crypto_1 = require(\"@noble/hashes/crypto\");\nconst _assert_js_1 = require(\"./_assert.js\");\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\n// Cast array to different type\nconst u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.u8 = u8;\nconst u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\nexports.u32 = u32;\n// Cast array to view\nconst createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.createView = createView;\n// The rotate right (circular right shift) operation for uint32\nconst rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\nexports.rotr = rotr;\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0);\nexports.rotl = rotl;\nexports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\n// The byte swap operation for uint32\nconst byteSwap = (word) => ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff);\nexports.byteSwap = byteSwap;\n// Conditionally byte swap if on a big-endian platform\nexports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => (0, exports.byteSwap)(n);\n// In place byte swap for Uint32Array\nfunction byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = (0, exports.byteSwap)(arr[i]);\n }\n}\nexports.byteSwap32 = byteSwap32;\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nfunction bytesToHex(bytes) {\n (0, _assert_js_1.bytes)(bytes);\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexports.bytesToHex = bytesToHex;\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 };\nfunction asciiToBase16(char) {\n if (char >= asciis._0 && char <= asciis._9)\n return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F)\n return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f)\n return char - (asciis._a - 10);\n return;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nfunction hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2;\n }\n return array;\n}\nexports.hexToBytes = hexToBytes;\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nconst nextTick = async () => { };\nexports.nextTick = nextTick;\n// Returns control to thread each 'tick' ms to avoid blocking\nasync function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await (0, exports.nextTick)();\n ts += diff;\n }\n}\nexports.asyncLoop = asyncLoop;\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nexports.utf8ToBytes = utf8ToBytes;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n (0, _assert_js_1.bytes)(data);\n return data;\n}\nexports.toBytes = toBytes;\n/**\n * Copies several Uint8Arrays into one.\n */\nfunction concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n (0, _assert_js_1.bytes)(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\nexports.concatBytes = concatBytes;\n// For runtime check if class implements interface\nclass Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nexports.Hash = Hash;\nconst toStr = {}.toString;\nfunction checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexports.checkOpts = checkOpts;\nfunction wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexports.wrapConstructor = wrapConstructor;\nfunction wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapConstructorWithOpts = wrapConstructorWithOpts;\nfunction wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nfunction randomBytes(bytesLength = 32) {\n if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') {\n return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\nexports.randomBytes = randomBytes;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = exports.keccakP = void 0;\nconst _assert_js_1 = require(\"./_assert.js\");\nconst _u64_js_1 = require(\"./_u64.js\");\nconst utils_js_1 = require(\"./utils.js\");\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ (0, _u64_js_1.split)(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBH)(h, l, s) : (0, _u64_js_1.rotlSH)(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBL)(h, l, s) : (0, _u64_js_1.rotlSL)(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nfunction keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexports.keccakP = keccakP;\nclass Keccak extends utils_js_1.Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n (0, _assert_js_1.number)(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = (0, utils_js_1.u32)(this.state);\n }\n keccak() {\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n keccakP(this.state32, this.rounds);\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n (0, _assert_js_1.exists)(this);\n const { blockLen, state } = this;\n data = (0, utils_js_1.toBytes)(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n (0, _assert_js_1.exists)(this, false);\n (0, _assert_js_1.bytes)(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n (0, _assert_js_1.number)(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n (0, _assert_js_1.output)(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nexports.Keccak = Keccak;\nconst gen = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructor)(() => new Keccak(blockLen, suffix, outputLen));\nexports.sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexports.sha3_256 = gen(0x06, 136, 256 / 8);\nexports.sha3_384 = gen(0x06, 104, 384 / 8);\nexports.sha3_512 = gen(0x06, 72, 512 / 8);\nexports.keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexports.keccak_256 = gen(0x01, 136, 256 / 8);\nexports.keccak_384 = gen(0x01, 104, 384 / 8);\nexports.keccak_512 = gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapXOFConstructorWithOpts)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexports.shake128 = genShake(0x1f, 168, 128 / 8);\nexports.shake256 = genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/* global global, window, module */\nconst { sha3_512: sha3 } = require(\"@noble/hashes/sha3\");\n\nconst defaultLength = 24;\nconst bigLength = 32;\n\nconst createEntropy = (length = 4, random = Math.random) => {\n let entropy = \"\";\n\n while (entropy.length < length) {\n entropy = entropy + Math.floor(random() * 36).toString(36);\n }\n return entropy;\n};\n\n/*\n * Adapted from https://github.com/juanelas/bigint-conversion\n * MIT License Copyright (c) 2018 Juan Hernández Serrano\n */\nfunction bufToBigInt(buf) {\n let bits = 8n;\n\n let value = 0n;\n for (const i of buf.values()) {\n const bi = BigInt(i);\n value = (value << bits) + bi;\n }\n return value;\n}\n\nconst hash = (input = \"\") => {\n // Drop the first character because it will bias the histogram\n // to the left.\n return bufToBigInt(sha3(input)).toString(36).slice(1);\n};\n\nconst alphabet = Array.from({ length: 26 }, (x, i) =>\n String.fromCharCode(i + 97)\n);\n\nconst randomLetter = (random) =>\n alphabet[Math.floor(random() * alphabet.length)];\n\n/*\nThis is a fingerprint of the host environment. It is used to help\nprevent collisions when generating ids in a distributed system.\nIf no global object is available, you can pass in your own, or fall back\non a random string.\n*/\nconst createFingerprint = ({\n globalObj = typeof global !== \"undefined\"\n ? global\n : typeof window !== \"undefined\"\n ? window\n : {},\n random = Math.random,\n} = {}) => {\n const globals = Object.keys(globalObj).toString();\n const sourceString = globals.length\n ? globals + createEntropy(bigLength, random)\n : createEntropy(bigLength, random);\n\n return hash(sourceString).substring(0, bigLength);\n};\n\nconst createCounter = (count) => () => {\n return count++;\n};\n\n// ~22k hosts before 50% chance of initial counter collision\n// with a remaining counter range of 9.0e+15 in JavaScript.\nconst initialCountMax = 476782367;\n\nconst init = ({\n // Fallback if the user does not pass in a CSPRNG. This should be OK\n // because we don't rely solely on the random number generator for entropy.\n // We also use the host fingerprint, current time, and a session counter.\n random = Math.random,\n counter = createCounter(Math.floor(random() * initialCountMax)),\n length = defaultLength,\n fingerprint = createFingerprint({ random }),\n} = {}) => {\n return function cuid2() {\n const firstLetter = randomLetter(random);\n\n // If we're lucky, the `.toString(36)` calls may reduce hashing rounds\n // by shortening the input to the hash function a little.\n const time = Date.now().toString(36);\n const count = counter().toString(36);\n\n // The salt should be long enough to be globally unique across the full\n // length of the hash. For simplicity, we use the same length as the\n // intended id output.\n const salt = createEntropy(length, random);\n const hashInput = `${time + salt + count + fingerprint}`;\n\n return `${firstLetter + hash(hashInput).substring(1, length)}`;\n };\n};\n\nconst createId = init();\n\nconst isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => {\n const length = id.length;\n const regex = /^[0-9a-z]+$/;\n\n try {\n if (\n typeof id === \"string\" &&\n length >= minLength &&\n length <= maxLength &&\n regex.test(id)\n )\n return true;\n } finally {\n }\n\n return false;\n};\n\nmodule.exports.getConstants = () => ({ defaultLength, bigLength });\nmodule.exports.init = init;\nmodule.exports.createId = createId;\nmodule.exports.bufToBigInt = bufToBigInt;\nmodule.exports.createCounter = createCounter;\nmodule.exports.createFingerprint = createFingerprint;\nmodule.exports.isCuid = isCuid;\n","const { createId, init, getConstants, isCuid } = require(\"./src/index\");\n\nmodule.exports.createId = createId;\nmodule.exports.init = init;\nmodule.exports.getConstants = getConstants;\nmodule.exports.isCuid = isCuid;\n","import { USER_ID_KEY } from '@/constants'\r\nimport { createId } from '@paralleldrive/cuid2'\r\n\r\n/**\r\n * Generates a unique ID for the user.\r\n * If a user ID is already stored in the local storage, it returns that ID.\r\n * Otherwise, it generates a new ID, stores it in the local storage, and returns it.\r\n * @returns The generated or stored user ID.\r\n */\r\nexport const genId = () => {\r\n const generatedId = createId()\r\n\r\n const userIdFromLocalStorage = localStorage.getItem(USER_ID_KEY)\r\n\r\n if (!userIdFromLocalStorage) {\r\n localStorage.setItem(USER_ID_KEY, generatedId)\r\n\r\n return generatedId\r\n }\r\n\r\n return userIdFromLocalStorage\r\n}\r\n\r\n/**\r\n * Generates a unique address based on the provided channelId.\r\n * @param channelId - The ID of the channel.\r\n * @returns The generated address.\r\n */\r\nexport const getAddress = (channelId: string, incomeUserId?: string) => {\r\n const userId = incomeUserId ? incomeUserId : genId()\r\n\r\n return `${channelId}_${userId}`\r\n}\r\n\r\nexport const openInNewTab = (url: string) => {\r\n window.open(url, '_blank')?.focus()\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color code to HSL (Hue, Saturation, Lightness) format.\r\n * @param hex - The hexadecimal color code to convert.\r\n * @returns An object containing the HSL values.\r\n */\r\nexport const hexToHSL = (hex: string) => {\r\n hex = hex.replace(/^#/, '')\r\n\r\n // Convert hex to RGB\r\n const bigint = parseInt(hex, 16)\r\n let r = (bigint >> 16) & 255\r\n let g = (bigint >> 8) & 255\r\n let b = bigint & 255\r\n\r\n // Normalize RGB values\r\n r /= 255\r\n g /= 255\r\n b /= 255\r\n\r\n // Find the maximum and minimum values of R, G, B\r\n const max = Math.max(r, g, b)\r\n const min = Math.min(r, g, b)\r\n let h = 0,\r\n s\r\n const l = (max + min) / 2\r\n\r\n if (max === min) {\r\n h = s = 0 // achromatic\r\n } else {\r\n const d = max - min\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0)\r\n break\r\n case g:\r\n h = (b - r) / d + 2\r\n break\r\n case b:\r\n h = (r - g) / d + 4\r\n break\r\n }\r\n h /= 6\r\n }\r\n\r\n h *= 360\r\n\r\n return {\r\n h: Math.round(h),\r\n s: Math.round(s * 100),\r\n l: Math.round(l * 100),\r\n }\r\n}\r\n","// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n return void 0;\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if (!array && a[key] === void 0 && b[key] === void 0 && aItems.includes(key)) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nexport {\n addToEnd,\n addToStart,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class {\n constructor(options) {\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n let promiseResolve;\n let promiseReject;\n const promise = new Promise((outerResolve, outerReject) => {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const shouldPause = () => !focusManager.isFocused() || config.networkMode !== \"always\" && !onlineManager.isOnline();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n promiseResolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n promiseReject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n const canContinue = isResolved || !shouldPause();\n if (canContinue) {\n continueResolve(value);\n }\n return canContinue;\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n if (shouldPause()) {\n return pause();\n }\n return;\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n if (canFetch(config.networkMode)) {\n run();\n } else {\n pause().then(run);\n }\n return {\n promise,\n cancel,\n continue: () => {\n const didContinue = continueFn?.();\n return didContinue ? promise : Promise.resolve();\n },\n cancelRetry,\n continueRetry\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const setScheduler = (fn) => {\n scheduleFn = fn;\n };\n const batch = (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n };\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const batchCalls = (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n const setNotifyFunction = (fn) => {\n notifyFn = fn;\n };\n const setBatchNotifyFunction = (fn) => {\n batchNotifyFn = fn;\n };\n return {\n batch,\n batchCalls,\n schedule,\n setNotifyFunction,\n setBatchNotifyFunction,\n setScheduler\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport { noop, replaceData, skipToken, timeUntilStale } from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #retryer;\n #observers;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.#observers = [];\n this.#cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = config.state || getDefaultState(this.options);\n this.state = this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.#observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.#observers.some(\n (observer) => observer.options.enabled !== false\n );\n }\n isDisabled() {\n return this.getObserversCount() > 0 && !this.isActive();\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.#observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.#observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.#observers.includes(observer)) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n if (!this.#observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.#observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.#observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const queryFnContext = {\n queryKey: this.queryKey,\n meta: this.meta\n };\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n addSignalProperty(queryFnContext);\n const fetchFn = () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (this.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'`\n );\n }\n }\n if (!this.options.queryFn || this.options.queryFn === skipToken) {\n return Promise.reject(\n new Error(`Missing queryFn: '${this.options.queryHash}'`)\n );\n }\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n this.options.queryFn,\n queryFnContext,\n this\n );\n }\n return this.options.queryFn(\n queryFnContext\n );\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n };\n this.#retryer = createRetryer({\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode\n });\n return this.#retryer.promise;\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { canFetch, createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #defaultOptions;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#defaultOptions = config.defaultOptions;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const executeMutation = () => {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode\n });\n return this.#retryer.promise;\n };\n const restored = this.state.status === \"pending\";\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables\n });\n }\n }\n const data = await executeMutation();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: !canFetch(this.options.networkMode),\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = [];\n this.#mutationId = 0;\n }\n #mutations;\n #mutationId;\n #resuming;\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n this.#mutations.push(mutation);\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n this.#mutations = this.#mutations.filter((x) => x !== mutation);\n this.notify({ type: \"removed\", mutation });\n }\n clear() {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.remove(mutation);\n });\n });\n }\n getAll() {\n return this.#mutations;\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.#mutations.find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.#mutations.filter(\n (mutation) => matchMutation(filters, mutation)\n );\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n this.#resuming = (this.#resuming ?? Promise.resolve()).then(() => {\n const pausedMutations = this.#mutations.filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => pausedMutations.reduce(\n (promise, mutation) => promise.then(() => mutation.continue().catch(noop)),\n Promise.resolve()\n )\n );\n }).then(() => {\n this.#resuming = void 0;\n });\n return this.#resuming;\n }\n};\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/infiniteQueryBehavior.ts\nimport { addToEnd, addToStart, skipToken } from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const fetchFn = async () => {\n const options = context.options;\n const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n const oldPages = context.state.data?.pages || [];\n const oldPageParams = context.state.data?.pageParams || [];\n const empty = { pages: [], pageParams: [] };\n let cancelled = false;\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true;\n } else {\n context.signal.addEventListener(\"abort\", () => {\n cancelled = true;\n });\n }\n return context.signal;\n }\n });\n };\n const queryFn = context.options.queryFn && context.options.queryFn !== skipToken ? context.options.queryFn : () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (context.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${context.options.queryHash}'`\n );\n }\n }\n return Promise.reject(\n new Error(`Missing queryFn: '${context.options.queryHash}'`)\n );\n };\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject();\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const page = await queryFn(\n queryFnContext\n );\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\n let result;\n if (direction && oldPages.length) {\n const previous = direction === \"backward\";\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams\n };\n const param = pageParamFn(options, oldData);\n result = await fetchPage(oldData, param, previous);\n } else {\n result = await fetchPage(\n empty,\n oldPageParams[0] ?? options.initialPageParam\n );\n const remainingPages = pages ?? oldPages.length;\n for (let i = 1; i < remainingPages; i++) {\n const param = getNextPageParam(options, result);\n result = await fetchPage(result, param);\n }\n }\n return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal\n },\n query\n );\n };\n } else {\n context.fetchFn = fetchFn;\n }\n }\n };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n );\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return options.getPreviousPageParam?.(\n pages[0],\n pages,\n pageParams[0],\n pageParams\n );\n}\nfunction hasNextPage(options, data) {\n if (!data)\n return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam)\n return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1)\n return;\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations();\n this.#queryCache.onFocus();\n }\n });\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations();\n this.#queryCache.onOnline();\n }\n });\n }\n unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0)\n return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const cachedData = this.getQueryData(options.queryKey);\n if (cachedData === void 0)\n return this.fetchQuery(options);\n else {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n if (options.revalidateIfStale && query.isStaleByTime(defaultedOptions.staleTime)) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n const refetchFilters = {\n type: \"active\",\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n cancelQueries(filters = {}, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters = {}, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? \"active\"\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n refetchQueries(filters = {}, options) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","// src/queryObserver.ts\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { fetchState } from \"./query.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options, notifyOptions) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\") {\n throw new Error(\"Expected enabled to be a boolean\");\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult(notifyOptions);\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n const trackedResult = {};\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key);\n onPropTracked?.(key);\n return result[key];\n }\n });\n });\n return trackedResult;\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n query.isFetchingOptimistic = true;\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n if (isServer || this.#currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n const time = timeUntilStale(\n this.#currentResult.dataUpdatedAt,\n this.options.staleTime\n );\n const timeout = time + 1;\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || this.options.enabled === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n if (options.select && newState.data !== void 0) {\n if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(newState.data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n } else {\n data = newState.data;\n }\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n if (options.select && placeholderData !== void 0) {\n try {\n placeholderData = options.select(placeholderData);\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch\n };\n return result;\n }\n updateResult(notifyOptions) {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const defaultNotifyOptions = {};\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true;\n }\n this.#notify({ ...defaultNotifyOptions, ...notifyOptions });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (options.enabled !== false) {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return options.enabled !== false && query.isStaleByTime(options.staleTime);\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\n\n// src/isRestoring.ts\nimport * as React from \"react\";\nvar IsRestoringContext = React.createContext(false);\nvar useIsRestoring = () => React.useContext(IsRestoringContext);\nvar IsRestoringProvider = IsRestoringContext.Provider;\nexport {\n IsRestoringProvider,\n useIsRestoring\n};\n//# sourceMappingURL=isRestoring.js.map","\"use client\";\n\n// src/QueryErrorResetBoundary.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createValue() {\n let isReset = false;\n return {\n clearReset: () => {\n isReset = false;\n },\n reset: () => {\n isReset = true;\n },\n isReset: () => {\n return isReset;\n }\n };\n}\nvar QueryErrorResetBoundaryContext = React.createContext(createValue());\nvar useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\nvar QueryErrorResetBoundary = ({\n children\n}) => {\n const [value] = React.useState(() => createValue());\n return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === \"function\" ? children(value) : children });\n};\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary\n};\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","// src/utils.ts\nfunction shouldThrowError(throwError, params) {\n if (typeof throwError === \"function\") {\n return throwError(...params);\n }\n return !!throwError;\n}\nfunction noop() {\n}\nexport {\n noop,\n shouldThrowError\n};\n//# sourceMappingURL=utils.js.map","\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"./utils.js\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\nvar defaultThrowOnError = (_error, query) => query.state.data === void 0;\nvar ensureStaleTime = (defaultedOptions) => {\n if (defaultedOptions.suspense) {\n if (typeof defaultedOptions.staleTime !== \"number\") {\n defaultedOptions.staleTime = 1e3;\n }\n }\n};\nvar willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nvar shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nvar fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset();\n});\nexport {\n defaultThrowOnError,\n ensureStaleTime,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n};\n//# sourceMappingURL=suspense.js.map","\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { notifyManager } from \"@tanstack/query-core\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./isRestoring.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { ensureStaleTime, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const client = useQueryClient(queryClient);\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const defaultedOptions = client.defaultQueryOptions(options);\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureStaleTime(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n useClearResetErrorBoundary(errorResetBoundary);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange));\n observer.updateResult();\n return unsubscribe;\n },\n [observer, isRestoring]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions, { listeners: false });\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: client.getQueryCache().get(defaultedOptions.queryHash)\n })) {\n throw result.error;\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\n\n// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(options, QueryObserver, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n","import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n","// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n","import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n","import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n // @ts-expect-error\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n // @ts-expect-error\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* READ_PAYLOAD */;\n }\n else if (state === 2 /* READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n","/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","export const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\n","import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n","// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n","import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n","// imported from https://github.com/unshiftio/yeast\n'use strict';\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''), length = 64, map = {};\nlet seed = 0, i = 0, prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nexport function encode(num) {\n let encoded = '';\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nexport function decode(str) {\n let decoded = 0;\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nexport function yeast() {\n const now = encode(+new Date());\n if (now !== prev)\n return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n}\n//\n// Map each character to its index.\n//\nfor (; i < length; i++)\n map[alphabet[i]] = i;\n","// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n","// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\nexport function createCookieJar() { }\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n","import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { nextTick, usingBrowserWebSocket, WebSocket, } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @param {Object} opts - connection options\n * @protected\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n get name() {\n return \"websocket\";\n }\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @private\n */\n check() {\n return !!WebSocket;\n }\n}\n","import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n","import { Polling } from \"./polling.js\";\nimport { WS } from \"./websocket.js\";\nimport { WT } from \"./webtransport.js\";\nexport const transports = {\n websocket: WS,\n webtransport: WT,\n polling: Polling,\n};\n","// imported from https://github.com/galkn/parseuri\n/**\n * Parses a URI\n *\n * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.\n *\n * See:\n * - https://developer.mozilla.org/en-US/docs/Web/API/URL\n * - https://caniuse.com/url\n * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B\n *\n * History of the parse() method:\n * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c\n * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3\n * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242\n *\n * @author Steven Levithan (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n if (str.length > 2000) {\n throw \"URI too long\";\n }\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n","import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n","import { parse } from \"engine.io-client\";\n/**\n * URL parser.\n *\n * @param uri - url\n * @param path - the request path of the connection\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nexport function url(uri, path = \"\", loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n obj = parse(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port + path;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\n","const withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj.buffer instanceof ArrayBuffer;\n};\nconst toString = Object.prototype.toString;\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeFile = typeof File === \"function\" ||\n (typeof File !== \"undefined\" &&\n toString.call(File) === \"[object FileConstructor]\");\n/**\n * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.\n *\n * @private\n */\nexport function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}\nexport function hasBinary(obj, toJSON) {\n if (!obj || typeof obj !== \"object\") {\n return false;\n }\n if (Array.isArray(obj)) {\n for (let i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n return false;\n }\n if (isBinary(obj)) {\n return true;\n }\n if (obj.toJSON &&\n typeof obj.toJSON === \"function\" &&\n arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n return false;\n}\n","import { isBinary } from \"./is-binary.js\";\n/**\n * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @public\n */\nexport function deconstructPacket(packet) {\n const buffers = [];\n const packetData = packet.data;\n const pack = packet;\n pack.data = _deconstructPacket(packetData, buffers);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return { packet: pack, buffers: buffers };\n}\nfunction _deconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (isBinary(data)) {\n const placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n }\n else if (Array.isArray(data)) {\n const newData = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i], buffers);\n }\n return newData;\n }\n else if (typeof data === \"object\" && !(data instanceof Date)) {\n const newData = {};\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n newData[key] = _deconstructPacket(data[key], buffers);\n }\n }\n return newData;\n }\n return data;\n}\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @public\n */\nexport function reconstructPacket(packet, buffers) {\n packet.data = _reconstructPacket(packet.data, buffers);\n delete packet.attachments; // no longer useful\n return packet;\n}\nfunction _reconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (data && data._placeholder === true) {\n const isIndexValid = typeof data.num === \"number\" &&\n data.num >= 0 &&\n data.num < buffers.length;\n if (isIndexValid) {\n return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n }\n else {\n throw new Error(\"illegal attachments\");\n }\n }\n else if (Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i], buffers);\n }\n }\n else if (typeof data === \"object\") {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n data[key] = _reconstructPacket(data[key], buffers);\n }\n }\n }\n return data;\n}\n","import { Emitter } from \"@socket.io/component-emitter\";\nimport { deconstructPacket, reconstructPacket } from \"./binary.js\";\nimport { isBinary, hasBinary } from \"./is-binary.js\";\n/**\n * These strings must not be used as event names, as they have a special meaning.\n */\nconst RESERVED_EVENTS = [\n \"connect\",\n \"connect_error\",\n \"disconnect\",\n \"disconnecting\",\n \"newListener\",\n \"removeListener\", // used by the Node.js EventEmitter\n];\n/**\n * Protocol version.\n *\n * @public\n */\nexport const protocol = 5;\nexport var PacketType;\n(function (PacketType) {\n PacketType[PacketType[\"CONNECT\"] = 0] = \"CONNECT\";\n PacketType[PacketType[\"DISCONNECT\"] = 1] = \"DISCONNECT\";\n PacketType[PacketType[\"EVENT\"] = 2] = \"EVENT\";\n PacketType[PacketType[\"ACK\"] = 3] = \"ACK\";\n PacketType[PacketType[\"CONNECT_ERROR\"] = 4] = \"CONNECT_ERROR\";\n PacketType[PacketType[\"BINARY_EVENT\"] = 5] = \"BINARY_EVENT\";\n PacketType[PacketType[\"BINARY_ACK\"] = 6] = \"BINARY_ACK\";\n})(PacketType || (PacketType = {}));\n/**\n * A socket.io Encoder instance\n */\nexport class Encoder {\n /**\n * Encoder constructor\n *\n * @param {function} replacer - custom replacer to pass down to JSON.parse\n */\n constructor(replacer) {\n this.replacer = replacer;\n }\n /**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n */\n encode(obj) {\n if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {\n if (hasBinary(obj)) {\n return this.encodeAsBinary({\n type: obj.type === PacketType.EVENT\n ? PacketType.BINARY_EVENT\n : PacketType.BINARY_ACK,\n nsp: obj.nsp,\n data: obj.data,\n id: obj.id,\n });\n }\n }\n return [this.encodeAsString(obj)];\n }\n /**\n * Encode packet as string.\n */\n encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }\n /**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n */\n encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }\n}\n// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n */\nexport class Decoder extends Emitter {\n /**\n * Decoder constructor\n *\n * @param {function} reviver - custom reviver to pass down to JSON.stringify\n */\n constructor(reviver) {\n super();\n this.reviver = reviver;\n }\n /**\n * Decodes an encoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n */\n add(obj) {\n let packet;\n if (typeof obj === \"string\") {\n if (this.reconstructor) {\n throw new Error(\"got plaintext data when reconstructing a packet\");\n }\n packet = this.decodeString(obj);\n const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;\n if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {\n packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;\n // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n // no attachments, labeled binary but no binary data to follow\n if (packet.attachments === 0) {\n super.emitReserved(\"decoded\", packet);\n }\n }\n else {\n // non-binary full packet\n super.emitReserved(\"decoded\", packet);\n }\n }\n else if (isBinary(obj) || obj.base64) {\n // raw binary data\n if (!this.reconstructor) {\n throw new Error(\"got binary data when not reconstructing a packet\");\n }\n else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) {\n // received final buffer\n this.reconstructor = null;\n super.emitReserved(\"decoded\", packet);\n }\n }\n }\n else {\n throw new Error(\"Unknown type: \" + obj);\n }\n }\n /**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n */\n decodeString(str) {\n let i = 0;\n // look up type\n const p = {\n type: Number(str.charAt(0)),\n };\n if (PacketType[p.type] === undefined) {\n throw new Error(\"unknown packet type \" + p.type);\n }\n // look up attachments if type binary\n if (p.type === PacketType.BINARY_EVENT ||\n p.type === PacketType.BINARY_ACK) {\n const start = i + 1;\n while (str.charAt(++i) !== \"-\" && i != str.length) { }\n const buf = str.substring(start, i);\n if (buf != Number(buf) || str.charAt(i) !== \"-\") {\n throw new Error(\"Illegal attachments\");\n }\n p.attachments = Number(buf);\n }\n // look up namespace (if any)\n if (\"/\" === str.charAt(i + 1)) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (\",\" === c)\n break;\n if (i === str.length)\n break;\n }\n p.nsp = str.substring(start, i);\n }\n else {\n p.nsp = \"/\";\n }\n // look up id\n const next = str.charAt(i + 1);\n if (\"\" !== next && Number(next) == next) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n if (i === str.length)\n break;\n }\n p.id = Number(str.substring(start, i + 1));\n }\n // look up json data\n if (str.charAt(++i)) {\n const payload = this.tryParse(str.substr(i));\n if (Decoder.isPayloadValid(p.type, payload)) {\n p.data = payload;\n }\n else {\n throw new Error(\"invalid payload\");\n }\n }\n return p;\n }\n tryParse(str) {\n try {\n return JSON.parse(str, this.reviver);\n }\n catch (e) {\n return false;\n }\n }\n static isPayloadValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n return Array.isArray(payload);\n }\n }\n /**\n * Deallocates a parser's resources\n */\n destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n this.reconstructor = null;\n }\n }\n}\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n */\nclass BinaryReconstructor {\n constructor(packet) {\n this.packet = packet;\n this.buffers = [];\n this.reconPack = packet;\n }\n /**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n */\n takeBinaryData(binData) {\n this.buffers.push(binData);\n if (this.buffers.length === this.reconPack.attachments) {\n // done with buffer list\n const packet = reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n }\n /**\n * Cleans up binary packet reconstruction variables.\n */\n finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }\n}\n","export function on(obj, ev, fn) {\n obj.on(ev, fn);\n return function subDestroy() {\n obj.off(ev, fn);\n };\n}\n","import { PacketType } from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\n/**\n * A Socket is the fundamental class for interacting with the server.\n *\n * A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(\"connected\");\n * });\n *\n * // send an event to the server\n * socket.emit(\"foo\", \"bar\");\n *\n * socket.on(\"foobar\", () => {\n * // an event was received from the server\n * });\n *\n * // upon disconnection\n * socket.on(\"disconnect\", (reason) => {\n * console.log(`disconnected due to ${reason}`);\n * });\n */\nexport class Socket extends Emitter {\n /**\n * `Socket` constructor.\n */\n constructor(io, nsp, opts) {\n super();\n /**\n * Whether the socket is currently connected to the server.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.connected); // true\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.connected); // false\n * });\n */\n this.connected = false;\n /**\n * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will\n * be transmitted by the server.\n */\n this.recovered = false;\n /**\n * Buffer for packets received before the CONNECT packet\n */\n this.receiveBuffer = [];\n /**\n * Buffer for packets that will be sent once the socket is connected\n */\n this.sendBuffer = [];\n /**\n * The queue of packets to be sent with retry in case of failure.\n *\n * Packets are sent one by one, each waiting for the server acknowledgement, in order to guarantee the delivery order.\n * @private\n */\n this._queue = [];\n /**\n * A sequence to generate the ID of the {@link QueuedPacket}.\n * @private\n */\n this._queueSeq = 0;\n this.ids = 0;\n /**\n * A map containing acknowledgement handlers.\n *\n * The `withError` attribute is used to differentiate handlers that accept an error as first argument:\n *\n * - `socket.emit(\"test\", (err, value) => { ... })` with `ackTimeout` option\n * - `socket.timeout(5000).emit(\"test\", (err, value) => { ... })`\n * - `const value = await socket.emitWithAck(\"test\")`\n *\n * From those that don't:\n *\n * - `socket.emit(\"test\", (value) => { ... });`\n *\n * In the first case, the handlers will be called with an error when:\n *\n * - the timeout is reached\n * - the socket gets disconnected\n *\n * In the second case, the handlers will be simply discarded upon disconnection, since the client will never receive\n * an acknowledgement from the server.\n *\n * @private\n */\n this.acks = {};\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n this._opts = Object.assign({}, opts);\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Whether the socket is currently disconnected\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.disconnected); // false\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.disconnected); // true\n * });\n */\n get disconnected() {\n return !this.connected;\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects.\n *\n * @example\n * const socket = io();\n *\n * console.log(socket.active); // true\n *\n * socket.on(\"disconnect\", (reason) => {\n * if (reason === \"io server disconnect\") {\n * // the disconnection was initiated by the server, you need to manually reconnect\n * console.log(socket.active); // false\n * }\n * // else the socket will automatically try to reconnect\n * console.log(socket.active); // true\n * });\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @example\n * const socket = io({\n * autoConnect: false\n * });\n *\n * socket.connect();\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for {@link connect()}.\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * This method mimics the WebSocket.send() method.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n *\n * @example\n * socket.send(\"hello\");\n *\n * // this is equivalent to\n * socket.emit(\"message\", \"hello\");\n *\n * @return self\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @example\n * socket.emit(\"hello\", \"world\");\n *\n * // all serializable datastructures are supported (no need to call JSON.stringify)\n * socket.emit(\"hello\", 1, \"2\", { 3: [\"4\"], 5: Uint8Array.from([6]) });\n *\n * // with an acknowledgement from the server\n * socket.emit(\"hello\", \"world\", (val) => {\n * // ...\n * });\n *\n * @return self\n */\n emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev.toString() + '\" is a reserved event name');\n }\n args.unshift(ev);\n if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {\n this._addToQueue(args);\n return this;\n }\n const packet = {\n type: PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n }\n else if (this.connected) {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * @private\n */\n _registerAckCallback(id, ack) {\n var _a;\n const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;\n if (timeout === undefined) {\n this.acks[id] = ack;\n return;\n }\n // @ts-ignore\n const timer = this.io.setTimeoutFn(() => {\n delete this.acks[id];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n if (this.sendBuffer[i].id === id) {\n this.sendBuffer.splice(i, 1);\n }\n }\n ack.call(this, new Error(\"operation has timed out\"));\n }, timeout);\n const fn = (...args) => {\n // @ts-ignore\n this.io.clearTimeoutFn(timer);\n ack.apply(this, args);\n };\n fn.withError = true;\n this.acks[id] = fn;\n }\n /**\n * Emits an event and waits for an acknowledgement\n *\n * @example\n * // without timeout\n * const response = await socket.emitWithAck(\"hello\", \"world\");\n *\n * // with a specific timeout\n * try {\n * const response = await socket.timeout(1000).emitWithAck(\"hello\", \"world\");\n * } catch (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n *\n * @return a Promise that will be fulfilled when the server acknowledges the event\n */\n emitWithAck(ev, ...args) {\n return new Promise((resolve, reject) => {\n const fn = (arg1, arg2) => {\n return arg1 ? reject(arg1) : resolve(arg2);\n };\n fn.withError = true;\n args.push(fn);\n this.emit(ev, ...args);\n });\n }\n /**\n * Add the packet to the queue.\n * @param args\n * @private\n */\n _addToQueue(args) {\n let ack;\n if (typeof args[args.length - 1] === \"function\") {\n ack = args.pop();\n }\n const packet = {\n id: this._queueSeq++,\n tryCount: 0,\n pending: false,\n args,\n flags: Object.assign({ fromQueue: true }, this.flags),\n };\n args.push((err, ...responseArgs) => {\n if (packet !== this._queue[0]) {\n // the packet has already been acknowledged\n return;\n }\n const hasError = err !== null;\n if (hasError) {\n if (packet.tryCount > this._opts.retries) {\n this._queue.shift();\n if (ack) {\n ack(err);\n }\n }\n }\n else {\n this._queue.shift();\n if (ack) {\n ack(null, ...responseArgs);\n }\n }\n packet.pending = false;\n return this._drainQueue();\n });\n this._queue.push(packet);\n this._drainQueue();\n }\n /**\n * Send the first packet of the queue, and wait for an acknowledgement from the server.\n * @param force - whether to resend a packet that has not been acknowledged yet\n *\n * @private\n */\n _drainQueue(force = false) {\n if (!this.connected || this._queue.length === 0) {\n return;\n }\n const packet = this._queue[0];\n if (packet.pending && !force) {\n return;\n }\n packet.pending = true;\n packet.tryCount++;\n this.flags = packet.flags;\n this.emit.apply(this, packet.args);\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this._sendConnectPacket(data);\n });\n }\n else {\n this._sendConnectPacket(this.auth);\n }\n }\n /**\n * Sends a CONNECT packet to initiate the Socket.IO session.\n *\n * @param data\n * @private\n */\n _sendConnectPacket(data) {\n this.packet({\n type: PacketType.CONNECT,\n data: this._pid\n ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data)\n : data,\n });\n }\n /**\n * Called upon engine or manager `error`.\n *\n * @param err\n * @private\n */\n onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @param description\n * @private\n */\n onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n this._clearAcks();\n }\n /**\n * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from\n * the server.\n *\n * @private\n */\n _clearAcks() {\n Object.keys(this.acks).forEach((id) => {\n const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id);\n if (!isBuffered) {\n // note: handlers that do not accept an error as first argument are ignored here\n const ack = this.acks[id];\n delete this.acks[id];\n if (ack.withError) {\n ack.call(this, new Error(\"socket has been disconnected\"));\n }\n }\n });\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n this.onconnect(packet.data.sid, packet.data.pid);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n if (this._pid && args.length && typeof args[args.length - 1] === \"string\") {\n this._lastOffset = args[args.length - 1];\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowledgement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (typeof ack !== \"function\") {\n return;\n }\n delete this.acks[packet.id];\n // @ts-ignore FIXME ack is incorrectly inferred as 'never'\n if (ack.withError) {\n packet.data.unshift(null);\n }\n // @ts-ignore\n ack.apply(this, packet.data);\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id, pid) {\n this.id = id;\n this.recovered = pid && this._pid === pid;\n this._pid = pid; // defined only if connection state recovery is enabled\n this.connected = true;\n this.emitBuffered();\n this.emitReserved(\"connect\");\n this._drainQueue(true);\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually. In that case, the socket will not try to reconnect.\n *\n * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"disconnect\", (reason) => {\n * // console.log(reason); prints \"io client disconnect\"\n * });\n *\n * socket.disconnect();\n *\n * @return self\n */\n disconnect() {\n if (this.connected) {\n this.packet({ type: PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for {@link disconnect()}.\n *\n * @return self\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @example\n * socket.compress(false).emit(\"hello\");\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @example\n * socket.volatile.emit(\"hello\"); // the server may or may not receive it\n *\n * @returns self\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the callback will be called with an error when the\n * given number of milliseconds have elapsed without an acknowledgement from the server:\n *\n * @example\n * socket.timeout(5000).emit(\"my-event\", (err) => {\n * if (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n * });\n *\n * @returns self\n */\n timeout(timeout) {\n this.flags.timeout = timeout;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @example\n * socket.onAny((event, ...args) => {\n * console.log(`got ${event}`);\n * });\n *\n * @param listener\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @example\n * socket.prependAny((event, ...args) => {\n * console.log(`got event ${event}`);\n * });\n *\n * @param listener\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`got event ${event}`);\n * }\n *\n * socket.onAny(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAny(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAny();\n *\n * @param listener\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.onAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n onAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.prependAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n prependAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`sent event ${event}`);\n * }\n *\n * socket.onAnyOutgoing(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAnyOutgoing(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAnyOutgoing();\n *\n * @param [listener] - the catch-all listener (optional)\n */\n offAnyOutgoing(listener) {\n if (!this._anyOutgoingListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyOutgoingListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyOutgoingListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }\n /**\n * Notify the listeners for each packet sent\n *\n * @param packet\n *\n * @private\n */\n notifyOutgoingListeners(packet) {\n if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {\n const listeners = this._anyOutgoingListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, packet.data);\n }\n }\n }\n}\n","/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\nexport function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\nBackoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\nBackoff.prototype.reset = function () {\n this.attempts = 0;\n};\n/**\n * Set the minimum duration\n *\n * @api public\n */\nBackoff.prototype.setMin = function (min) {\n this.ms = min;\n};\n/**\n * Set the maximum duration\n *\n * @api public\n */\nBackoff.prototype.setMax = function (max) {\n this.max = max;\n};\n/**\n * Set the jitter\n *\n * @api public\n */\nBackoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n};\n","import { Socket as Engine, installTimerFunctions, nextTick, } from \"engine.io-client\";\nimport { Socket } from \"./socket.js\";\nimport * as parser from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Backoff } from \"./contrib/backo2.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\nexport class Manager extends Emitter {\n constructor(uri, opts) {\n var _a;\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n installTimerFunctions(this, opts);\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n if (~this._readyState.indexOf(\"open\"))\n return this;\n this.engine = new Engine(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSubDestroy = on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n const onError = (err) => {\n this.cleanup();\n this._readyState = \"closed\";\n this.emitReserved(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n this.maybeReconnectOnOpen();\n }\n };\n // emit `error`\n const errorSub = on(socket, \"error\", onError);\n if (false !== this._timeout) {\n const timeout = this._timeout;\n // set timer\n const timer = this.setTimeoutFn(() => {\n openSubDestroy();\n onError(new Error(\"timeout\"));\n socket.close();\n }, timeout);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n this.subs.push(openSubDestroy);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n this.emitReserved(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n try {\n this.decoder.add(data);\n }\n catch (e) {\n this.onclose(\"parse error\", e);\n }\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n this.emitReserved(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n else if (this._autoConnect && !socket.active) {\n socket.connect();\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called upon engine close.\n *\n * @private\n */\n onclose(reason, description) {\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n this.emitReserved(\"close\", reason, description);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n this.backoff.reset();\n this.emitReserved(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n this._reconnecting = true;\n const timer = this.setTimeoutFn(() => {\n if (self.skipReconnect)\n return;\n this.emitReserved(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n self._reconnecting = false;\n self.reconnect();\n this.emitReserved(\"reconnect_error\", err);\n }\n else {\n self.onreconnect();\n }\n });\n }, delay);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }\n}\n","import { url } from \"./url.js\";\nimport { Manager } from \"./manager.js\";\nimport { Socket } from \"./socket.js\";\n/**\n * Managers cache.\n */\nconst cache = {};\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url(uri, opts.path || \"/socket.io\");\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n io = new Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n cache[id] = new Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.queryKey;\n }\n return io.socket(parsed.path, opts);\n}\n// so that \"lookup\" can be used both as a function (e.g. `io(...)`) and as a\n// namespace (e.g. `io.connect(...)`), for backward compatibility\nObject.assign(lookup, {\n Manager,\n Socket,\n io: lookup,\n connect: lookup,\n});\n/**\n * Protocol version.\n *\n * @public\n */\nexport { protocol } from \"socket.io-parser\";\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nexport { Manager, Socket, lookup as io, lookup as connect, lookup as default, };\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n","import { API_URL, EVENTS_SOCKET } from '@/constants'\r\nimport { TMessage, TTemplateType } from '@/types/chatbox'\r\nimport { genId, getAddress } from '@/utils'\r\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\r\nimport {\r\n createContext,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react'\r\nimport { Socket, io } from 'socket.io-client'\r\nimport { useUnmount } from 'usehooks-ts'\r\n\r\nexport type TSocketCtx = {\r\n socket: Socket\r\n messages: TMessage[]\r\n channelId: string\r\n onEndBot?: () => void\r\n isTest?: boolean\r\n handleSendMessage: (options: {\r\n message: string\r\n cb?: (data: TMessage) => void\r\n type?: TTemplateType\r\n extraData?: string\r\n }) => void\r\n handleClose: () => void\r\n disableInput?: boolean\r\n isShowClose?: boolean\r\n isLoadingMessages?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n handleReload: () => void\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n handleTyping?: () => void\r\n adminId?: string\r\n isForManager?: boolean\r\n}\r\n\r\nexport const SocketCtx = createContext({} as TSocketCtx)\r\n\r\nexport type Props = {\r\n children: React.ReactNode\r\n channelId?: string\r\n onEndBot?: () => void\r\n className?: string\r\n isTest?: boolean\r\n onClose?: () => void\r\n isShowClose?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n isForPreview?: boolean\r\n isForManager?: boolean\r\n adminId?: string\r\n}\r\n\r\nexport const SocketProvider = ({\r\n children,\r\n channelId,\r\n onEndBot,\r\n isTest = false,\r\n onClose,\r\n isShowClose = true,\r\n isForLiveChat,\r\n userId,\r\n customStyles: _customStyles,\r\n isForPreview,\r\n isForManager,\r\n adminId,\r\n}: Props) => {\r\n const [disableInput, setDisableInput] = useState(false)\r\n const [customStyles, setCustomStyles] = useState(\r\n isForManager ? undefined : _customStyles,\r\n )\r\n\r\n const queryClient = useQueryClient()\r\n\r\n const urlParams = useMemo(\r\n () => new URLSearchParams(window.location.search),\r\n [],\r\n )\r\n\r\n const _userId = useMemo(() => (userId ? userId : genId()), [userId])\r\n const _channelId = useMemo(\r\n () => channelId || urlParams.get('channelId') || '',\r\n [channelId, urlParams],\r\n )\r\n\r\n const socketRef = useRef(\r\n io(API_URL, {\r\n autoConnect: false,\r\n transports: ['websocket'],\r\n query: {\r\n userId: adminId ? `${_userId}_${adminId}` : _userId,\r\n },\r\n }),\r\n )\r\n\r\n const { data: messages, isLoading } = useQuery({\r\n queryKey: ['messages', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n if (isForPreview) {\r\n return [\r\n {\r\n isBot: true,\r\n message: 'Hello, how can I help you?',\r\n createdAt: new Date().toISOString(),\r\n },\r\n {\r\n isBot: false,\r\n message: 'I want to know more about your product',\r\n userId: genId(),\r\n createdAt: new Date().toISOString(),\r\n },\r\n ]\r\n }\r\n\r\n const res = await fetch(\r\n `${URL}/api/conversation-live-chat/${\r\n userId || genId()\r\n }/${_channelId}`,\r\n )\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Array\r\n } catch (error) {\r\n return []\r\n }\r\n },\r\n initialData: [],\r\n })\r\n\r\n const { data: custom } = useQuery({\r\n queryKey: ['custom-style', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n const res = await fetch(`${API_URL}/api/custom-chatbox/${_channelId}`)\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Record\r\n } catch (error) {\r\n return undefined\r\n }\r\n },\r\n enabled: !isTest && !isForPreview && !isForManager,\r\n })\r\n\r\n const handleSendMessage: TSocketCtx['handleSendMessage'] = useCallback(\r\n ({ message, cb, extraData, type }) => {\r\n const trimmedMessage = message.trim()\r\n if (trimmedMessage.length === 0) return\r\n\r\n const address = getAddress(_channelId, userId)\r\n\r\n const newMessage: TMessage = {\r\n message: type === 'list-button' ? extraData || '' : trimmedMessage,\r\n userId: adminId ? adminId : userId || genId(),\r\n template: {} as any,\r\n createdAt: new Date().toISOString(),\r\n isTest,\r\n }\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n message: trimmedMessage,\r\n address,\r\n isTest,\r\n createdAt: newMessage.createdAt,\r\n })\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, newMessage]\r\n },\r\n )\r\n\r\n cb && cb(newMessage)\r\n },\r\n [_channelId, adminId, isTest, queryClient, userId],\r\n )\r\n\r\n const handleClose = useCallback(() => {\r\n if (window.parent) {\r\n window.parent.postMessage(\r\n {\r\n type: 'TOGGLE_CHAT',\r\n },\r\n '*',\r\n )\r\n }\r\n onClose?.()\r\n }, [onClose])\r\n\r\n const handleReload = useCallback(() => {\r\n if (isForPreview) return\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n type: 'event',\r\n typeName: 'endConversation',\r\n address: getAddress(_channelId, userId),\r\n isTest,\r\n message: '',\r\n })\r\n setDisableInput(false)\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n () => {\r\n return []\r\n },\r\n )\r\n }, [_channelId, isForPreview, isTest, queryClient, userId])\r\n\r\n useUnmount(() => {\r\n socketRef.current.disconnect()\r\n })\r\n\r\n useEffect(() => {\r\n // if customStyles is set, don't connect to socket because it for preview\r\n if (isForPreview) return\r\n\r\n const socket = socketRef.current\r\n\r\n socket.connect()\r\n\r\n socket.on(EVENTS_SOCKET.MESSAGE, (data) => {\r\n if (data.template?.type === 'list-button') {\r\n setDisableInput(true)\r\n } else {\r\n setDisableInput(false)\r\n }\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, data].filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, { userId: 'typing' }]\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.STOP_TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return prev.filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n return () => {\r\n socket.disconnect()\r\n }\r\n }, [_channelId, queryClient, userId, isForPreview])\r\n\r\n useEffect(() => {\r\n if (isForPreview) {\r\n setDisableInput(true)\r\n }\r\n }, [isForPreview])\r\n\r\n useEffect(() => {\r\n if (custom && !isForManager) {\r\n setCustomStyles(custom as any)\r\n }\r\n }, [custom, isForManager])\r\n\r\n useEffect(() => {\r\n if (_customStyles && !isForManager) {\r\n setCustomStyles(_customStyles)\r\n }\r\n }, [_customStyles, isForManager])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n","import { SocketCtx } from '@/context/socket.ctx'\r\nimport { useContext } from 'react'\r\n\r\n/**\r\n * Custom hook that provides access to the socket context.\r\n * @returns The socket context.\r\n * @throws {Error} If used outside of the SocketProvider.\r\n */\r\nexport const useSocket = () => {\r\n const socketCtx = useContext(SocketCtx)\r\n\r\n if (!socketCtx) {\r\n throw new Error('useSocket must be used within SocketProvider')\r\n }\r\n\r\n return socketCtx\r\n}\r\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t validator(classRest))?.classGroupId;\n}\nconst arbitraryPropertyRegex = /^\\[(.+)\\]$/;\nfunction getGroupIdForArbitraryProperty(className) {\n if (arbitraryPropertyRegex.test(className)) {\n const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];\n const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));\n if (property) {\n // I use two dots here because one dot is used as prefix for class groups in plugins\n return 'arbitrary..' + property;\n }\n }\n}\n/**\n * Exported for testing only\n */\nfunction createClassMap(config) {\n const {\n theme,\n prefix\n } = config;\n const classMap = {\n nextPart: new Map(),\n validators: []\n };\n const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);\n prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {\n processClassesRecursively(classGroup, classMap, classGroupId, theme);\n });\n return classMap;\n}\nfunction processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {\n classGroup.forEach(classDefinition => {\n if (typeof classDefinition === 'string') {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n return;\n }\n if (typeof classDefinition === 'function') {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n classPartObject.validators.push({\n validator: classDefinition,\n classGroupId\n });\n return;\n }\n Object.entries(classDefinition).forEach(([key, classGroup]) => {\n processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);\n });\n });\n}\nfunction getPart(classPartObject, path) {\n let currentClassPartObject = classPartObject;\n path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {\n if (!currentClassPartObject.nextPart.has(pathPart)) {\n currentClassPartObject.nextPart.set(pathPart, {\n nextPart: new Map(),\n validators: []\n });\n }\n currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);\n });\n return currentClassPartObject;\n}\nfunction isThemeGetter(func) {\n return func.isThemeGetter;\n}\nfunction getPrefixedClassGroupEntries(classGroupEntries, prefix) {\n if (!prefix) {\n return classGroupEntries;\n }\n return classGroupEntries.map(([classGroupId, classGroup]) => {\n const prefixedClassGroup = classGroup.map(classDefinition => {\n if (typeof classDefinition === 'string') {\n return prefix + classDefinition;\n }\n if (typeof classDefinition === 'object') {\n return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));\n }\n return classDefinition;\n });\n return [classGroupId, prefixedClassGroup];\n });\n}\n\n// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance\nfunction createLruCache(maxCacheSize) {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = new Map();\n let previousCache = new Map();\n function update(key, value) {\n cache.set(key, value);\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = new Map();\n }\n }\n return {\n get(key) {\n let value = cache.get(key);\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache.get(key)) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (cache.has(key)) {\n cache.set(key, value);\n } else {\n update(key, value);\n }\n }\n };\n}\nconst IMPORTANT_MODIFIER = '!';\nfunction createSplitModifiers(config) {\n const separator = config.separator;\n const isSeparatorSingleCharacter = separator.length === 1;\n const firstSeparatorCharacter = separator[0];\n const separatorLength = separator.length;\n // splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n return function splitModifiers(className) {\n const modifiers = [];\n let bracketDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n for (let index = 0; index < className.length; index++) {\n let currentCharacter = className[index];\n if (bracketDepth === 0) {\n if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + separatorLength;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') {\n bracketDepth++;\n } else if (currentCharacter === ']') {\n bracketDepth--;\n }\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);\n const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);\n const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n };\n };\n}\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nfunction sortModifiers(modifiers) {\n if (modifiers.length <= 1) {\n return modifiers;\n }\n const sortedModifiers = [];\n let unsortedModifiers = [];\n modifiers.forEach(modifier => {\n const isArbitraryVariant = modifier[0] === '[';\n if (isArbitraryVariant) {\n sortedModifiers.push(...unsortedModifiers.sort(), modifier);\n unsortedModifiers = [];\n } else {\n unsortedModifiers.push(modifier);\n }\n });\n sortedModifiers.push(...unsortedModifiers.sort());\n return sortedModifiers;\n}\nfunction createConfigUtils(config) {\n return {\n cache: createLruCache(config.cacheSize),\n splitModifiers: createSplitModifiers(config),\n ...createClassUtils(config)\n };\n}\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nfunction mergeClassList(classList, configUtils) {\n const {\n splitModifiers,\n getClassGroupId,\n getConflictingClassGroupIds\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = new Set();\n return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName => {\n const {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = splitModifiers(originalClassName);\n let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n let hasPostfixModifier = Boolean(maybePostfixModifierPosition);\n if (!classGroupId) {\n if (!maybePostfixModifierPosition) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n hasPostfixModifier = false;\n }\n const variantModifier = sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n return {\n isTailwindClass: true,\n modifierId,\n classGroupId,\n originalClassName,\n hasPostfixModifier\n };\n }).reverse()\n // Last class in conflict wins, so we need to filter conflicting classes in reverse order.\n .filter(parsed => {\n if (!parsed.isTailwindClass) {\n return true;\n }\n const {\n modifierId,\n classGroupId,\n hasPostfixModifier\n } = parsed;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.has(classId)) {\n return false;\n }\n classGroupsInConflict.add(classId);\n getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(group => classGroupsInConflict.add(modifierId + group));\n return true;\n }).reverse().map(parsed => parsed.originalClassName).join(' ');\n}\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards (lukeed.com)\n */\nfunction twJoin() {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < arguments.length) {\n if (argument = arguments[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction toValue(mix) {\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction createTailwindMerge(createConfigFirst, ...createConfigRest) {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall = initTailwindMerge;\n function initTailwindMerge(classList) {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n }\n function tailwindMerge(classList) {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n }\n return function callTailwindMerge() {\n return functionToCall(twJoin.apply(null, arguments));\n };\n}\nfunction fromTheme(key) {\n const themeGetter = theme => theme[key] || [];\n themeGetter.isThemeGetter = true;\n return themeGetter;\n}\nconst arbitraryValueRegex = /^\\[(?:([a-z-]+):)?(.+)\\]$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nfunction isLength(value) {\n return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);\n}\nfunction isArbitraryLength(value) {\n return getIsArbitraryValue(value, 'length', isLengthOnly);\n}\nfunction isNumber(value) {\n return Boolean(value) && !Number.isNaN(Number(value));\n}\nfunction isArbitraryNumber(value) {\n return getIsArbitraryValue(value, 'number', isNumber);\n}\nfunction isInteger(value) {\n return Boolean(value) && Number.isInteger(Number(value));\n}\nfunction isPercent(value) {\n return value.endsWith('%') && isNumber(value.slice(0, -1));\n}\nfunction isArbitraryValue(value) {\n return arbitraryValueRegex.test(value);\n}\nfunction isTshirtSize(value) {\n return tshirtUnitRegex.test(value);\n}\nconst sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);\nfunction isArbitrarySize(value) {\n return getIsArbitraryValue(value, sizeLabels, isNever);\n}\nfunction isArbitraryPosition(value) {\n return getIsArbitraryValue(value, 'position', isNever);\n}\nconst imageLabels = /*#__PURE__*/new Set(['image', 'url']);\nfunction isArbitraryImage(value) {\n return getIsArbitraryValue(value, imageLabels, isImage);\n}\nfunction isArbitraryShadow(value) {\n return getIsArbitraryValue(value, '', isShadow);\n}\nfunction isAny() {\n return true;\n}\nfunction getIsArbitraryValue(value, label, testValue) {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return typeof label === 'string' ? result[1] === label : label.has(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n}\nfunction isLengthOnly(value) {\n // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n // For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\n return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\n}\nfunction isNever() {\n return false;\n}\nfunction isShadow(value) {\n return shadowRegex.test(value);\n}\nfunction isImage(value) {\n return imageRegex.test(value);\n}\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isInteger,\n isLength,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nfunction getDefaultConfig() {\n const colors = fromTheme('colors');\n const spacing = fromTheme('spacing');\n const blur = fromTheme('blur');\n const brightness = fromTheme('brightness');\n const borderColor = fromTheme('borderColor');\n const borderRadius = fromTheme('borderRadius');\n const borderSpacing = fromTheme('borderSpacing');\n const borderWidth = fromTheme('borderWidth');\n const contrast = fromTheme('contrast');\n const grayscale = fromTheme('grayscale');\n const hueRotate = fromTheme('hueRotate');\n const invert = fromTheme('invert');\n const gap = fromTheme('gap');\n const gradientColorStops = fromTheme('gradientColorStops');\n const gradientColorStopPositions = fromTheme('gradientColorStopPositions');\n const inset = fromTheme('inset');\n const margin = fromTheme('margin');\n const opacity = fromTheme('opacity');\n const padding = fromTheme('padding');\n const saturate = fromTheme('saturate');\n const scale = fromTheme('scale');\n const sepia = fromTheme('sepia');\n const skew = fromTheme('skew');\n const space = fromTheme('space');\n const translate = fromTheme('translate');\n const getOverscroll = () => ['auto', 'contain', 'none'];\n const getOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const getSpacingWithAutoAndArbitrary = () => ['auto', isArbitraryValue, spacing];\n const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];\n const getLengthWithEmptyAndArbitrary = () => ['', isLength, isArbitraryLength];\n const getNumberWithAutoAndArbitrary = () => ['auto', isNumber, isArbitraryValue];\n const getPositions = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];\n const getLineStyles = () => ['solid', 'dashed', 'dotted', 'double', 'none'];\n const getBlendModes = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];\n const getAlign = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];\n const getZeroAndEmpty = () => ['', '0', isArbitraryValue];\n const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const getNumber = () => [isNumber, isArbitraryNumber];\n const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];\n return {\n cacheSize: 500,\n separator: ':',\n theme: {\n colors: [isAny],\n spacing: [isLength, isArbitraryLength],\n blur: ['none', '', isTshirtSize, isArbitraryValue],\n brightness: getNumber(),\n borderColor: [colors],\n borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],\n borderSpacing: getSpacingWithArbitrary(),\n borderWidth: getLengthWithEmptyAndArbitrary(),\n contrast: getNumber(),\n grayscale: getZeroAndEmpty(),\n hueRotate: getNumberAndArbitrary(),\n invert: getZeroAndEmpty(),\n gap: getSpacingWithArbitrary(),\n gradientColorStops: [colors],\n gradientColorStopPositions: [isPercent, isArbitraryLength],\n inset: getSpacingWithAutoAndArbitrary(),\n margin: getSpacingWithAutoAndArbitrary(),\n opacity: getNumber(),\n padding: getSpacingWithArbitrary(),\n saturate: getNumber(),\n scale: getNumber(),\n sepia: getZeroAndEmpty(),\n skew: getNumberAndArbitrary(),\n space: getSpacingWithArbitrary(),\n translate: getSpacingWithArbitrary()\n },\n classGroups: {\n // Layout\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', 'video', isArbitraryValue]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isTshirtSize]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': getBreaks()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': getBreaks()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: [...getPositions(), isArbitraryValue]\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: getOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': getOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': getOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: getOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': getOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': getOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: [inset]\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': [inset]\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': [inset]\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: [inset]\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: [inset]\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: [inset]\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: [inset]\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: [inset]\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: [inset]\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: ['auto', isInteger, isArbitraryValue]\n }],\n // Flexbox and Grid\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: getSpacingWithAutoAndArbitrary()\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['wrap', 'wrap-reverse', 'nowrap']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: ['1', 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: getZeroAndEmpty()\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: getZeroAndEmpty()\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: ['first', 'last', 'none', isInteger, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': [isAny]\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: ['auto', {\n span: ['full', isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': [isAny]\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: ['auto', {\n span: [isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: [gap]\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': [gap]\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': [gap]\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: ['normal', ...getAlign()]\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': ['start', 'end', 'center', 'stretch']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...getAlign(), 'baseline']\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', 'start', 'end', 'center', 'stretch', 'baseline']\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': [...getAlign(), 'baseline']\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: [padding]\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: [padding]\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: [padding]\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: [padding]\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: [padding]\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: [padding]\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: [padding]\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: [padding]\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: [padding]\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: [margin]\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: [margin]\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: [margin]\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: [margin]\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: [margin]\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: [margin]\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: [margin]\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: [margin]\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: [margin]\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x': [{\n 'space-x': [space]\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y': [{\n 'space-y': [space]\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y-reverse': ['space-y-reverse'],\n // Sizing\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: ['auto', 'min', 'max', 'fit', 'svw', 'lvw', 'dvw', isArbitraryValue, spacing]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit']\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [isArbitraryValue, spacing, 'none', 'full', 'min', 'max', 'fit', 'prose', {\n screen: [isTshirtSize]\n }, isTshirtSize]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Size\n * @see https://tailwindcss.com/docs/size\n */\n size: [{\n size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']\n }],\n // Typography\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', isTshirtSize, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black', isArbitraryNumber]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isAny]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractons'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest', isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': ['none', isNumber, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryValue]\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['none', 'disc', 'decimal', isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: [colors]\n }],\n /**\n * Placeholder Opacity\n * @see https://tailwindcss.com/docs/placeholder-opacity\n */\n 'placeholder-opacity': [{\n 'placeholder-opacity': [opacity]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: [colors]\n }],\n /**\n * Text Opacity\n * @see https://tailwindcss.com/docs/text-opacity\n */\n 'text-opacity': [{\n 'text-opacity': [opacity]\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...getLineStyles(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: ['auto', 'from-font', isLength, isArbitraryLength]\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': ['auto', isLength, isArbitraryValue]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: [colors]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: getSpacingWithArbitrary()\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryValue]\n }],\n // Backgrounds\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Opacity\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/background-opacity\n */\n 'bg-opacity': [{\n 'bg-opacity': [opacity]\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: [...getPositions(), isArbitraryPosition]\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: ['no-repeat', {\n repeat: ['', 'x', 'y', 'round', 'space']\n }]\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: ['auto', 'cover', 'contain', isArbitrarySize]\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n 'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: [colors]\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: [gradientColorStops]\n }],\n // Borders\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: [borderRadius]\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': [borderRadius]\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': [borderRadius]\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': [borderRadius]\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': [borderRadius]\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': [borderRadius]\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': [borderRadius]\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': [borderRadius]\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': [borderRadius]\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': [borderRadius]\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': [borderRadius]\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': [borderRadius]\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': [borderRadius]\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': [borderRadius]\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': [borderRadius]\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: [borderWidth]\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': [borderWidth]\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': [borderWidth]\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': [borderWidth]\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': [borderWidth]\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': [borderWidth]\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': [borderWidth]\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': [borderWidth]\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': [borderWidth]\n }],\n /**\n * Border Opacity\n * @see https://tailwindcss.com/docs/border-opacity\n */\n 'border-opacity': [{\n 'border-opacity': [opacity]\n }],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...getLineStyles(), 'hidden']\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x': [{\n 'divide-x': [borderWidth]\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y': [{\n 'divide-y': [borderWidth]\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Divide Opacity\n * @see https://tailwindcss.com/docs/divide-opacity\n */\n 'divide-opacity': [{\n 'divide-opacity': [opacity]\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/divide-style\n */\n 'divide-style': [{\n divide: getLineStyles()\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: [borderColor]\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': [borderColor]\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': [borderColor]\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': [borderColor]\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': [borderColor]\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': [borderColor]\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': [borderColor]\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: [borderColor]\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: ['', ...getLineStyles()]\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isLength, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: [isLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: [colors]\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w': [{\n ring: getLengthWithEmptyAndArbitrary()\n }],\n /**\n * Ring Width Inset\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/ring-color\n */\n 'ring-color': [{\n ring: [colors]\n }],\n /**\n * Ring Opacity\n * @see https://tailwindcss.com/docs/ring-opacity\n */\n 'ring-opacity': [{\n 'ring-opacity': [opacity]\n }],\n /**\n * Ring Offset Width\n * @see https://tailwindcss.com/docs/ring-offset-width\n */\n 'ring-offset-w': [{\n 'ring-offset': [isLength, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://tailwindcss.com/docs/ring-offset-color\n */\n 'ring-offset-color': [{\n 'ring-offset': [colors]\n }],\n // Effects\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: ['', 'inner', 'none', isTshirtSize, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow-color\n */\n 'shadow-color': [{\n shadow: [isAny]\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [opacity]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': getBlendModes()\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': getBlendModes()\n }],\n // Filters\n /**\n * Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: ['', 'none']\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: [blur]\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [brightness]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [contrast]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': ['', 'none', isTshirtSize, isArbitraryValue]\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: [grayscale]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [hueRotate]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: [invert]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [saturate]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: [sepia]\n }],\n /**\n * Backdrop Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': ['', 'none']\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': [blur]\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [brightness]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [contrast]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': [grayscale]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [hueRotate]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': [invert]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [opacity]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [saturate]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': [sepia]\n }],\n // Tables\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': [borderSpacing]\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': [borderSpacing]\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': [borderSpacing]\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // Transitions and Animation\n /**\n * Tranisition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['none', 'all', '', 'colors', 'opacity', 'shadow', 'transform', isArbitraryValue]\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: getNumberAndArbitrary()\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'in', 'out', 'in-out', isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: getNumberAndArbitrary()\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', 'spin', 'ping', 'pulse', 'bounce', isArbitraryValue]\n }],\n // Transforms\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: ['', 'gpu', 'none']\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: [scale]\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': [scale]\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': [scale]\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: [isInteger, isArbitraryValue]\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': [translate]\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': [translate]\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': [skew]\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': [skew]\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryValue]\n }],\n // Interactivity\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: ['auto', colors]\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryValue]\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: [colors]\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['none', 'auto']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', 'y', 'x', '']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryValue]\n }],\n // SVG\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: [colors, 'none']\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: [colors, 'none']\n }],\n // Accessibility\n /**\n * Screen Readers\n * @see https://tailwindcss.com/docs/screen-readers\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n }\n };\n}\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nfunction mergeConfigs(baseConfig, {\n cacheSize,\n prefix,\n separator,\n extend = {},\n override = {}\n}) {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'separator', separator);\n for (const configKey in override) {\n overrideConfigProperties(baseConfig[configKey], override[configKey]);\n }\n for (const key in extend) {\n mergeConfigProperties(baseConfig[key], extend[key]);\n }\n return baseConfig;\n}\nfunction overrideProperty(baseObject, overrideKey, overrideValue) {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n}\nfunction overrideConfigProperties(baseObject, overrideObject) {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n}\nfunction mergeConfigProperties(baseObject, mergeObject) {\n if (mergeObject) {\n for (const key in mergeObject) {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = (baseObject[key] || []).concat(mergeValue);\n }\n }\n }\n}\nfunction extendTailwindMerge(configExtension, ...createConfig) {\n return typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\n}\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { toKebabCase } from './shared/src/utils.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n ...rest\n }, ref) => {\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: [\"lucide\", `lucide-${toKebabCase(iconName)}`, className].join(\" \"),\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n );\n Component.displayName = `${iconName}`;\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst LoaderCircle = createLucideIcon(\"LoaderCircle\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]\n]);\n\nexport { LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCcw = createLucideIcon(\"RefreshCcw\", [\n [\"path\", { d: \"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"14sxne\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }],\n [\"path\", { d: \"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16\", key: \"1hlbsb\" }],\n [\"path\", { d: \"M16 16h5v5\", key: \"ccwih5\" }]\n]);\n\nexport { RefreshCcw as default };\n//# sourceMappingURL=refresh-ccw.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Send = createLucideIcon(\"Send\", [\n [\"path\", { d: \"m22 2-7 20-4-9-9-4Z\", key: \"1q3vgg\" }],\n [\"path\", { d: \"M22 2 11 13\", key: \"nzbqef\" }]\n]);\n\nexport { Send as default };\n//# sourceMappingURL=send.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst X = createLucideIcon(\"X\", [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n]);\n\nexport { X as default };\n//# sourceMappingURL=x.js.map\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { TMessage } from '@/types/chatbox'\r\n\r\ntype Props = {\r\n message: TMessage\r\n children?: React.ReactNode\r\n}\r\n\r\n/**\r\n * Represents a message component.\r\n * @param {Object} props - The component props.\r\n * @param {boolean} props.isBot - Indicates whether the message is from a bot.\r\n * @param {string} props.message - The content of the message.\r\n *\r\n */\r\nconst Message = ({ message, children }: Props) => {\r\n const { customStyles, adminId: _adminId, isForManager } = useSocket()\r\n\r\n const isLeft = message.isBot\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {isForManager ? (message.isBot ? 'From bot' : 'From user') : null}\r\n \r\n \r\n {message.message}\r\n {children}\r\n
\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Message\r\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;ttypeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../lib/utils'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow hover:bg-primary/90',\n destructive:\n 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n message:\n 'bg-background shadow-sm border text-primary border-primary hover:bg-primary/10 !rounded-full',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes,\n VariantProps {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return (\n \n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TButtonsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TButtonsMessage\r\n}\r\n\r\nconst ButtonsMessage = ({ message }: Props) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n return (\r\n
\r\n \r\n
\r\n {message.template.data.map((button) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default ButtonsMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TCard, TCardsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TCardsMessage\r\n}\r\n\r\nconst Card = ({ card }: { card: TCard }) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n \r\n

{card.title}

\r\n

{card.subtitle}

\r\n {card.buttons && card.buttons.length > 0 && (\r\n
\r\n {card.buttons.map((button, index) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl\r\n ? `${hsl.h} ${hsl.s}% ${hsl.l}%`\r\n : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport const CardsMessage = ({ message }: Props) => {\r\n return (\r\n
\r\n {message.template.data.map((card, index) => {\r\n return (\r\n }\r\n />\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import Message from './message'\r\n\r\nexport const TypingMessage = () => {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n }\r\n />\r\n )\r\n}\r\n\r\nexport default TypingMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TMessage } from '@/types/chatbox'\r\nimport dayjs from 'dayjs'\r\nimport { Loader2 } from 'lucide-react'\r\nimport { Fragment, useEffect, useRef } from 'react'\r\nimport ButtonsMessage from './buttons-message'\r\nimport { CardsMessage } from './cards-message'\r\nimport Message from './message'\r\nimport TypingMessage from './typing-message'\r\n\r\n/**\r\n * Represents the body component of the chatbox.\r\n * This component displays the main content of the chatbox.\r\n */\r\n\r\nconst Body = () => {\r\n const endMessageRef = useRef(null)\r\n const { messages, isLoadingMessages } = useSocket()\r\n\r\n /**\r\n * Scrolls to the end of the messages when a new message is received.\r\n */\r\n useEffect(() => {\r\n if (!endMessageRef.current) return\r\n\r\n endMessageRef.current.scrollIntoView({ behavior: 'smooth' })\r\n }, [messages])\r\n\r\n const renderMessage = (msg: TMessage, index: number) => {\r\n if (msg?.userId === 'typing') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-button') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-card') {\r\n return \r\n }\r\n\r\n return \r\n }\r\n\r\n return (\r\n
\r\n {isLoadingMessages ? (\r\n
\r\n \r\n
\r\n ) : (\r\n
\r\n {messages.length > 0 && (\r\n
\r\n {dayjs(messages[0].createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {messages.map((msg, index) => {\r\n return (\r\n \r\n {index > 0 &&\r\n dayjs(msg.createdAt).diff(\r\n dayjs(messages[index - 1].createdAt),\r\n 'minutes',\r\n ) > 10 && (\r\n
\r\n {dayjs(msg.createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {renderMessage(msg, index)}\r\n
\r\n )\r\n })}\r\n\r\n
\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport default Body\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { RefreshCcw, X } from 'lucide-react'\r\n\r\n/**\r\n * Represents the header component of the chatbox.\r\n *\r\n */\r\nconst Header = () => {\r\n const { handleClose, isShowClose, handleReload, customStyles, isForManager } =\r\n useSocket()\r\n return (\r\n \r\n
\r\n
\r\n {customStyles?.logoUrl ? (\r\n \r\n ) : (\r\n \r\n \r\n B\r\n \r\n \r\n )}\r\n \r\n {customStyles?.name || 'DialogueBot'}\r\n \r\n
\r\n
\r\n {!isForManager && (\r\n \r\n \r\n
\r\n )}\r\n {isShowClose && (\r\n \r\n \r\n
\r\n )}\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default Header\r\n","import * as React from 'react'\n\nimport { cn } from '../../lib/utils'\nexport interface InputProps\n extends React.InputHTMLAttributes {}\n\nconst Input = React.forwardRef(\n ({ className, type, ...props }, ref) => {\n return (\n \n )\n },\n)\nInput.displayName = 'Input'\n\nexport { Input }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { hexToHSL } from '@/utils'\r\nimport { Send } from 'lucide-react'\r\nimport { useState } from 'react'\r\nimport { Button } from './ui/button'\r\nimport { Input } from './ui/input'\r\n\r\n/**\r\n * Represents the send area component.\r\n */\r\nconst SendArea = () => {\r\n const { handleSendMessage, disableInput, customStyles } = useSocket()\r\n const [message, setMessage] = useState('')\r\n\r\n const handleEnter = (e: React.KeyboardEvent) => {\r\n if (e.key === 'Enter') {\r\n e.preventDefault()\r\n handleSendMessage({\r\n message,\r\n })\r\n\r\n setMessage('')\r\n }\r\n }\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n setMessage(e.target.value)}\r\n onKeyDown={handleEnter}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n />\r\n {\r\n handleSendMessage({\r\n message,\r\n cb: () => setMessage(''),\r\n })\r\n }}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nexport default SendArea\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\r\nimport { Body, Header, SendArea } from '../components'\r\nimport { Props, SocketProvider } from '../context/socket.ctx'\r\n\r\nconst queryClient = new QueryClient()\r\n\r\n/**\r\n * Represents the ChatBox component.\r\n * This component displays a chat box with a header, body, and send area.\r\n */\r\n\r\nconst ChatBox = ({ className }: { className?: string }) => {\r\n const { customStyles, isForManager } = useSocket()\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n {!isForManager && }\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Wrapper component for the chat box.\r\n *\r\n * @returns The rendered chat box wrapped in a SocketProvider.\r\n */\r\nconst ChatBoxWrapper = (props: Omit) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default ChatBoxWrapper\r\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","Object$","Map$","Set$","SetHas$","SetAdd$","MapHas$","MapGet$","MapSet$","ChildFlag","AttributeFlag","EventFlag","StyleAttributeFlag","SvgAttributeFlag","BlockFlag","TEXT_NODE_CACHE","EVENT_PATCH","EVENTS_REGISTRY","IS_NON_DIMENSIONAL","XLINK_NS","XML_NS","X_CHAR","NON_PROPS","VOID_ELEMENTS","document$","HTM_TEMPLATE","HTM_TEMPLATE_CONTENT","SVG_TEMPLATE","node$","element$","characterData$","getOwnPropertyDescriptor$","insertBefore$","cloneNode$","replaceChild$","remove$$1","addEventListener$","removeAttribute$","setAttribute$","setAttributeNS$","setTextContent$","firstChild$","nextSibling$","characterDataSet$","stringToDOM","content","svg","template","createEventListener","el","event","capture","nativeEvent","el2","handler","patch","newValue","_a","childAt","index","j","visitedNodes","removeComments","insertText","setText","setStyleAttribute","setSvgAttribute","setAttribute","isValueNully","isInput","isSelect","isTextArea","__defProp$1","__defNormalProp$1","obj","__publicField$1","AbstractBlock","renderToTemplate","vnode","edits","path","current","style","kebabKey","char","canMergeString","_b","newPath","__defProp","__defNormalProp","__publicField","mapArray","ArrayBlock","oldChildren","newChildren","oldChildrenLength","newChildrenLength","parent","arrayRemove$","arrayMount$","oldHead","newHead","oldTail","newTail","oldHeadChild","newHeadChild","oldTailChild","newTailChild","oldKeyMap","oldHeadKey","newHeadKey","patch$","oldTailKey","newTailKey","nextChild","move$","oldIndex","mount$","oldChild","remove$","refNode","block","array$","arrayPatch$","HOLE_PROXY","_","unwrap","shouldUpdate","root","shouldUpdateCurrentBlock","Block","oldBlock","newBlock","getElements","hydrateNode","elements","getCurrentElement","edit","targetEl","patch2","initsLength","shouldUpdate$","oldValue","firstEdit","newChildBlock","newTargetEl","block2","_oldProps","_newProps","cache","pathLength","isCacheAndKeyExists","siblings","block$","experimental_options","RENDER_SCOPE","SVG_RENDER_SCOPE","Effect","effect","deps","useEffect","REGISTRY","scopedContext","createContext","processProps","portals","processedProps","currentIndex","renderReactScope","wrap","createElement","unstable","isBlock","isCallable","puppetComponent","puppetBlock","reactPortal","createPortal","Fragment","millionPortal","cn","flatten","rawChildren","flattenedChildren","useLayoutEffect","useLayoutEffect$1","traverse","fiber","selector","ascending","useFiber","useRef","useState","bind","maybeFiber","useNearestParent","parentRef","useContainer","rootRef","options","noSlot","blockTarget","defaultType","block$1","MillionBlock","forwardedRef","container","hmrTimestamp","patch$1","portalRef","useCallback","currentBlock","_c","props2","marker","useMemo","childrenSize","MillionArray","each","memo2","as","rest","fragmentRef","setMountPortals","createChildren","MillionFor","typedMemo","memo","getComponent","currentCache","portals2","isEqual","shouldCompiledBlockUpdate","prev","next","compiledBlock","render","blockName","RenderBlock","portalCount","scoped","useContext","derived","scope","targets","len","EVENTS_SOCKET","USER_ID_KEY","API_URL","_assert","number","bool","isBytes","bytes","lengths","hash","exists","instance","checkFinished","output","out","min","assert","_u64","U32_MASK64","_32n","fromBig","le","split","lst","Ah","Al","toBig","shrSH","_l","shrSL","rotrSH","rotrSL","rotrBH","rotrBL","rotr32H","_h","rotr32L","rotlSH","rotlSL","rotlBH","rotlBL","add","Bh","Bl","add3L","Cl","add3H","low","Ch","add4L","Dl","add4H","Dh","add5L","El","add5H","Eh","u64","crypto","exports","crypto_1","_assert_js_1","u8","arr","u32","createView","rotr","word","shift","rotl","byteSwap","byteSwap32","hexes","bytesToHex","hex","asciis","asciiToBase16","hexToBytes","hl","al","array","ai","hi","n1","n2","nextTick","asyncLoop","iters","tick","cb","ts","diff","utf8ToBytes","str","toBytes","data","concatBytes","arrays","sum","res","pad","Hash","toStr","checkOpts","defaults","opts","wrapConstructor","hashCons","hashC","msg","tmp","wrapConstructorWithOpts","wrapXOFConstructorWithOpts","randomBytes","bytesLength","sha3","sha3$1","_u64_js_1","utils_js_1","require$$2","SHA3_PI","SHA3_ROTL","_SHA3_IOTA","_0n","_1n","_2n","_7n","_256n","_0x71n","round","R","y","t","SHA3_IOTA_H","SHA3_IOTA_L","rotlH","rotlL","keccakP","rounds","B","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","Keccak","blockLen","suffix","outputLen","enableXOF","state","pos","take","bufferOut","to","gen","genShake","defaultLength","bigLength","createEntropy","length","random","entropy","bufToBigInt","buf","bits","bi","input","alphabet","randomLetter","createFingerprint","globalObj","global","globals","sourceString","createCounter","count","initialCountMax","counter","fingerprint","firstLetter","time","salt","hashInput","createId","isCuid","id","minLength","maxLength","regex","src","getConstants","createId_1","genId","generatedId","userIdFromLocalStorage","getAddress","channelId","incomeUserId","userId","openInNewTab","url","hexToHSL","bigint","max","Subscribable","listener","isServer","noop","functionalUpdate","updater","isValidTimeout","timeUntilStale","updatedAt","staleTime","matchQuery","filters","query","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","status","mutationKey","hashKey","val","isPlainObject","result","replaceEqualDeep","isPlainArray","aItems","aSize","bItems","bSize","copy","equalItems","shallowEqualObjects","o","hasObjectPrototype","ctor","prot","sleep","ms","resolve","replaceData","prevData","addToEnd","items","newItems","addToStart","skipToken","FocusManager","__privateAdd","_focused","_cleanup","_setup","__privateSet","onFocus","__privateGet","setup","focused","isFocused","focusManager","OnlineManager","_online","onOnline","onlineListener","offlineListener","online","onlineManager","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","isRetryCancelled","isResolved","continueFn","promiseResolve","promiseReject","promise","outerResolve","outerReject","cancel","cancelOptions","reject","cancelRetry","continueRetry","shouldPause","pause","continueResolve","canContinue","run","promiseOrValue","retry","retryDelay","delay","shouldRetry","createNotifyManager","queue","transactions","notifyFn","callback","batchNotifyFn","scheduleFn","setScheduler","batch","flush","schedule","batchCalls","originalQueue","notifyManager","Removable","_gcTimeout","newGcTime","Query","_d","_dispatch","_initialState","_revertState","_cache","_retryer","_observers","_defaultOptions","_abortSignalConsumed","getDefaultState","newData","__privateMethod","dispatch_fn","setStateOptions","observer","fetchOptions","abortController","queryFnContext","addSignalProperty","fetchFn","onError","action","reducer","fetchState","hasData","initialDataUpdatedAt","QueryCache","_e","_queries","client","queryHash","queryInMap","defaultedFilters","queries","Mutation","_f","_mutationCache","variables","executeMutation","restored","_g","_j","_i","_k","_n","_m","_p","_o","_r","_q","_t","_s","MutationCache","_mutations","_mutationId","_resuming","__privateWrapper","pausedMutations","infiniteQueryBehavior","pages","direction","oldPages","oldPageParams","empty","cancelled","queryFn","fetchPage","param","previous","page","maxPages","addTo","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pageParams","lastIndex","QueryClient","_queryCache","_queryDefaults","_mutationDefaults","_mountCount","_unsubscribeFocus","_unsubscribeOnline","cachedData","defaultedOptions","queryCache","refetchFilters","defaultedCancelOptions","promises","queryDefault","QueryObserver","_executeFetch","_updateStaleTimeout","_computeRefetchInterval","_updateRefetchInterval","_updateTimers","_clearStaleTimeout","_clearRefetchInterval","_updateQuery","_notify","_client","_currentQuery","_currentQueryInitialState","_currentResult","_currentResultState","_currentResultOptions","_selectError","_selectFn","_selectResult","_lastQueryWithDefinedData","_staleTimeoutId","_refetchIntervalId","_currentRefetchInterval","_trackedProps","shouldFetchOnMount","executeFetch_fn","updateTimers_fn","shouldFetchOn","clearStaleTimeout_fn","clearRefetchInterval_fn","notifyOptions","prevOptions","prevQuery","updateQuery_fn","mounted","shouldFetchOptionally","updateStaleTimeout_fn","nextRefetchInterval","computeRefetchInterval_fn","updateRefetchInterval_fn","shouldAssignObserverCurrentProperties","onPropTracked","trackedResult","prevResult","prevResultState","prevResultOptions","queryInitialState","newState","isPlaceholderData","fetchOnMount","fetchOptionally","errorUpdatedAt","selectError","placeholderData","isFetching","isPending","isError","isLoading","isStale","nextResult","defaultNotifyOptions","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","typedKey","notify_fn","timeout","nextInterval","shouldLoadOnMount","field","optimisticResult","QueryClientContext","useQueryClient","queryClient","QueryClientProvider","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","shouldThrowError","throwError","params","ensurePreventErrorBoundaryRetry","errorResetBoundary","useClearResetErrorBoundary","getHasError","throwOnError","ensureStaleTime","shouldSuspend","fetchOptimistic","useBaseQuery","Observer","isRestoring","onStoreChange","unsubscribe","useQuery","PACKET_TYPES","PACKET_TYPES_REVERSE","ERROR_PACKET","withNativeBlob","withNativeArrayBuffer","isView","encodePacket","supportsBinary","encodeBlobAsBase64","fileReader","toArray","TEXT_ENCODER","encodePacketToBinary","packet","encoded","chars","lookup","decode","base64","bufferLength","encoded1","encoded2","encoded3","encoded4","arraybuffer","decodePacket","encodedPacket","binaryType","mapBinary","decodeBase64Packet","decoded","SEPARATOR","encodePayload","packets","encodedPackets","decodePayload","encodedPayload","decodedPacket","createPacketEncoderStream","controller","payloadLength","header","view","TEXT_DECODER","totalLength","chunks","acc","chunk","concatChunks","size","buffer","createPacketDecoderStream","maxPayload","expectedLength","isBinary","headerArray","protocol","Emitter","mixin","on","callbacks","globalThisShim","pick","attr","NATIVE_SET_TIMEOUT","globalThis","NATIVE_CLEAR_TIMEOUT","installTimerFunctions","BASE64_OVERHEAD","byteLength","utf8Length","encode","qs","qry","pairs","pair","TransportError","reason","description","Transport","details","onPause","schema","hostname","encodedQuery","map","seed","num","yeast","now","hasCORS","XHR","xdomain","createCookieJar","hasXHR2","XMLHttpRequest","Polling","isSSL","port","forceBase64","total","close","Request","req","xhrStatus","uri","xhr","fromError","unloadHandler","terminationEvent","setTimeoutFn","WebSocket","usingBrowserWebSocket","defaultBinaryType","isReactNative","WS","protocols","closeEvent","ev","lastPacket","WT","stream","decoderStream","reader","encoderStream","read","done","transports","re","parts","parse","pathNames","regx","names","$0","$1","$2","Socket","transport","failed","onTransportOpen","cleanup","freezeTransport","onerror","onTransportClose","onclose","onupgrade","payloadSize","cleanupAndClose","waitForUpgrade","upgrades","filteredUpgrades","Socket$1","loc","host","toString","withNativeFile","hasBinary","toJSON","deconstructPacket","buffers","packetData","pack","_deconstructPacket","placeholder","reconstructPacket","_reconstructPacket","RESERVED_EVENTS","PacketType","Encoder","replacer","deconstruction","isObject","Decoder","reviver","isBinaryEvent","BinaryReconstructor","start","binData","io","nsp","ack","isTransportWritable","timer","arg1","arg2","responseArgs","force","listeners","sent","pid","subDestroy","compress","Backoff","rand","deviation","jitter","Manager","_parser","parser","v","Engine","socket","openSubDestroy","errorSub","nsps","attempt","parsed","sameNamespace","newConnection","freeGlobal","freeSelf","useUnmount","func","funcRef","SocketCtx","SocketProvider","onEndBot","isTest","onClose","isShowClose","isForLiveChat","customStyles","_customStyles","isForPreview","isForManager","adminId","disableInput","setDisableInput","setCustomStyles","undefined","urlParams","URLSearchParams","window","search","_userId","_channelId","get","socketRef","autoConnect","messages","isBot","message","createdAt","Date","toISOString","fetch","URL","json","initialData","custom","enabled","handleSendMessage","extraData","trimmedMessage","trim","address","newMessage","emit","MESSAGE","setQueryData","handleClose","postMessage","handleReload","disconnect","connect","filter","TYPING","STOP_TYPING","isLoadingMessages","useSocket","socketCtx","r","clsx","CLASS_PART_SEPARATOR","createClassUtils","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","getClassGroupId","className","classParts","getGroupRecursive","getGroupIdForArbitraryProperty","getConflictingClassGroupIds","classGroupId","hasPostfixModifier","conflicts","classPartObject","currentClassPart","nextClassPartObject","classGroupFromNextClassPart","classRest","validator","arbitraryPropertyRegex","arbitraryPropertyClassName","property","theme","getPrefixedClassGroupEntries","classGroup","processClassesRecursively","classDefinition","classPartObjectToEdit","getPart","isThemeGetter","currentClassPartObject","pathPart","classGroupEntries","prefixedClassGroup","createLruCache","maxCacheSize","cacheSize","previousCache","update","IMPORTANT_MODIFIER","createSplitModifiers","separator","isSeparatorSingleCharacter","firstSeparatorCharacter","separatorLength","modifiers","bracketDepth","modifierStart","postfixModifierPosition","currentCharacter","baseClassNameWithImportantModifier","hasImportantModifier","baseClassName","maybePostfixModifierPosition","sortModifiers","sortedModifiers","unsortedModifiers","modifier","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","splitModifiers","classGroupsInConflict","originalClassName","variantModifier","modifierId","classId","group","twJoin","argument","resolvedValue","string","toValue","mix","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","fromTheme","themeGetter","arbitraryValueRegex","fractionRegex","stringLengths","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isLength","isNumber","isArbitraryLength","getIsArbitraryValue","isLengthOnly","isArbitraryNumber","isInteger","isPercent","isArbitraryValue","isTshirtSize","sizeLabels","isArbitrarySize","isNever","isArbitraryPosition","imageLabels","isArbitraryImage","isImage","isArbitraryShadow","isShadow","isAny","label","testValue","getDefaultConfig","colors","spacing","blur","brightness","borderColor","borderRadius","borderSpacing","borderWidth","contrast","grayscale","hueRotate","invert","gap","gradientColorStops","gradientColorStopPositions","inset","margin","opacity","padding","saturate","scale","sepia","skew","space","translate","getOverscroll","getOverflow","getSpacingWithAutoAndArbitrary","getSpacingWithArbitrary","getLengthWithEmptyAndArbitrary","getNumberWithAutoAndArbitrary","getPositions","getLineStyles","getBlendModes","getAlign","getZeroAndEmpty","getBreaks","getNumber","getNumberAndArbitrary","twMerge","inputs","module","this","u","$","M","D","S","w","O","defaultAttributes","toKebabCase","createLucideIcon","iconName","iconNode","forwardRef","color","strokeWidth","absoluteStrokeWidth","tag","attrs","LoaderCircle","RefreshCcw","Send","X","Message_1","_compiledBlock","_props","v0","v1","v2","v3","v4","v5","v6","v7","Message","_adminId","isLeft","wordBreak","backgroundColor","_extends","target","$6ed0406888f73fc4$var$setRef","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","slotPropValue","childPropValue","falsyToString","cx","buttonVariants","base","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","getCompoundVariantClassNames","param1","cvClass","cvClassName","compoundVariantOptions","default","destructive","outline","secondary","ghost","link","sm","lg","icon","Button","asChild","Comp","Slot","ButtonsMessage","hsl","button","title","Card_1","Card","card","image_url","subtitle","buttons","CardsMessage","TypingMessage","Body","endMessageRef","scrollIntoView","behavior","renderMessage","Loader2","dayjs","Header_1","Header","logoUrl","Input","SendArea","setMessage","handleEnter","preventDefault","ChatBox_1","ChatBox","width","windowSize","height","ChatBoxWrapper"],"mappings":";;;;;;;;6CASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAKC,EAAE,KAAcJ,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiBK,EAAEL,EAAE,KAAK,IAAIE,KAAKF,EAAEL,EAAE,KAAKK,EAAEE,CAAC,GAAG,CAACL,EAAE,eAAeK,CAAC,IAAIC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,GAAGH,GAAGA,EAAE,aAAa,IAAIG,KAAKF,EAAED,EAAE,aAAaC,EAAWG,EAAED,CAAC,IAAZ,SAAgBC,EAAED,CAAC,EAAEF,EAAEE,CAAC,GAAG,MAAM,CAAC,SAAST,EAAE,KAAKM,EAAE,IAAIK,EAAE,IAAIC,EAAE,MAAMF,EAAE,OAAOP,EAAE,OAAO,CAAC,CAAC,OAAAU,YAAiBZ,EAAEY,GAAW,IAACR,EAAEQ,GAAA,KAAaR;;;;;;;;yCCEtW,QAAQ,IAAI,WAAa,cAC1B,UAAW,CAGd,IAAIS,EAAQf,EAMRgB,EAAq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AAO,CAAA,CAAA,EAAA,GACP,CAAChU,GAAgBn+B,EAAA,IAAC8yC,IAAW,CAAA,EAAA,CAKxC,EAOMS,GAAkB36C,GAEnBoH,EAAA,IAAA0uB,GAAA,CAAoB,OAAQD,GAC3B,eAACiP,GAAmB9kC,CAAAA,GAAAA,EAClB,SAAAoH,EAAA,IAACmzC,GAAQ,CAAA,UAAWv6C,EAAM+oC,SAAa,CAAA,EACzC,CACF,CAAA","x_google_ignoreList":[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,74,75,76,77,78,79,80,81,83,84,85,86,87]} \ No newline at end of file +{"version":3,"file":"index.umd.js","sources":["../node_modules/react/cjs/react-jsx-runtime.production.min.js","../node_modules/react/cjs/react-jsx-runtime.development.js","../node_modules/react/jsx-runtime.js","../node_modules/million/dist/shared/million.fb41761f.mjs","../node_modules/million/dist/packages/experimental.mjs","../node_modules/million/dist/shared/million.9efd57f2.mjs","../node_modules/million/dist/packages/react.mjs","../src/constants/index.ts","../node_modules/@noble/hashes/_assert.js","../node_modules/@noble/hashes/_u64.js","../node_modules/@noble/hashes/crypto.js","../node_modules/@noble/hashes/utils.js","../node_modules/@noble/hashes/sha3.js","../node_modules/@paralleldrive/cuid2/src/index.js","../node_modules/@paralleldrive/cuid2/index.js","../src/utils/index.ts","../node_modules/@tanstack/query-core/build/modern/subscribable.js","../node_modules/@tanstack/query-core/build/modern/utils.js","../node_modules/@tanstack/query-core/build/modern/focusManager.js","../node_modules/@tanstack/query-core/build/modern/onlineManager.js","../node_modules/@tanstack/query-core/build/modern/retryer.js","../node_modules/@tanstack/query-core/build/modern/notifyManager.js","../node_modules/@tanstack/query-core/build/modern/removable.js","../node_modules/@tanstack/query-core/build/modern/query.js","../node_modules/@tanstack/query-core/build/modern/queryCache.js","../node_modules/@tanstack/query-core/build/modern/mutation.js","../node_modules/@tanstack/query-core/build/modern/mutationCache.js","../node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js","../node_modules/@tanstack/query-core/build/modern/queryClient.js","../node_modules/@tanstack/query-core/build/modern/queryObserver.js","../node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js","../node_modules/@tanstack/react-query/build/modern/isRestoring.js","../node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js","../node_modules/@tanstack/react-query/build/modern/utils.js","../node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js","../node_modules/@tanstack/react-query/build/modern/suspense.js","../node_modules/@tanstack/react-query/build/modern/useBaseQuery.js","../node_modules/@tanstack/react-query/build/modern/useQuery.js","../node_modules/engine.io-parser/build/esm/commons.js","../node_modules/engine.io-parser/build/esm/encodePacket.browser.js","../node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js","../node_modules/engine.io-parser/build/esm/decodePacket.browser.js","../node_modules/engine.io-parser/build/esm/index.js","../node_modules/@socket.io/component-emitter/index.mjs","../node_modules/engine.io-client/build/esm/globalThis.browser.js","../node_modules/engine.io-client/build/esm/util.js","../node_modules/engine.io-client/build/esm/contrib/parseqs.js","../node_modules/engine.io-client/build/esm/transport.js","../node_modules/engine.io-client/build/esm/contrib/yeast.js","../node_modules/engine.io-client/build/esm/contrib/has-cors.js","../node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js","../node_modules/engine.io-client/build/esm/transports/polling.js","../node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js","../node_modules/engine.io-client/build/esm/transports/websocket.js","../node_modules/engine.io-client/build/esm/transports/webtransport.js","../node_modules/engine.io-client/build/esm/transports/index.js","../node_modules/engine.io-client/build/esm/contrib/parseuri.js","../node_modules/engine.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/url.js","../node_modules/socket.io-parser/build/esm/is-binary.js","../node_modules/socket.io-parser/build/esm/binary.js","../node_modules/socket.io-parser/build/esm/index.js","../node_modules/socket.io-client/build/esm/on.js","../node_modules/socket.io-client/build/esm/socket.js","../node_modules/socket.io-client/build/esm/contrib/backo2.js","../node_modules/socket.io-client/build/esm/manager.js","../node_modules/socket.io-client/build/esm/index.js","../node_modules/lodash.debounce/index.js","../node_modules/usehooks-ts/dist/index.js","../src/context/socket.ctx.tsx","../src/hooks/useSocket.ts","../node_modules/clsx/dist/clsx.mjs","../node_modules/tailwind-merge/dist/bundle-mjs.mjs","../src/lib/utils.ts","../node_modules/dayjs/dayjs.min.js","../node_modules/lucide-react/dist/esm/defaultAttributes.js","../node_modules/lucide-react/dist/esm/shared/src/utils.js","../node_modules/lucide-react/dist/esm/createLucideIcon.js","../node_modules/lucide-react/dist/esm/icons/loader-circle.js","../node_modules/lucide-react/dist/esm/icons/refresh-ccw.js","../node_modules/lucide-react/dist/esm/icons/send.js","../node_modules/lucide-react/dist/esm/icons/x.js","../src/components/message.tsx","../node_modules/@babel/runtime/helpers/esm/extends.js","../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/class-variance-authority/node_modules/clsx/dist/clsx.mjs","../node_modules/class-variance-authority/dist/index.mjs","../src/components/ui/button.tsx","../src/components/buttons-message.tsx","../src/components/cards-message.tsx","../src/components/typing-message.tsx","../src/components/body.tsx","../src/components/header.tsx","../src/components/ui/input.tsx","../src/components/send-area.tsx","../src/chatbox/index.tsx"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('')) {\n _frame = _frame.replace('', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie.
\n // or
). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n //
, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","'use client';\nconst Object$ = Object;\nconst Map$ = Map;\nconst Set$ = Set;\nconst SetHas$ = Set$.prototype.has;\nconst SetAdd$ = Set$.prototype.add;\nconst MapHas$ = Map$.prototype.has;\nconst MapGet$ = Map$.prototype.get;\nconst MapSet$ = Map$.prototype.set;\nconst ChildFlag = 1;\nconst AttributeFlag = 2;\nconst EventFlag = 4;\nconst StyleAttributeFlag = 8;\nconst SvgAttributeFlag = 16;\nconst BlockFlag = 32;\nconst TEXT_NODE_CACHE = \"__t\";\nconst EVENT_PATCH = \"__p\";\nconst EVENTS_REGISTRY = \"__e\";\nconst IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;\nconst XLINK_NS = \"http://www.w3.org/1999/xlink\";\nconst XML_NS = \"http://www.w3.org/2000/xmlns/\";\nconst X_CHAR = 120;\nconst NON_PROPS = new Set$([\"href\", \"list\", \"form\", \"tabIndex\", \"download\"]);\nconst VOID_ELEMENTS = new Set$([\"area\", \"base\", \"basefont\", \"bgsound\", \"br\", \"col\", \"command\", \"embed\", \"frame\", \"hr\", \"image\", \"img\", \"input\", \"isindex\", \"keygen\", \"link\", \"menuitem\", \"meta\", \"nextid\", \"param\", \"source\", \"track\", \"wbr\"]);\n\nif (typeof window === \"undefined\") {\n throw new Error(\n \"See http://million.dev/docs/install to install the compiler.\"\n );\n}\nconst document$ = document;\ndocument$.createElement(\"template\");\nconst HTM_TEMPLATE = /* @__PURE__ */ document$.createElement(\"template\");\nconst HTM_TEMPLATE_CONTENT = HTM_TEMPLATE.content;\nconst SVG_TEMPLATE = /* @__PURE__ */ document$.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"svg\"\n);\nconst node$ = Node.prototype;\nconst element$ = Element.prototype;\nconst characterData$ = CharacterData.prototype;\nconst getOwnPropertyDescriptor$ = Object$.getOwnPropertyDescriptor;\nconst insertBefore$ = node$.insertBefore;\nconst cloneNode$ = node$.cloneNode;\nconst replaceChild$ = node$.replaceChild;\nconst remove$$1 = element$.remove;\nconst addEventListener$ = node$.addEventListener;\nconst removeAttribute$ = element$.removeAttribute;\nconst setAttribute$ = element$.setAttribute;\nconst setAttributeNS$ = element$.setAttributeNS;\nconst setTextContent$ = getOwnPropertyDescriptor$(node$, \"textContent\").set;\nconst firstChild$ = getOwnPropertyDescriptor$(node$, \"firstChild\").get;\nconst nextSibling$ = getOwnPropertyDescriptor$(node$, \"nextSibling\").get;\nconst characterDataSet$ = getOwnPropertyDescriptor$(\n characterData$,\n \"data\"\n).set;\nconst stringToDOM = (content, svg) => {\n const template = svg ? SVG_TEMPLATE : HTM_TEMPLATE;\n template.innerHTML = content;\n const dom = svg ? SVG_TEMPLATE : HTM_TEMPLATE_CONTENT;\n return dom.firstChild;\n};\ndocument$[EVENTS_REGISTRY] = new Set$();\nconst createEventListener = (el, name, value) => {\n let event = name.toLowerCase();\n let capture = false;\n if (event.endsWith(\"capture\")) {\n event = event.slice(0, -7);\n capture = true;\n }\n const key = `$$${event}`;\n if (!SetHas$.call(document$[EVENTS_REGISTRY], event)) {\n addEventListener$.call(\n document$,\n event,\n (nativeEvent) => {\n let el2 = nativeEvent.target;\n while (el2) {\n const handler = el2[key];\n if (handler) {\n Object$.defineProperty(nativeEvent, \"currentTarget\", {\n configurable: true,\n get() {\n return el2;\n }\n });\n handler(nativeEvent);\n }\n el2 = el2.parentNode;\n }\n },\n { capture }\n );\n SetAdd$.call(document$[EVENTS_REGISTRY], event);\n }\n const patch = (newValue) => {\n if (!newValue) {\n el[key] = null;\n } else if (!(\"key\" in newValue && newValue.key === el[key]?.key)) {\n el[key] = newValue;\n }\n };\n patch(value);\n return patch;\n};\nconst childAt = (el, index) => {\n let child = firstChild$.call(el);\n if (index) {\n for (let j = 0; j < index; ++j) {\n if (!child)\n break;\n child = nextSibling$.call(child);\n }\n }\n return child;\n};\nconst visitedNodes = /* @__PURE__ */ new WeakSet();\nconst removeComments = (el) => {\n if (visitedNodes.has(el)) {\n return;\n }\n if (el.nodeType === 8) {\n el.parentNode?.removeChild(el);\n }\n let child = firstChild$.call(el);\n while (child) {\n removeComments(child);\n child = child.nextSibling;\n }\n visitedNodes.add(el);\n};\nconst insertText = (el, value, index) => {\n const node = document$.createTextNode(value);\n const child = childAt(el, index);\n insertBefore$.call(el, node, child);\n return node;\n};\nconst setText = (el, value) => {\n characterDataSet$.call(el, value);\n};\nconst setStyleAttribute = (el, name, value) => {\n if (typeof value !== \"number\" || IS_NON_DIMENSIONAL.test(name)) {\n el.style[name] = value;\n } else if (typeof value === \"string\") {\n el.style.cssText = value;\n } else if (name.startsWith(\"-\")) {\n el.style.setProperty(name, String(value));\n } else if (value === void 0 || value === null) {\n el.style[name] = \"\";\n } else {\n el.style[name] = `${String(value)}px`;\n }\n};\nconst setSvgAttribute = (el, name, value) => {\n name = name.replace(/xlink(?:H|:h)/, \"h\").replace(/sName$/, \"s\");\n if (name.startsWith(\"xmlns\")) {\n setAttributeNS$.call(el, XML_NS, name, String(value));\n } else if (name.startsWith(\"xlink\")) {\n setAttributeNS$.call(el, XLINK_NS, \"href\", String(value));\n }\n};\nconst setAttribute = (el, name, value) => {\n const isValueNully = value === void 0 || value === null;\n value = isValueNully ? \"\" : value;\n if (name in el && el[name] !== void 0 && el[name] !== null && !(el instanceof SVGElement) && SetHas$.call(NON_PROPS, name)) {\n try {\n el[name] = value;\n } catch (_err) {\n }\n } else if (!isValueNully && value !== \"\" && (value !== false || name.includes(\"-\"))) {\n setAttribute$.call(el, name, String(value));\n } else {\n removeAttribute$.call(el, name);\n }\n const isInput = el instanceof HTMLInputElement;\n const isSelect = el instanceof HTMLSelectElement;\n const isTextArea = el instanceof HTMLTextAreaElement;\n if (name === \"value\" && (isInput || isSelect || isTextArea)) {\n setAttribute$.call(el, name, String(value));\n el.value = value;\n }\n};\n\nvar __defProp$1 = Object.defineProperty;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField$1 = (obj, key, value) => {\n __defNormalProp$1(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nclass AbstractBlock {\n constructor() {\n /* root */\n __publicField$1(this, \"r\");\n /* edits */\n __publicField$1(this, \"e\");\n /* el */\n __publicField$1(this, \"l\");\n /* getElements */\n __publicField$1(this, \"g\");\n /* _shouldUpdate */\n __publicField$1(this, \"_u\");\n /* _parent */\n __publicField$1(this, \"_t\");\n /* props */\n __publicField$1(this, \"d\");\n /* key */\n __publicField$1(this, \"k\");\n /* cache */\n __publicField$1(this, \"c\");\n }\n}\n\nconst renderToTemplate = (vnode, edits = [], path = []) => {\n if (typeof vnode === \"string\")\n return vnode;\n if (typeof vnode === \"number\" || typeof vnode === \"bigint\" || vnode === true) {\n return String(vnode);\n }\n if (vnode === null || vnode === void 0 || vnode === false)\n return \"\";\n if (typeof vnode === \"object\" && \"$\" in vnode) {\n edits.push({\n p: path,\n e: [\n {\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: vnode.$,\n /* index */\n i: 0,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n }\n ],\n i: []\n });\n return \"\";\n }\n let props = \"\";\n let children = \"\";\n const current = {\n p: path,\n // The location of the edit in in the virtual node tree\n e: [],\n // Occur on mount + patch\n i: []\n // Occur before mount\n };\n for (let name in vnode.props) {\n const value = vnode.props[name];\n if (name === \"key\" || name === \"ref\" || name === \"children\") {\n continue;\n }\n if (name === \"className\")\n name = \"class\";\n if (name === \"htmlFor\")\n name = \"for\";\n if (name.startsWith(\"on\")) {\n const isValueHole = \"$\" in value;\n if (isValueHole) {\n current.e.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.i.push({\n /* type */\n t: EventFlag,\n /* name */\n n: name.slice(2),\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i: null,\n /* listener */\n l: value,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (value) {\n if (typeof value === \"object\" && \"$\" in value) {\n if (name === \"style\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else if (name.charCodeAt(0) === X_CHAR) {\n current.e.push({\n /* type */\n t: SvgAttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n } else {\n current.e.push({\n /* type */\n t: AttributeFlag,\n /* name */\n n: name,\n /* value */\n v: null,\n /* hole */\n h: value.$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n }\n continue;\n }\n if (name === \"style\" && typeof value === \"object\") {\n let style = \"\";\n for (const key in value) {\n if (typeof value[key] === \"object\") {\n current.e.push({\n /* type */\n t: StyleAttributeFlag,\n /* name */\n n: key,\n /* value */\n v: null,\n /* hole */\n h: value[key].$,\n /* index */\n i: null,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n let kebabKey = \"\";\n for (let i = 0, j = key.length; i < j; ++i) {\n const char = key.charCodeAt(i);\n if (char < 97) {\n kebabKey += `-${String.fromCharCode(char + 32)}`;\n } else {\n kebabKey += key[i];\n }\n }\n style += `${kebabKey}:${String(value[key])};`;\n }\n props += ` style=\"${style}\"`;\n continue;\n }\n props += ` ${name}=\"${String(value)}\"`;\n }\n }\n if (SetHas$.call(VOID_ELEMENTS, vnode.type)) {\n if (current.e.length)\n edits.push(current);\n return `<${vnode.type}${props} />`;\n }\n let canMergeString = false;\n for (let i = 0, j = vnode.props.children?.length || 0, k = 0; i < j; ++i) {\n const child = vnode.props.children?.[i];\n if (child === null || child === void 0 || child === false)\n continue;\n if (typeof child === \"object\" && \"$\" in child) {\n current.e.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: child.$,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n if (child instanceof AbstractBlock) {\n current.i.push({\n /* type */\n t: BlockFlag,\n /* name */\n n: null,\n /* value */\n v: null,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: child\n });\n continue;\n }\n if (typeof child === \"string\" || typeof child === \"number\" || typeof child === \"bigint\") {\n const value = typeof child === \"number\" || typeof child === \"bigint\" ? String(child) : child;\n if (canMergeString) {\n current.i.push({\n /* type */\n t: ChildFlag,\n /* name */\n n: null,\n /* value */\n v: value,\n /* hole */\n h: null,\n /* index */\n i,\n /* listener */\n l: null,\n /* patch */\n p: null,\n /* block */\n b: null\n });\n continue;\n }\n canMergeString = true;\n children += value;\n k++;\n continue;\n }\n canMergeString = false;\n const newPath = path.slice();\n newPath.push(k++);\n children += renderToTemplate(child, edits, newPath);\n }\n if (current.i.length || current.e.length)\n edits.push(current);\n return `<${vnode.type}${props}>${children}`;\n};\n\nvar __defProp = Object.defineProperty;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\nconst mapArray = (children) => {\n return new ArrayBlock(children);\n};\nclass ArrayBlock extends AbstractBlock {\n constructor(children) {\n super();\n __publicField(this, \"b\");\n this.b = children;\n }\n v() {\n }\n p(fragment) {\n const oldChildren = this.b;\n const newChildren = fragment.b;\n const oldChildrenLength = oldChildren.length;\n const newChildrenLength = newChildren.length;\n const parent = this.t();\n if (this === fragment)\n return parent;\n if (newChildrenLength === 0 && oldChildrenLength === 0)\n return parent;\n this.b = newChildren;\n if (newChildrenLength === 0) {\n arrayRemove$.call(this);\n return parent;\n }\n if (oldChildrenLength === 0) {\n arrayMount$.call(fragment, parent);\n return parent;\n }\n let oldHead = 0;\n let newHead = 0;\n let oldTail = oldChildrenLength - 1;\n let newTail = newChildrenLength - 1;\n let oldHeadChild = oldChildren[0];\n let newHeadChild = newChildren[0];\n let oldTailChild = oldChildren[oldTail];\n let newTailChild = newChildren[newTail];\n let oldKeyMap;\n while (oldHead <= oldTail && newHead <= newTail) {\n if (!oldHeadChild) {\n oldHeadChild = oldChildren[++oldHead];\n continue;\n }\n if (!oldTailChild) {\n oldTailChild = oldChildren[--oldTail];\n continue;\n }\n const oldHeadKey = oldHeadChild.k;\n const newHeadKey = newHeadChild.k;\n if (oldHeadKey === newHeadKey) {\n patch$.call(oldHeadChild, newHeadChild);\n newChildren[newHead] = oldHeadChild;\n oldHeadChild = oldChildren[++oldHead];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n const oldTailKey = oldTailChild.k;\n const newTailKey = newTailChild.k;\n if (oldTailKey === newTailKey) {\n patch$.call(oldTailChild, newTailChild);\n newChildren[newTail] = oldTailChild;\n oldTailChild = oldChildren[--oldTail];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldHeadKey === newTailKey) {\n patch$.call(oldHeadChild, newTailChild);\n newChildren[newTail] = oldHeadChild;\n const nextChild = newChildren[newTail + 1];\n move$.call(oldHeadChild, nextChild, nextChild?.l || null);\n oldHeadChild = oldChildren[++oldHead];\n newTailChild = newChildren[--newTail];\n continue;\n }\n if (oldTailKey === newHeadKey) {\n patch$.call(oldTailChild, newHeadChild);\n newChildren[newHead] = oldTailChild;\n const nextChild = oldChildren[oldHead];\n move$.call(oldTailChild, nextChild, nextChild?.l || null);\n oldTailChild = oldChildren[--oldTail];\n newHeadChild = newChildren[++newHead];\n continue;\n }\n if (!oldKeyMap) {\n oldKeyMap = new Map$();\n for (let i = oldHead; i <= oldTail; i++) {\n MapSet$.call(oldKeyMap, oldChildren[i].k, i);\n }\n }\n const oldIndex = oldKeyMap.get(newHeadKey);\n if (oldIndex === void 0) {\n mount$.call(newHeadChild, parent, oldHeadChild.l || null);\n } else {\n const oldChild = oldChildren[oldIndex];\n move$.call(oldChild, oldHeadChild, null);\n patch$.call(oldChild, newHeadChild);\n newChildren[newHead] = oldChild;\n oldChildren[oldIndex] = null;\n }\n newHeadChild = newChildren[++newHead];\n }\n if (oldHead <= oldTail || newHead <= newTail) {\n if (oldHead > oldTail) {\n const nextChild = newChildren[newTail + 1];\n for (let i = newHead; i <= newTail; ++i) {\n mount$.call(newChildren[i], parent, nextChild ? nextChild.l : null);\n }\n } else {\n for (let i = oldHead; i <= oldTail; ++i) {\n remove$.call(oldChildren[i]);\n }\n }\n }\n return parent;\n }\n m(parent, refNode = null) {\n if (this._t)\n return this._t;\n for (let i = 0, j = this.b.length; i < j; ++i) {\n const block = this.b[i];\n mount$.call(block, parent, refNode);\n }\n this._t = parent;\n return parent;\n }\n x() {\n const parent = this.t();\n if (parent) {\n setTextContent$.call(parent, \"\");\n } else {\n for (let i = 0, j = this.b.length; i < j; ++i) {\n remove$.call(this.b[i]);\n }\n }\n this.b = [];\n }\n u() {\n return true;\n }\n s() {\n return this.b.map((block) => block.s()).join(\"\");\n }\n t() {\n if (!this._t)\n this._t = this.b[0].t();\n return this._t;\n }\n}\nconst array$ = ArrayBlock.prototype;\nconst arrayMount$ = array$.m;\nconst arrayPatch$ = array$.p;\nconst arrayRemove$ = array$.x;\n\nconst HOLE_PROXY = new Proxy(\n {},\n {\n // A universal getter will return a Hole instance if props[any] is accessed\n // Allows code to identify holes in virtual nodes (\"digs\" them out)\n get(_, key) {\n return { $: key };\n }\n }\n);\nconst block = (fn, unwrap, shouldUpdate, svg) => {\n const vnode = fn(HOLE_PROXY);\n const edits = [];\n const root = stringToDOM(\n renderToTemplate(unwrap ? unwrap(vnode) : vnode, edits),\n svg\n );\n removeComments(root);\n return (props, key, shouldUpdateCurrentBlock) => {\n return new Block(\n root,\n edits,\n props,\n key ?? props?.key ?? null,\n shouldUpdateCurrentBlock ?? shouldUpdate ?? null,\n null\n );\n };\n};\nconst mount = (block2, parent, hydrateNode) => {\n if (\"b\" in block2 && parent) {\n return arrayMount$.call(block2, parent, null);\n }\n return mount$.call(block2, parent, null, hydrateNode);\n};\nconst patch = (oldBlock, newBlock) => {\n if (\"b\" in oldBlock || \"b\" in newBlock) {\n arrayPatch$.call(oldBlock, newBlock);\n }\n if (!oldBlock.l)\n mount$.call(oldBlock, void 0, null, null);\n if (oldBlock.k && oldBlock.k === newBlock.k || oldBlock.r === newBlock.r) {\n return patch$.call(oldBlock, newBlock);\n }\n const el = mount$.call(newBlock, oldBlock.t(), oldBlock.l, null);\n remove$.call(oldBlock);\n oldBlock.k = newBlock.k;\n return el;\n};\nclass Block extends AbstractBlock {\n constructor(root, edits, props, key, shouldUpdate, getElements) {\n super();\n this.r = root;\n this.d = props;\n this.e = edits;\n this.k = key;\n this.c = Array(edits.length);\n if (shouldUpdate) {\n this._u = shouldUpdate;\n } else {\n this._u = null;\n }\n if (getElements) {\n this.g = getElements;\n } else {\n this.g = null;\n }\n }\n m(parent, refNode = null, hydrateNode) {\n if (this.l)\n return this.l;\n const root = hydrateNode ?? cloneNode$.call(this.r, true);\n const elements = this.g?.(root);\n if (elements)\n this.c = elements;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = elements?.[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const value = this.d[edit.h];\n if (edit.t & ChildFlag) {\n if (value instanceof AbstractBlock) {\n const child = childAt(el, edit.i);\n if (hydrateNode) {\n value.m(el, child, child);\n } else {\n value.m(el, child);\n }\n continue;\n }\n if (!el[TEXT_NODE_CACHE])\n el[TEXT_NODE_CACHE] = new Array(l);\n if (value && typeof value === \"object\" && \"foreign\" in value) {\n if (hydrateNode) {\n const child = childAt(el, edit.i);\n value.reset(child);\n }\n const targetEl = value.current;\n el[TEXT_NODE_CACHE][k] = targetEl;\n if (!hydrateNode) {\n insertBefore$.call(el, targetEl, childAt(el, edit.i));\n }\n continue;\n }\n if (hydrateNode) {\n el[TEXT_NODE_CACHE][k] = childAt(el, edit.i);\n continue;\n }\n el[TEXT_NODE_CACHE][k] = insertText(\n el,\n // eslint-disable-next-line eqeqeq\n value == null || value === false ? \"\" : String(value),\n edit.i\n );\n } else if (edit.t & EventFlag) {\n const patch2 = createEventListener(el, edit.n, value);\n el[EVENT_PATCH + edit.n] = patch2;\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, value);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof value === \"string\" || typeof value === \"number\") {\n setStyleAttribute(el, edit.n, value);\n } else {\n for (const style in value) {\n setStyleAttribute(el, style, value[style]);\n }\n }\n } else {\n setSvgAttribute(el, edit.n, value);\n }\n }\n const initsLength = current.i?.length;\n if (!initsLength)\n continue;\n for (let k = 0; k < initsLength; ++k) {\n const init = current.i[k];\n if (init.t & ChildFlag) {\n if (init.v && !hydrateNode)\n insertText(el, init.v, init.i);\n } else if (init.t & EventFlag) {\n createEventListener(el, init.n, init.l);\n } else {\n const child = childAt(el, init.i);\n if (hydrateNode) {\n init.b.m(el, child, child);\n } else {\n init.b.m(el, child);\n }\n }\n }\n }\n if (parent && !hydrateNode) {\n insertBefore$.call(parent, root, refNode);\n }\n this.l = root;\n return root;\n }\n p(newBlock) {\n const root = this.l;\n if (!newBlock.d)\n return root;\n const props = this.d;\n if (!shouldUpdate$.call(this, props, newBlock.d))\n return root;\n this.d = newBlock.d;\n for (let i = 0, j = this.e.length; i < j; ++i) {\n const current = this.e[i];\n const el = this.c[i] ?? getCurrentElement(current.p, root, this.c, i);\n for (let k = 0, l = current.e.length; k < l; ++k) {\n const edit = current.e[k];\n const oldValue = props[edit.h];\n const newValue = newBlock.d[edit.h];\n if (newValue === oldValue)\n continue;\n if (edit.t & EventFlag) {\n el[EVENT_PATCH + edit.n](newValue);\n continue;\n }\n if (edit.t & ChildFlag) {\n if (oldValue instanceof AbstractBlock) {\n const firstEdit = newBlock.e?.[i]?.e[k];\n const newChildBlock = newBlock.d[firstEdit.h];\n oldValue.p(newChildBlock);\n continue;\n }\n if (newValue && typeof newValue === \"object\" && \"foreign\" in newValue) {\n const targetEl = el[TEXT_NODE_CACHE][k];\n if (newValue.unstable && oldValue !== newValue) {\n const newTargetEl = newValue.current;\n el[TEXT_NODE_CACHE][k] = newTargetEl;\n replaceChild$.call(el, newTargetEl, targetEl);\n } else {\n newValue.current = targetEl;\n }\n continue;\n }\n setText(\n el[TEXT_NODE_CACHE][k],\n // eslint-disable-next-line eqeqeq\n newValue == null || newValue === false ? \"\" : String(newValue)\n );\n } else if (edit.t & AttributeFlag) {\n setAttribute(el, edit.n, newValue);\n } else if (edit.t & StyleAttributeFlag) {\n if (typeof newValue === \"string\" || typeof newValue === \"number\") {\n setStyleAttribute(el, edit.n, newValue);\n } else {\n for (const style in newValue) {\n if (newValue[style] !== oldValue[style]) {\n setStyleAttribute(el, style, newValue[style]);\n }\n }\n }\n } else {\n setSvgAttribute(el, edit.n, newValue);\n }\n }\n }\n return root;\n }\n v(block2 = null, refNode = null) {\n insertBefore$.call(this.t(), this.l, block2 ? block2.l : refNode);\n }\n x() {\n remove$$1.call(this.l);\n this.l = null;\n }\n u(_oldProps, _newProps) {\n if (!this._u)\n return true;\n return this._u(_oldProps, _newProps);\n }\n s() {\n return String(this.l?.outerHTML);\n }\n t() {\n if (!this._t)\n this._t = this.l?.parentElement;\n return this._t;\n }\n}\nconst getCurrentElement = (path, root, cache, key) => {\n const pathLength = path.length;\n if (!pathLength)\n return root;\n const isCacheAndKeyExists = cache && key !== void 0;\n if (isCacheAndKeyExists && cache[key]) {\n return cache[key];\n }\n for (let i = 0; i < pathLength; ++i) {\n const siblings = path[i];\n root = childAt(root, siblings);\n }\n if (isCacheAndKeyExists)\n cache[key] = root;\n return root;\n};\nconst withKey = (value, key) => {\n value.key = key;\n return value;\n};\nconst block$ = Block.prototype;\nconst mount$ = block$.m;\nconst patch$ = block$.p;\nconst move$ = block$.v;\nconst remove$ = block$.x;\nconst shouldUpdate$ = block$.u;\n\nexport { ArrayBlock as A, Block as B, MapHas$ as M, MapSet$ as a, block as b, cloneNode$ as c, arrayPatch$ as d, mapArray as e, arrayMount$ as f, MapGet$ as g, mount as h, removeComments as i, renderToTemplate as j, AbstractBlock as k, firstChild$ as l, mount$ as m, nextSibling$ as n, patch as p, remove$ as r, stringToDOM as s, withKey as w };\n","'use client';\nconst experimental_options = {\n noSlot: false\n};\n\nexport { experimental_options };\n","'use client';\nimport { useEffect, createContext, isValidElement, createElement, Fragment, useRef, useLayoutEffect as useLayoutEffect$1, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nconst RENDER_SCOPE = \"slot\";\nconst SVG_RENDER_SCOPE = \"g\";\nconst Effect = ({\n effect,\n deps\n}) => {\n useEffect(effect, deps || []);\n return null;\n};\nconst REGISTRY = /* @__PURE__ */ new Map();\n\nconst scopedContext = createContext(false);\nconst processProps = (props, ref, portals) => {\n const processedProps = { ref };\n let currentIndex = 0;\n for (const key in props) {\n const value = props[key];\n if (isValidElement(value) || Array.isArray(value) && value.length && isValidElement(value[0])) {\n processedProps[key] = renderReactScope(\n value,\n false,\n portals,\n currentIndex++\n );\n continue;\n }\n processedProps[key] = props[key];\n }\n return processedProps;\n};\nconst wrap = (vnode, key) => {\n return createElement(\n RENDER_SCOPE,\n { suppressHydrationWarning: true, id: key },\n vnode\n );\n};\nconst renderReactScope = (vnode, unstable, portals, currentIndex, key) => {\n const el = portals?.[currentIndex]?.current;\n const isBlock = isValidElement(vnode) && typeof vnode.type === \"function\" && \"_c\" in vnode.type;\n const isCallable = isBlock && vnode.type._c;\n if (typeof window === \"undefined\") {\n if (isBlock) {\n if (isCallable) {\n return vnode;\n }\n return wrap(wrap(vnode), key);\n }\n return wrap(vnode, key);\n }\n if (isCallable) {\n const puppetComponent = vnode.type(vnode.props);\n if (REGISTRY.has(puppetComponent.type)) {\n const puppetBlock = REGISTRY.get(puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n return puppetBlock(puppetComponent.props);\n }\n }\n }\n const current = el ?? (key ? document.getElementById(key) : null) ?? document.createElement(RENDER_SCOPE);\n const reactPortal = createPortal(\n createElement(Fragment, { children: vnode }),\n current,\n key\n );\n const millionPortal = {\n foreign: true,\n current,\n portal: reactPortal,\n reset: (child) => {\n child.childNodes.forEach((cn) => child.removeChild(cn));\n },\n unstable\n };\n if (portals) {\n portals[currentIndex] = millionPortal;\n }\n return millionPortal;\n};\nconst unwrap = (vnode) => {\n if (typeof vnode !== \"object\" || vnode === null || !(\"type\" in vnode)) {\n if (typeof vnode === \"number\") {\n return String(vnode);\n }\n return vnode;\n }\n let type = vnode.type;\n if (typeof type === \"function\") {\n return unwrap(type(vnode.props ?? {}));\n }\n if (typeof type === \"object\" && \"$\" in type)\n return type;\n const props = { ...vnode.props };\n if (\"css\" in props && \"__EMOTION_TYPE_PLEASE_DO_NOT_USE__\" in props) {\n props.style = props.css.styles;\n type = props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.__EMOTION_TYPE_PLEASE_DO_NOT_USE__;\n delete props.css;\n }\n const children = vnode.props?.children;\n if (children !== void 0 && children !== null) {\n props.children = flatten(vnode.props.children).map(\n (child) => unwrap(child)\n );\n }\n return {\n type,\n // lets pretend no function go through\n props\n };\n};\nconst flatten = (rawChildren) => {\n if (rawChildren === void 0 || rawChildren === null)\n return [];\n if (typeof rawChildren === \"object\" && \"type\" in rawChildren && rawChildren.type === Fragment) {\n return flatten(rawChildren.props.children);\n }\n if (!Array.isArray(rawChildren) || typeof rawChildren === \"object\" && \"$\" in rawChildren) {\n return [rawChildren];\n }\n const flattenedChildren = rawChildren.flat(Infinity);\n const children = [];\n for (let i = 0, l = flattenedChildren.length; i < l; ++i) {\n children.push(...flatten(flattenedChildren[i]));\n }\n return children;\n};\n\nconst useLayoutEffect = typeof window === \"undefined\" ? useEffect : useLayoutEffect$1;\nfunction traverse(fiber, selector, ascending) {\n if (!fiber || selector(fiber))\n return fiber;\n let child = ascending ? fiber.return : fiber.child;\n while (child) {\n const match = traverse(child, selector, ascending);\n if (match)\n return match;\n child = ascending ? null : child.sibling;\n }\n}\nfunction useFiber() {\n const fiber = useRef();\n useState(() => {\n const bind = Function.prototype.bind;\n Function.prototype.bind = function(self, maybeFiber) {\n if (self === null && typeof maybeFiber?.type === \"function\") {\n fiber.current = maybeFiber;\n Function.prototype.bind = bind;\n }\n return bind.apply(this, arguments);\n };\n });\n return fiber.current;\n}\nfunction useNearestParent(type) {\n const fiber = useFiber();\n const parentRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n parentRef.current.el = traverse(\n fiber,\n (node) => {\n parentRef.current.depth++;\n return typeof node.type === \"string\" && (type === void 0 || node.type === type);\n },\n true\n )?.stateNode;\n }, [fiber]);\n return parentRef;\n}\nfunction useContainer() {\n const fiber = useFiber();\n const rootRef = useRef({ el: null, depth: 0 });\n useLayoutEffect(() => {\n rootRef.current.el = traverse(\n fiber,\n (node) => {\n rootRef.current.depth++;\n return node.stateNode?.containerInfo != null;\n },\n true\n )?.stateNode.containerInfo;\n }, [fiber]);\n return rootRef;\n}\n\nexport { Effect as E, RENDER_SCOPE as R, SVG_RENDER_SCOPE as S, REGISTRY as a, useContainer as b, useNearestParent as c, processProps as p, renderReactScope as r, scopedContext as s, unwrap as u };\n","'use client';\nimport { b as block$1, M as MapHas$, a as MapSet$, c as cloneNode$, m as mount$, p as patch, r as remove$, d as arrayPatch$, e as mapArray, f as arrayMount$, g as MapGet$, h as mount } from '../shared/million.fb41761f.mjs';\nexport { i as removeComments } from '../shared/million.fb41761f.mjs';\nimport { useRef, useCallback, useMemo, createElement, Fragment, useState, useEffect, memo, useContext } from 'react';\nimport { experimental_options } from './experimental.mjs';\nimport { S as SVG_RENDER_SCOPE, R as RENDER_SCOPE, u as unwrap, a as REGISTRY, b as useContainer, c as useNearestParent, p as processProps, E as Effect, r as renderReactScope, s as scopedContext } from '../shared/million.9efd57f2.mjs';\nimport 'react-dom';\n\nconst block = (fn, options = {}) => {\n const noSlot = options?.experimental_noSlot ?? experimental_options.noSlot;\n let blockTarget = options?.block;\n const defaultType = options?.svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n if (fn) {\n blockTarget = block$1(\n fn,\n unwrap,\n options?.shouldUpdate,\n options?.svg\n );\n }\n const MillionBlock = (props, forwardedRef) => {\n const container = useContainer();\n const parentRef = useNearestParent();\n const hmrTimestamp = props._hmr;\n const ref = useRef(null);\n const patch$1 = useRef(null);\n const portalRef = useRef([]);\n props = processProps(props, forwardedRef, portalRef.current);\n patch$1.current?.(props);\n const effect = useCallback(() => {\n if (!ref.current && !noSlot)\n return;\n const currentBlock = blockTarget(props, props.key);\n if (hmrTimestamp && ref.current?.textContent) {\n ref.current.textContent = \"\";\n }\n if (noSlot) {\n ref.current = parentRef.current?.el ?? container.current?.el;\n if (props.scoped || parentRef.current && container.current && parentRef.current.depth > container.current.depth) {\n ref.current = container.current.el;\n }\n if (ref.current.childNodes.length) {\n console.error(\n new Error(`\\`experimental_options.noSlot\\` does not support having siblings at the moment.\nThe block element should be the only child of the \\`${cloneNode$.call(ref.current).outerHTML}\\` element.\nTo avoid this error, \\`experimental_options.noSlot\\` should be false`)\n );\n }\n }\n if (patch$1.current === null || hmrTimestamp) {\n mount$.call(currentBlock, ref.current, null);\n patch$1.current = (props2) => {\n patch(\n currentBlock,\n blockTarget(\n props2,\n props2.key,\n options?.shouldUpdate\n )\n );\n };\n }\n return () => {\n remove$.call(currentBlock);\n };\n }, []);\n const marker = useMemo(() => {\n if (noSlot) {\n return null;\n }\n return createElement(options?.as ?? defaultType, { ref });\n }, []);\n const childrenSize = portalRef.current.length;\n const children = new Array(childrenSize);\n for (let i = 0; i < childrenSize; ++i) {\n children[i] = portalRef.current[i]?.portal;\n }\n const vnode = createElement(\n Fragment,\n {},\n marker,\n createElement(Effect, {\n effect,\n deps: hmrTimestamp ? [hmrTimestamp] : []\n }),\n children\n );\n return vnode;\n };\n if (!MapHas$.call(REGISTRY, MillionBlock)) {\n MapSet$.call(REGISTRY, MillionBlock, block);\n }\n if (options?.name) {\n if (fn) {\n fn.displayName = `Million(Render(${options.name}))`;\n }\n MillionBlock.displayName = `Million(Block(${options.name}))`;\n }\n return MillionBlock;\n};\n\nconst MillionArray = ({\n each,\n children,\n memo: memo2,\n svg,\n as,\n ...rest\n}) => {\n const ref = useRef(null);\n const [portals] = useState(() => ({\n current: Array(each.length)\n }));\n const fragmentRef = useRef(null);\n const cache = useRef({\n each: null,\n children: null,\n mounted: false\n });\n const [, setMountPortals] = useState(false);\n if (fragmentRef.current && (each !== cache.current.each || !memo2)) {\n const newChildren = createChildren(each, children, cache, portals, memo2);\n arrayPatch$.call(fragmentRef.current, mapArray(newChildren));\n }\n const defaultType = svg ? SVG_RENDER_SCOPE : RENDER_SCOPE;\n const MillionFor = createElement(\n Fragment,\n null,\n createElement(as ?? defaultType, { ...rest, ref }),\n ...portals.current.map((p) => p.portal)\n );\n useEffect(() => {\n if (!ref.current || fragmentRef.current)\n return;\n if (cache.current.mounted)\n return;\n const newChildren = createChildren(each, children, cache, portals, memo2);\n fragmentRef.current = mapArray(newChildren);\n if (!MapHas$.call(REGISTRY, MillionFor)) {\n MapSet$.call(REGISTRY, MillionFor, fragmentRef.current);\n }\n arrayMount$.call(fragmentRef.current, ref.current);\n cache.current.mounted = true;\n setMountPortals(true);\n }, [ref.current]);\n return MillionFor;\n};\nconst typedMemo = memo;\nconst For = typedMemo(MillionArray);\nconst createChildren = (each, getComponent, cache, portals, memo2) => {\n const children = Array(each.length);\n const currentCache = cache.current;\n for (let i = 0, l = each.length; i < l; ++i) {\n if (memo2 && currentCache.each && currentCache.each[i] === each[i]) {\n children[i] = currentCache.children?.[i];\n continue;\n }\n const vnode = getComponent(each[i], i);\n if (MapHas$.call(REGISTRY, vnode.type)) {\n if (!currentCache.block) {\n currentCache.block = MapGet$.call(REGISTRY, vnode.type);\n }\n children[i] = currentCache.block(vnode.props, portals, i);\n continue;\n }\n if (typeof vnode.type === \"function\" && \"_c\" in vnode.type) {\n const puppetComponent = vnode.type(vnode.props);\n if (MapHas$.call(REGISTRY, puppetComponent.type)) {\n const puppetBlock = MapGet$.call(REGISTRY, puppetComponent.type);\n if (typeof puppetBlock === \"function\") {\n children[i] = puppetBlock(puppetComponent.props);\n continue;\n }\n }\n }\n const block = block$1((props) => props?.scope);\n const currentBlock = (props, portals2, index) => {\n return block(\n {\n scope: renderReactScope(\n createElement(vnode.type, props),\n false,\n portals2.current,\n index\n )\n },\n vnode.key ? String(vnode.key) : void 0\n );\n };\n MapSet$.call(REGISTRY, vnode.type, currentBlock);\n currentCache.block = currentBlock;\n children[i] = currentBlock(vnode.props, portals, i);\n }\n currentCache.each = each;\n currentCache.children = children;\n return children;\n};\n\nfunction isEqual(a, b) {\n return a === b || a !== a && b !== b;\n}\nfunction shouldCompiledBlockUpdate(prev, next) {\n for (const key in prev) {\n if (!isEqual(prev[key], next[key])) {\n return true;\n }\n }\n return false;\n}\nfunction compiledBlock(render, { portals, ...options }) {\n const blockName = `CompiledBlock(Inner(${options.name}))`;\n const RenderBlock = block((props) => render(props), {\n ...options,\n scoped: void 0,\n name: blockName,\n shouldUpdate: shouldCompiledBlockUpdate\n });\n const portalCount = portals?.length || 0;\n const Component = portals && portalCount > 0 ? (props) => {\n const scoped = useContext(scopedContext);\n const [current] = useState(() => []);\n const derived = { ...props, scoped };\n for (let i = 0; i < portalCount; i++) {\n const index = portals[i];\n const scope = renderReactScope(\n derived[index],\n false,\n current,\n i\n );\n derived[index] = scope;\n }\n const targets = [];\n for (let i = 0, len = current.length; i < len; i++) {\n targets[i] = current[i].portal;\n }\n return createElement(\n Fragment,\n null,\n createElement(RenderBlock, derived),\n targets\n );\n } : (props) => createElement(RenderBlock, props);\n if (options.name) {\n Component.displayName = `Million(CompiledBlock(Outer(${options.name})))`;\n }\n return Component;\n}\n\nconst INTERNALS = {\n block: block$1,\n patch,\n mount\n};\nif (typeof window !== \"undefined\") {\n window.__MILLION_DATA__ = {\n version: \"3.0.6\"\n };\n}\n\nexport { For, INTERNALS, REGISTRY, block, compiledBlock, renderReactScope, unwrap };\n","export const EVENTS_SOCKET = {\r\n MESSAGE: 'message',\r\n TYPING: 'typing',\r\n STOP_TYPING: 'stop-typing',\r\n AGENT_MESSAGE: 'agent-message',\r\n}\r\n\r\nexport const USER_ID_KEY = 'user-bot-id'\r\n\r\nexport const API_URL = import.meta.env.DEV\r\n ? 'http://localhost:8080'\r\n : 'https://api.dialoguebot.tech'\r\n\r\nconsole.log('API_URL', API_URL)\r\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.output = exports.exists = exports.hash = exports.bytes = exports.bool = exports.number = exports.isBytes = void 0;\nfunction number(n) {\n if (!Number.isSafeInteger(n) || n < 0)\n throw new Error(`positive integer expected, not ${n}`);\n}\nexports.number = number;\nfunction bool(b) {\n if (typeof b !== 'boolean')\n throw new Error(`boolean expected, not ${b}`);\n}\nexports.bool = bool;\n// copied from utils\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\nfunction bytes(b, ...lengths) {\n if (!isBytes(b))\n throw new Error('Uint8Array expected');\n if (lengths.length > 0 && !lengths.includes(b.length))\n throw new Error(`Uint8Array expected of length ${lengths}, not of length=${b.length}`);\n}\nexports.bytes = bytes;\nfunction hash(h) {\n if (typeof h !== 'function' || typeof h.create !== 'function')\n throw new Error('Hash should be wrapped by utils.wrapConstructor');\n number(h.outputLen);\n number(h.blockLen);\n}\nexports.hash = hash;\nfunction exists(instance, checkFinished = true) {\n if (instance.destroyed)\n throw new Error('Hash instance has been destroyed');\n if (checkFinished && instance.finished)\n throw new Error('Hash#digest() has already been called');\n}\nexports.exists = exists;\nfunction output(out, instance) {\n bytes(out);\n const min = instance.outputLen;\n if (out.length < min) {\n throw new Error(`digestInto() expects output buffer of length at least ${min}`);\n }\n}\nexports.output = output;\nconst assert = { number, bool, bytes, hash, exists, output };\nexports.default = assert;\n//# sourceMappingURL=_assert.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.add5L = exports.add5H = exports.add4H = exports.add4L = exports.add3H = exports.add3L = exports.add = exports.rotlBL = exports.rotlBH = exports.rotlSL = exports.rotlSH = exports.rotr32L = exports.rotr32H = exports.rotrBL = exports.rotrBH = exports.rotrSL = exports.rotrSH = exports.shrSL = exports.shrSH = exports.toBig = exports.split = exports.fromBig = void 0;\nconst U32_MASK64 = /* @__PURE__ */ BigInt(2 ** 32 - 1);\nconst _32n = /* @__PURE__ */ BigInt(32);\n// We are not using BigUint64Array, because they are extremely slow as per 2022\nfunction fromBig(n, le = false) {\n if (le)\n return { h: Number(n & U32_MASK64), l: Number((n >> _32n) & U32_MASK64) };\n return { h: Number((n >> _32n) & U32_MASK64) | 0, l: Number(n & U32_MASK64) | 0 };\n}\nexports.fromBig = fromBig;\nfunction split(lst, le = false) {\n let Ah = new Uint32Array(lst.length);\n let Al = new Uint32Array(lst.length);\n for (let i = 0; i < lst.length; i++) {\n const { h, l } = fromBig(lst[i], le);\n [Ah[i], Al[i]] = [h, l];\n }\n return [Ah, Al];\n}\nexports.split = split;\nconst toBig = (h, l) => (BigInt(h >>> 0) << _32n) | BigInt(l >>> 0);\nexports.toBig = toBig;\n// for Shift in [0, 32)\nconst shrSH = (h, _l, s) => h >>> s;\nexports.shrSH = shrSH;\nconst shrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.shrSL = shrSL;\n// Right rotate for Shift in [1, 32)\nconst rotrSH = (h, l, s) => (h >>> s) | (l << (32 - s));\nexports.rotrSH = rotrSH;\nconst rotrSL = (h, l, s) => (h << (32 - s)) | (l >>> s);\nexports.rotrSL = rotrSL;\n// Right rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotrBH = (h, l, s) => (h << (64 - s)) | (l >>> (s - 32));\nexports.rotrBH = rotrBH;\nconst rotrBL = (h, l, s) => (h >>> (s - 32)) | (l << (64 - s));\nexports.rotrBL = rotrBL;\n// Right rotate for shift===32 (just swaps l&h)\nconst rotr32H = (_h, l) => l;\nexports.rotr32H = rotr32H;\nconst rotr32L = (h, _l) => h;\nexports.rotr32L = rotr32L;\n// Left rotate for Shift in [1, 32)\nconst rotlSH = (h, l, s) => (h << s) | (l >>> (32 - s));\nexports.rotlSH = rotlSH;\nconst rotlSL = (h, l, s) => (l << s) | (h >>> (32 - s));\nexports.rotlSL = rotlSL;\n// Left rotate for Shift in (32, 64), NOTE: 32 is special case.\nconst rotlBH = (h, l, s) => (l << (s - 32)) | (h >>> (64 - s));\nexports.rotlBH = rotlBH;\nconst rotlBL = (h, l, s) => (h << (s - 32)) | (l >>> (64 - s));\nexports.rotlBL = rotlBL;\n// JS uses 32-bit signed integers for bitwise operations which means we cannot\n// simple take carry out of low bit sum by shift, we need to use division.\nfunction add(Ah, Al, Bh, Bl) {\n const l = (Al >>> 0) + (Bl >>> 0);\n return { h: (Ah + Bh + ((l / 2 ** 32) | 0)) | 0, l: l | 0 };\n}\nexports.add = add;\n// Addition with more than 2 elements\nconst add3L = (Al, Bl, Cl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0);\nexports.add3L = add3L;\nconst add3H = (low, Ah, Bh, Ch) => (Ah + Bh + Ch + ((low / 2 ** 32) | 0)) | 0;\nexports.add3H = add3H;\nconst add4L = (Al, Bl, Cl, Dl) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0);\nexports.add4L = add4L;\nconst add4H = (low, Ah, Bh, Ch, Dh) => (Ah + Bh + Ch + Dh + ((low / 2 ** 32) | 0)) | 0;\nexports.add4H = add4H;\nconst add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);\nexports.add5L = add5L;\nconst add5H = (low, Ah, Bh, Ch, Dh, Eh) => (Ah + Bh + Ch + Dh + Eh + ((low / 2 ** 32) | 0)) | 0;\nexports.add5H = add5H;\n// prettier-ignore\nconst u64 = {\n fromBig, split, toBig,\n shrSH, shrSL,\n rotrSH, rotrSL, rotrBH, rotrBL,\n rotr32H, rotr32L,\n rotlSH, rotlSL, rotlBH, rotlBL,\n add, add3L, add3H, add4L, add4H, add5H, add5L,\n};\nexports.default = u64;\n//# sourceMappingURL=_u64.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.crypto = void 0;\nexports.crypto = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;\n//# sourceMappingURL=crypto.js.map","\"use strict\";\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.randomBytes = exports.wrapXOFConstructorWithOpts = exports.wrapConstructorWithOpts = exports.wrapConstructor = exports.checkOpts = exports.Hash = exports.concatBytes = exports.toBytes = exports.utf8ToBytes = exports.asyncLoop = exports.nextTick = exports.hexToBytes = exports.bytesToHex = exports.byteSwap32 = exports.byteSwapIfBE = exports.byteSwap = exports.isLE = exports.rotl = exports.rotr = exports.createView = exports.u32 = exports.u8 = exports.isBytes = void 0;\n// We use WebCrypto aka globalThis.crypto, which exists in browsers and node.js 16+.\n// node.js versions earlier than v19 don't declare it in global scope.\n// For node.js, package.json#exports field mapping rewrites import\n// from `crypto` to `cryptoNode`, which imports native module.\n// Makes the utils un-importable in browsers without a bundler.\n// Once node.js 18 is deprecated (2025-04-30), we can just drop the import.\nconst crypto_1 = require(\"@noble/hashes/crypto\");\nconst _assert_js_1 = require(\"./_assert.js\");\n// export { isBytes } from './_assert.js';\n// We can't reuse isBytes from _assert, because somehow this causes huge perf issues\nfunction isBytes(a) {\n return (a instanceof Uint8Array ||\n (a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));\n}\nexports.isBytes = isBytes;\n// Cast array to different type\nconst u8 = (arr) => new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.u8 = u8;\nconst u32 = (arr) => new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));\nexports.u32 = u32;\n// Cast array to view\nconst createView = (arr) => new DataView(arr.buffer, arr.byteOffset, arr.byteLength);\nexports.createView = createView;\n// The rotate right (circular right shift) operation for uint32\nconst rotr = (word, shift) => (word << (32 - shift)) | (word >>> shift);\nexports.rotr = rotr;\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0);\nexports.rotl = rotl;\nexports.isLE = new Uint8Array(new Uint32Array([0x11223344]).buffer)[0] === 0x44;\n// The byte swap operation for uint32\nconst byteSwap = (word) => ((word << 24) & 0xff000000) |\n ((word << 8) & 0xff0000) |\n ((word >>> 8) & 0xff00) |\n ((word >>> 24) & 0xff);\nexports.byteSwap = byteSwap;\n// Conditionally byte swap if on a big-endian platform\nexports.byteSwapIfBE = exports.isLE ? (n) => n : (n) => (0, exports.byteSwap)(n);\n// In place byte swap for Uint32Array\nfunction byteSwap32(arr) {\n for (let i = 0; i < arr.length; i++) {\n arr[i] = (0, exports.byteSwap)(arr[i]);\n }\n}\nexports.byteSwap32 = byteSwap32;\n// Array where index 0xf0 (240) is mapped to string 'f0'\nconst hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'\n */\nfunction bytesToHex(bytes) {\n (0, _assert_js_1.bytes)(bytes);\n // pre-caching improves the speed 6x\n let hex = '';\n for (let i = 0; i < bytes.length; i++) {\n hex += hexes[bytes[i]];\n }\n return hex;\n}\nexports.bytesToHex = bytesToHex;\n// We use optimized technique to convert hex string to byte array\nconst asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 };\nfunction asciiToBase16(char) {\n if (char >= asciis._0 && char <= asciis._9)\n return char - asciis._0;\n if (char >= asciis._A && char <= asciis._F)\n return char - (asciis._A - 10);\n if (char >= asciis._a && char <= asciis._f)\n return char - (asciis._a - 10);\n return;\n}\n/**\n * @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])\n */\nfunction hexToBytes(hex) {\n if (typeof hex !== 'string')\n throw new Error('hex string expected, got ' + typeof hex);\n const hl = hex.length;\n const al = hl / 2;\n if (hl % 2)\n throw new Error('padded hex string expected, got unpadded hex of length ' + hl);\n const array = new Uint8Array(al);\n for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {\n const n1 = asciiToBase16(hex.charCodeAt(hi));\n const n2 = asciiToBase16(hex.charCodeAt(hi + 1));\n if (n1 === undefined || n2 === undefined) {\n const char = hex[hi] + hex[hi + 1];\n throw new Error('hex string expected, got non-hex character \"' + char + '\" at index ' + hi);\n }\n array[ai] = n1 * 16 + n2;\n }\n return array;\n}\nexports.hexToBytes = hexToBytes;\n// There is no setImmediate in browser and setTimeout is slow.\n// call of async fn will return Promise, which will be fullfiled only on\n// next scheduler queue processing step and this is exactly what we need.\nconst nextTick = async () => { };\nexports.nextTick = nextTick;\n// Returns control to thread each 'tick' ms to avoid blocking\nasync function asyncLoop(iters, tick, cb) {\n let ts = Date.now();\n for (let i = 0; i < iters; i++) {\n cb(i);\n // Date.now() is not monotonic, so in case if clock goes backwards we return return control too\n const diff = Date.now() - ts;\n if (diff >= 0 && diff < tick)\n continue;\n await (0, exports.nextTick)();\n ts += diff;\n }\n}\nexports.asyncLoop = asyncLoop;\n/**\n * @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])\n */\nfunction utf8ToBytes(str) {\n if (typeof str !== 'string')\n throw new Error(`utf8ToBytes expected string, got ${typeof str}`);\n return new Uint8Array(new TextEncoder().encode(str)); // https://bugzil.la/1681809\n}\nexports.utf8ToBytes = utf8ToBytes;\n/**\n * Normalizes (non-hex) string or Uint8Array to Uint8Array.\n * Warning: when Uint8Array is passed, it would NOT get copied.\n * Keep in mind for future mutable operations.\n */\nfunction toBytes(data) {\n if (typeof data === 'string')\n data = utf8ToBytes(data);\n (0, _assert_js_1.bytes)(data);\n return data;\n}\nexports.toBytes = toBytes;\n/**\n * Copies several Uint8Arrays into one.\n */\nfunction concatBytes(...arrays) {\n let sum = 0;\n for (let i = 0; i < arrays.length; i++) {\n const a = arrays[i];\n (0, _assert_js_1.bytes)(a);\n sum += a.length;\n }\n const res = new Uint8Array(sum);\n for (let i = 0, pad = 0; i < arrays.length; i++) {\n const a = arrays[i];\n res.set(a, pad);\n pad += a.length;\n }\n return res;\n}\nexports.concatBytes = concatBytes;\n// For runtime check if class implements interface\nclass Hash {\n // Safe version that clones internal state\n clone() {\n return this._cloneInto();\n }\n}\nexports.Hash = Hash;\nconst toStr = {}.toString;\nfunction checkOpts(defaults, opts) {\n if (opts !== undefined && toStr.call(opts) !== '[object Object]')\n throw new Error('Options should be object or undefined');\n const merged = Object.assign(defaults, opts);\n return merged;\n}\nexports.checkOpts = checkOpts;\nfunction wrapConstructor(hashCons) {\n const hashC = (msg) => hashCons().update(toBytes(msg)).digest();\n const tmp = hashCons();\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = () => hashCons();\n return hashC;\n}\nexports.wrapConstructor = wrapConstructor;\nfunction wrapConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapConstructorWithOpts = wrapConstructorWithOpts;\nfunction wrapXOFConstructorWithOpts(hashCons) {\n const hashC = (msg, opts) => hashCons(opts).update(toBytes(msg)).digest();\n const tmp = hashCons({});\n hashC.outputLen = tmp.outputLen;\n hashC.blockLen = tmp.blockLen;\n hashC.create = (opts) => hashCons(opts);\n return hashC;\n}\nexports.wrapXOFConstructorWithOpts = wrapXOFConstructorWithOpts;\n/**\n * Secure PRNG. Uses `crypto.getRandomValues`, which defers to OS.\n */\nfunction randomBytes(bytesLength = 32) {\n if (crypto_1.crypto && typeof crypto_1.crypto.getRandomValues === 'function') {\n return crypto_1.crypto.getRandomValues(new Uint8Array(bytesLength));\n }\n throw new Error('crypto.getRandomValues must be defined');\n}\nexports.randomBytes = randomBytes;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.shake256 = exports.shake128 = exports.keccak_512 = exports.keccak_384 = exports.keccak_256 = exports.keccak_224 = exports.sha3_512 = exports.sha3_384 = exports.sha3_256 = exports.sha3_224 = exports.Keccak = exports.keccakP = void 0;\nconst _assert_js_1 = require(\"./_assert.js\");\nconst _u64_js_1 = require(\"./_u64.js\");\nconst utils_js_1 = require(\"./utils.js\");\n// SHA3 (keccak) is based on a new design: basically, the internal state is bigger than output size.\n// It's called a sponge function.\n// Various per round constants calculations\nconst SHA3_PI = [];\nconst SHA3_ROTL = [];\nconst _SHA3_IOTA = [];\nconst _0n = /* @__PURE__ */ BigInt(0);\nconst _1n = /* @__PURE__ */ BigInt(1);\nconst _2n = /* @__PURE__ */ BigInt(2);\nconst _7n = /* @__PURE__ */ BigInt(7);\nconst _256n = /* @__PURE__ */ BigInt(256);\nconst _0x71n = /* @__PURE__ */ BigInt(0x71);\nfor (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {\n // Pi\n [x, y] = [y, (2 * x + 3 * y) % 5];\n SHA3_PI.push(2 * (5 * y + x));\n // Rotational\n SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);\n // Iota\n let t = _0n;\n for (let j = 0; j < 7; j++) {\n R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;\n if (R & _2n)\n t ^= _1n << ((_1n << /* @__PURE__ */ BigInt(j)) - _1n);\n }\n _SHA3_IOTA.push(t);\n}\nconst [SHA3_IOTA_H, SHA3_IOTA_L] = /* @__PURE__ */ (0, _u64_js_1.split)(_SHA3_IOTA, true);\n// Left rotation (without 0, 32, 64)\nconst rotlH = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBH)(h, l, s) : (0, _u64_js_1.rotlSH)(h, l, s));\nconst rotlL = (h, l, s) => (s > 32 ? (0, _u64_js_1.rotlBL)(h, l, s) : (0, _u64_js_1.rotlSL)(h, l, s));\n// Same as keccakf1600, but allows to skip some rounds\nfunction keccakP(s, rounds = 24) {\n const B = new Uint32Array(5 * 2);\n // NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)\n for (let round = 24 - rounds; round < 24; round++) {\n // Theta θ\n for (let x = 0; x < 10; x++)\n B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];\n for (let x = 0; x < 10; x += 2) {\n const idx1 = (x + 8) % 10;\n const idx0 = (x + 2) % 10;\n const B0 = B[idx0];\n const B1 = B[idx0 + 1];\n const Th = rotlH(B0, B1, 1) ^ B[idx1];\n const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];\n for (let y = 0; y < 50; y += 10) {\n s[x + y] ^= Th;\n s[x + y + 1] ^= Tl;\n }\n }\n // Rho (ρ) and Pi (π)\n let curH = s[2];\n let curL = s[3];\n for (let t = 0; t < 24; t++) {\n const shift = SHA3_ROTL[t];\n const Th = rotlH(curH, curL, shift);\n const Tl = rotlL(curH, curL, shift);\n const PI = SHA3_PI[t];\n curH = s[PI];\n curL = s[PI + 1];\n s[PI] = Th;\n s[PI + 1] = Tl;\n }\n // Chi (χ)\n for (let y = 0; y < 50; y += 10) {\n for (let x = 0; x < 10; x++)\n B[x] = s[y + x];\n for (let x = 0; x < 10; x++)\n s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];\n }\n // Iota (ι)\n s[0] ^= SHA3_IOTA_H[round];\n s[1] ^= SHA3_IOTA_L[round];\n }\n B.fill(0);\n}\nexports.keccakP = keccakP;\nclass Keccak extends utils_js_1.Hash {\n // NOTE: we accept arguments in bytes instead of bits here.\n constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {\n super();\n this.blockLen = blockLen;\n this.suffix = suffix;\n this.outputLen = outputLen;\n this.enableXOF = enableXOF;\n this.rounds = rounds;\n this.pos = 0;\n this.posOut = 0;\n this.finished = false;\n this.destroyed = false;\n // Can be passed from user as dkLen\n (0, _assert_js_1.number)(outputLen);\n // 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes\n if (0 >= this.blockLen || this.blockLen >= 200)\n throw new Error('Sha3 supports only keccak-f1600 function');\n this.state = new Uint8Array(200);\n this.state32 = (0, utils_js_1.u32)(this.state);\n }\n keccak() {\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n keccakP(this.state32, this.rounds);\n if (!utils_js_1.isLE)\n (0, utils_js_1.byteSwap32)(this.state32);\n this.posOut = 0;\n this.pos = 0;\n }\n update(data) {\n (0, _assert_js_1.exists)(this);\n const { blockLen, state } = this;\n data = (0, utils_js_1.toBytes)(data);\n const len = data.length;\n for (let pos = 0; pos < len;) {\n const take = Math.min(blockLen - this.pos, len - pos);\n for (let i = 0; i < take; i++)\n state[this.pos++] ^= data[pos++];\n if (this.pos === blockLen)\n this.keccak();\n }\n return this;\n }\n finish() {\n if (this.finished)\n return;\n this.finished = true;\n const { state, suffix, pos, blockLen } = this;\n // Do the padding\n state[pos] ^= suffix;\n if ((suffix & 0x80) !== 0 && pos === blockLen - 1)\n this.keccak();\n state[blockLen - 1] ^= 0x80;\n this.keccak();\n }\n writeInto(out) {\n (0, _assert_js_1.exists)(this, false);\n (0, _assert_js_1.bytes)(out);\n this.finish();\n const bufferOut = this.state;\n const { blockLen } = this;\n for (let pos = 0, len = out.length; pos < len;) {\n if (this.posOut >= blockLen)\n this.keccak();\n const take = Math.min(blockLen - this.posOut, len - pos);\n out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);\n this.posOut += take;\n pos += take;\n }\n return out;\n }\n xofInto(out) {\n // Sha3/Keccak usage with XOF is probably mistake, only SHAKE instances can do XOF\n if (!this.enableXOF)\n throw new Error('XOF is not possible for this instance');\n return this.writeInto(out);\n }\n xof(bytes) {\n (0, _assert_js_1.number)(bytes);\n return this.xofInto(new Uint8Array(bytes));\n }\n digestInto(out) {\n (0, _assert_js_1.output)(out, this);\n if (this.finished)\n throw new Error('digest() was already called');\n this.writeInto(out);\n this.destroy();\n return out;\n }\n digest() {\n return this.digestInto(new Uint8Array(this.outputLen));\n }\n destroy() {\n this.destroyed = true;\n this.state.fill(0);\n }\n _cloneInto(to) {\n const { blockLen, suffix, outputLen, rounds, enableXOF } = this;\n to || (to = new Keccak(blockLen, suffix, outputLen, enableXOF, rounds));\n to.state32.set(this.state32);\n to.pos = this.pos;\n to.posOut = this.posOut;\n to.finished = this.finished;\n to.rounds = rounds;\n // Suffix can change in cSHAKE\n to.suffix = suffix;\n to.outputLen = outputLen;\n to.enableXOF = enableXOF;\n to.destroyed = this.destroyed;\n return to;\n }\n}\nexports.Keccak = Keccak;\nconst gen = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructor)(() => new Keccak(blockLen, suffix, outputLen));\nexports.sha3_224 = gen(0x06, 144, 224 / 8);\n/**\n * SHA3-256 hash function\n * @param message - that would be hashed\n */\nexports.sha3_256 = gen(0x06, 136, 256 / 8);\nexports.sha3_384 = gen(0x06, 104, 384 / 8);\nexports.sha3_512 = gen(0x06, 72, 512 / 8);\nexports.keccak_224 = gen(0x01, 144, 224 / 8);\n/**\n * keccak-256 hash function. Different from SHA3-256.\n * @param message - that would be hashed\n */\nexports.keccak_256 = gen(0x01, 136, 256 / 8);\nexports.keccak_384 = gen(0x01, 104, 384 / 8);\nexports.keccak_512 = gen(0x01, 72, 512 / 8);\nconst genShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapXOFConstructorWithOpts)((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true));\nexports.shake128 = genShake(0x1f, 168, 128 / 8);\nexports.shake256 = genShake(0x1f, 136, 256 / 8);\n//# sourceMappingURL=sha3.js.map","/* global global, window, module */\nconst { sha3_512: sha3 } = require(\"@noble/hashes/sha3\");\n\nconst defaultLength = 24;\nconst bigLength = 32;\n\nconst createEntropy = (length = 4, random = Math.random) => {\n let entropy = \"\";\n\n while (entropy.length < length) {\n entropy = entropy + Math.floor(random() * 36).toString(36);\n }\n return entropy;\n};\n\n/*\n * Adapted from https://github.com/juanelas/bigint-conversion\n * MIT License Copyright (c) 2018 Juan Hernández Serrano\n */\nfunction bufToBigInt(buf) {\n let bits = 8n;\n\n let value = 0n;\n for (const i of buf.values()) {\n const bi = BigInt(i);\n value = (value << bits) + bi;\n }\n return value;\n}\n\nconst hash = (input = \"\") => {\n // Drop the first character because it will bias the histogram\n // to the left.\n return bufToBigInt(sha3(input)).toString(36).slice(1);\n};\n\nconst alphabet = Array.from({ length: 26 }, (x, i) =>\n String.fromCharCode(i + 97)\n);\n\nconst randomLetter = (random) =>\n alphabet[Math.floor(random() * alphabet.length)];\n\n/*\nThis is a fingerprint of the host environment. It is used to help\nprevent collisions when generating ids in a distributed system.\nIf no global object is available, you can pass in your own, or fall back\non a random string.\n*/\nconst createFingerprint = ({\n globalObj = typeof global !== \"undefined\"\n ? global\n : typeof window !== \"undefined\"\n ? window\n : {},\n random = Math.random,\n} = {}) => {\n const globals = Object.keys(globalObj).toString();\n const sourceString = globals.length\n ? globals + createEntropy(bigLength, random)\n : createEntropy(bigLength, random);\n\n return hash(sourceString).substring(0, bigLength);\n};\n\nconst createCounter = (count) => () => {\n return count++;\n};\n\n// ~22k hosts before 50% chance of initial counter collision\n// with a remaining counter range of 9.0e+15 in JavaScript.\nconst initialCountMax = 476782367;\n\nconst init = ({\n // Fallback if the user does not pass in a CSPRNG. This should be OK\n // because we don't rely solely on the random number generator for entropy.\n // We also use the host fingerprint, current time, and a session counter.\n random = Math.random,\n counter = createCounter(Math.floor(random() * initialCountMax)),\n length = defaultLength,\n fingerprint = createFingerprint({ random }),\n} = {}) => {\n return function cuid2() {\n const firstLetter = randomLetter(random);\n\n // If we're lucky, the `.toString(36)` calls may reduce hashing rounds\n // by shortening the input to the hash function a little.\n const time = Date.now().toString(36);\n const count = counter().toString(36);\n\n // The salt should be long enough to be globally unique across the full\n // length of the hash. For simplicity, we use the same length as the\n // intended id output.\n const salt = createEntropy(length, random);\n const hashInput = `${time + salt + count + fingerprint}`;\n\n return `${firstLetter + hash(hashInput).substring(1, length)}`;\n };\n};\n\nconst createId = init();\n\nconst isCuid = (id, { minLength = 2, maxLength = bigLength } = {}) => {\n const length = id.length;\n const regex = /^[0-9a-z]+$/;\n\n try {\n if (\n typeof id === \"string\" &&\n length >= minLength &&\n length <= maxLength &&\n regex.test(id)\n )\n return true;\n } finally {\n }\n\n return false;\n};\n\nmodule.exports.getConstants = () => ({ defaultLength, bigLength });\nmodule.exports.init = init;\nmodule.exports.createId = createId;\nmodule.exports.bufToBigInt = bufToBigInt;\nmodule.exports.createCounter = createCounter;\nmodule.exports.createFingerprint = createFingerprint;\nmodule.exports.isCuid = isCuid;\n","const { createId, init, getConstants, isCuid } = require(\"./src/index\");\n\nmodule.exports.createId = createId;\nmodule.exports.init = init;\nmodule.exports.getConstants = getConstants;\nmodule.exports.isCuid = isCuid;\n","import { USER_ID_KEY } from '@/constants'\r\nimport { createId } from '@paralleldrive/cuid2'\r\n\r\n/**\r\n * Generates a unique ID for the user.\r\n * If a user ID is already stored in the local storage, it returns that ID.\r\n * Otherwise, it generates a new ID, stores it in the local storage, and returns it.\r\n * @returns The generated or stored user ID.\r\n */\r\nexport const genId = () => {\r\n const generatedId = createId()\r\n\r\n const userIdFromLocalStorage = localStorage.getItem(USER_ID_KEY)\r\n\r\n if (!userIdFromLocalStorage) {\r\n localStorage.setItem(USER_ID_KEY, generatedId)\r\n\r\n return generatedId\r\n }\r\n\r\n return userIdFromLocalStorage\r\n}\r\n\r\n/**\r\n * Generates a unique address based on the provided channelId.\r\n * @param channelId - The ID of the channel.\r\n * @returns The generated address.\r\n */\r\nexport const getAddress = (channelId: string, incomeUserId?: string) => {\r\n const userId = incomeUserId ? incomeUserId : genId()\r\n\r\n return `${channelId}_${userId}`\r\n}\r\n\r\nexport const openInNewTab = (url: string) => {\r\n window.open(url, '_blank')?.focus()\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color code to HSL (Hue, Saturation, Lightness) format.\r\n * @param hex - The hexadecimal color code to convert.\r\n * @returns An object containing the HSL values.\r\n */\r\nexport const hexToHSL = (hex: string) => {\r\n hex = hex.replace(/^#/, '')\r\n\r\n // Convert hex to RGB\r\n const bigint = parseInt(hex, 16)\r\n let r = (bigint >> 16) & 255\r\n let g = (bigint >> 8) & 255\r\n let b = bigint & 255\r\n\r\n // Normalize RGB values\r\n r /= 255\r\n g /= 255\r\n b /= 255\r\n\r\n // Find the maximum and minimum values of R, G, B\r\n const max = Math.max(r, g, b)\r\n const min = Math.min(r, g, b)\r\n let h = 0,\r\n s\r\n const l = (max + min) / 2\r\n\r\n if (max === min) {\r\n h = s = 0 // achromatic\r\n } else {\r\n const d = max - min\r\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min)\r\n switch (max) {\r\n case r:\r\n h = (g - b) / d + (g < b ? 6 : 0)\r\n break\r\n case g:\r\n h = (b - r) / d + 2\r\n break\r\n case b:\r\n h = (r - g) / d + 4\r\n break\r\n }\r\n h /= 6\r\n }\r\n\r\n h *= 360\r\n\r\n return {\r\n h: Math.round(h),\r\n s: Math.round(s * 100),\r\n l: Math.round(l * 100),\r\n }\r\n}\r\n","// src/subscribable.ts\nvar Subscribable = class {\n constructor() {\n this.listeners = /* @__PURE__ */ new Set();\n this.subscribe = this.subscribe.bind(this);\n }\n subscribe(listener) {\n this.listeners.add(listener);\n this.onSubscribe();\n return () => {\n this.listeners.delete(listener);\n this.onUnsubscribe();\n };\n }\n hasListeners() {\n return this.listeners.size > 0;\n }\n onSubscribe() {\n }\n onUnsubscribe() {\n }\n};\nexport {\n Subscribable\n};\n//# sourceMappingURL=subscribable.js.map","// src/utils.ts\nvar isServer = typeof window === \"undefined\" || \"Deno\" in globalThis;\nfunction noop() {\n return void 0;\n}\nfunction functionalUpdate(updater, input) {\n return typeof updater === \"function\" ? updater(input) : updater;\n}\nfunction isValidTimeout(value) {\n return typeof value === \"number\" && value >= 0 && value !== Infinity;\n}\nfunction timeUntilStale(updatedAt, staleTime) {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0);\n}\nfunction matchQuery(filters, query) {\n const {\n type = \"all\",\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale\n } = filters;\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false;\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false;\n }\n }\n if (type !== \"all\") {\n const isActive = query.isActive();\n if (type === \"active\" && !isActive) {\n return false;\n }\n if (type === \"inactive\" && isActive) {\n return false;\n }\n }\n if (typeof stale === \"boolean\" && query.isStale() !== stale) {\n return false;\n }\n if (fetchStatus && fetchStatus !== query.state.fetchStatus) {\n return false;\n }\n if (predicate && !predicate(query)) {\n return false;\n }\n return true;\n}\nfunction matchMutation(filters, mutation) {\n const { exact, status, predicate, mutationKey } = filters;\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false;\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false;\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false;\n }\n }\n if (status && mutation.state.status !== status) {\n return false;\n }\n if (predicate && !predicate(mutation)) {\n return false;\n }\n return true;\n}\nfunction hashQueryKeyByOptions(queryKey, options) {\n const hashFn = options?.queryKeyHashFn || hashKey;\n return hashFn(queryKey);\n}\nfunction hashKey(queryKey) {\n return JSON.stringify(\n queryKey,\n (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {\n result[key] = val[key];\n return result;\n }, {}) : val\n );\n}\nfunction partialMatchKey(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (a && b && typeof a === \"object\" && typeof b === \"object\") {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]));\n }\n return false;\n}\nfunction replaceEqualDeep(a, b) {\n if (a === b) {\n return a;\n }\n const array = isPlainArray(a) && isPlainArray(b);\n if (array || isPlainObject(a) && isPlainObject(b)) {\n const aItems = array ? a : Object.keys(a);\n const aSize = aItems.length;\n const bItems = array ? b : Object.keys(b);\n const bSize = bItems.length;\n const copy = array ? [] : {};\n let equalItems = 0;\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i];\n if (!array && a[key] === void 0 && b[key] === void 0 && aItems.includes(key)) {\n copy[key] = void 0;\n equalItems++;\n } else {\n copy[key] = replaceEqualDeep(a[key], b[key]);\n if (copy[key] === a[key] && a[key] !== void 0) {\n equalItems++;\n }\n }\n }\n return aSize === bSize && equalItems === aSize ? a : copy;\n }\n return b;\n}\nfunction shallowEqualObjects(a, b) {\n if (!b || Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false;\n }\n }\n return true;\n}\nfunction isPlainArray(value) {\n return Array.isArray(value) && value.length === Object.keys(value).length;\n}\nfunction isPlainObject(o) {\n if (!hasObjectPrototype(o)) {\n return false;\n }\n const ctor = o.constructor;\n if (ctor === void 0) {\n return true;\n }\n const prot = ctor.prototype;\n if (!hasObjectPrototype(prot)) {\n return false;\n }\n if (!prot.hasOwnProperty(\"isPrototypeOf\")) {\n return false;\n }\n return true;\n}\nfunction hasObjectPrototype(o) {\n return Object.prototype.toString.call(o) === \"[object Object]\";\n}\nfunction sleep(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}\nfunction replaceData(prevData, data, options) {\n if (typeof options.structuralSharing === \"function\") {\n return options.structuralSharing(prevData, data);\n } else if (options.structuralSharing !== false) {\n return replaceEqualDeep(prevData, data);\n }\n return data;\n}\nfunction keepPreviousData(previousData) {\n return previousData;\n}\nfunction addToEnd(items, item, max = 0) {\n const newItems = [...items, item];\n return max && newItems.length > max ? newItems.slice(1) : newItems;\n}\nfunction addToStart(items, item, max = 0) {\n const newItems = [item, ...items];\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems;\n}\nvar skipToken = Symbol();\nexport {\n addToEnd,\n addToStart,\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n isPlainArray,\n isPlainObject,\n isServer,\n isValidTimeout,\n keepPreviousData,\n matchMutation,\n matchQuery,\n noop,\n partialMatchKey,\n replaceData,\n replaceEqualDeep,\n shallowEqualObjects,\n skipToken,\n sleep,\n timeUntilStale\n};\n//# sourceMappingURL=utils.js.map","// src/focusManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar FocusManager = class extends Subscribable {\n #focused;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onFocus) => {\n if (!isServer && window.addEventListener) {\n const listener = () => onFocus();\n window.addEventListener(\"visibilitychange\", listener, false);\n return () => {\n window.removeEventListener(\"visibilitychange\", listener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup((focused) => {\n if (typeof focused === \"boolean\") {\n this.setFocused(focused);\n } else {\n this.onFocus();\n }\n });\n }\n setFocused(focused) {\n const changed = this.#focused !== focused;\n if (changed) {\n this.#focused = focused;\n this.onFocus();\n }\n }\n onFocus() {\n const isFocused = this.isFocused();\n this.listeners.forEach((listener) => {\n listener(isFocused);\n });\n }\n isFocused() {\n if (typeof this.#focused === \"boolean\") {\n return this.#focused;\n }\n return globalThis.document?.visibilityState !== \"hidden\";\n }\n};\nvar focusManager = new FocusManager();\nexport {\n FocusManager,\n focusManager\n};\n//# sourceMappingURL=focusManager.js.map","// src/onlineManager.ts\nimport { Subscribable } from \"./subscribable.js\";\nimport { isServer } from \"./utils.js\";\nvar OnlineManager = class extends Subscribable {\n #online = true;\n #cleanup;\n #setup;\n constructor() {\n super();\n this.#setup = (onOnline) => {\n if (!isServer && window.addEventListener) {\n const onlineListener = () => onOnline(true);\n const offlineListener = () => onOnline(false);\n window.addEventListener(\"online\", onlineListener, false);\n window.addEventListener(\"offline\", offlineListener, false);\n return () => {\n window.removeEventListener(\"online\", onlineListener);\n window.removeEventListener(\"offline\", offlineListener);\n };\n }\n return;\n };\n }\n onSubscribe() {\n if (!this.#cleanup) {\n this.setEventListener(this.#setup);\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.#cleanup?.();\n this.#cleanup = void 0;\n }\n }\n setEventListener(setup) {\n this.#setup = setup;\n this.#cleanup?.();\n this.#cleanup = setup(this.setOnline.bind(this));\n }\n setOnline(online) {\n const changed = this.#online !== online;\n if (changed) {\n this.#online = online;\n this.listeners.forEach((listener) => {\n listener(online);\n });\n }\n }\n isOnline() {\n return this.#online;\n }\n};\nvar onlineManager = new OnlineManager();\nexport {\n OnlineManager,\n onlineManager\n};\n//# sourceMappingURL=onlineManager.js.map","// src/retryer.ts\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { isServer, sleep } from \"./utils.js\";\nfunction defaultRetryDelay(failureCount) {\n return Math.min(1e3 * 2 ** failureCount, 3e4);\n}\nfunction canFetch(networkMode) {\n return (networkMode ?? \"online\") === \"online\" ? onlineManager.isOnline() : true;\n}\nvar CancelledError = class {\n constructor(options) {\n this.revert = options?.revert;\n this.silent = options?.silent;\n }\n};\nfunction isCancelledError(value) {\n return value instanceof CancelledError;\n}\nfunction createRetryer(config) {\n let isRetryCancelled = false;\n let failureCount = 0;\n let isResolved = false;\n let continueFn;\n let promiseResolve;\n let promiseReject;\n const promise = new Promise((outerResolve, outerReject) => {\n promiseResolve = outerResolve;\n promiseReject = outerReject;\n });\n const cancel = (cancelOptions) => {\n if (!isResolved) {\n reject(new CancelledError(cancelOptions));\n config.abort?.();\n }\n };\n const cancelRetry = () => {\n isRetryCancelled = true;\n };\n const continueRetry = () => {\n isRetryCancelled = false;\n };\n const shouldPause = () => !focusManager.isFocused() || config.networkMode !== \"always\" && !onlineManager.isOnline();\n const resolve = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onSuccess?.(value);\n continueFn?.();\n promiseResolve(value);\n }\n };\n const reject = (value) => {\n if (!isResolved) {\n isResolved = true;\n config.onError?.(value);\n continueFn?.();\n promiseReject(value);\n }\n };\n const pause = () => {\n return new Promise((continueResolve) => {\n continueFn = (value) => {\n const canContinue = isResolved || !shouldPause();\n if (canContinue) {\n continueResolve(value);\n }\n return canContinue;\n };\n config.onPause?.();\n }).then(() => {\n continueFn = void 0;\n if (!isResolved) {\n config.onContinue?.();\n }\n });\n };\n const run = () => {\n if (isResolved) {\n return;\n }\n let promiseOrValue;\n try {\n promiseOrValue = config.fn();\n } catch (error) {\n promiseOrValue = Promise.reject(error);\n }\n Promise.resolve(promiseOrValue).then(resolve).catch((error) => {\n if (isResolved) {\n return;\n }\n const retry = config.retry ?? (isServer ? 0 : 3);\n const retryDelay = config.retryDelay ?? defaultRetryDelay;\n const delay = typeof retryDelay === \"function\" ? retryDelay(failureCount, error) : retryDelay;\n const shouldRetry = retry === true || typeof retry === \"number\" && failureCount < retry || typeof retry === \"function\" && retry(failureCount, error);\n if (isRetryCancelled || !shouldRetry) {\n reject(error);\n return;\n }\n failureCount++;\n config.onFail?.(failureCount, error);\n sleep(delay).then(() => {\n if (shouldPause()) {\n return pause();\n }\n return;\n }).then(() => {\n if (isRetryCancelled) {\n reject(error);\n } else {\n run();\n }\n });\n });\n };\n if (canFetch(config.networkMode)) {\n run();\n } else {\n pause().then(run);\n }\n return {\n promise,\n cancel,\n continue: () => {\n const didContinue = continueFn?.();\n return didContinue ? promise : Promise.resolve();\n },\n cancelRetry,\n continueRetry\n };\n}\nexport {\n CancelledError,\n canFetch,\n createRetryer,\n isCancelledError\n};\n//# sourceMappingURL=retryer.js.map","// src/notifyManager.ts\nfunction createNotifyManager() {\n let queue = [];\n let transactions = 0;\n let notifyFn = (callback) => {\n callback();\n };\n let batchNotifyFn = (callback) => {\n callback();\n };\n let scheduleFn = (cb) => setTimeout(cb, 0);\n const setScheduler = (fn) => {\n scheduleFn = fn;\n };\n const batch = (callback) => {\n let result;\n transactions++;\n try {\n result = callback();\n } finally {\n transactions--;\n if (!transactions) {\n flush();\n }\n }\n return result;\n };\n const schedule = (callback) => {\n if (transactions) {\n queue.push(callback);\n } else {\n scheduleFn(() => {\n notifyFn(callback);\n });\n }\n };\n const batchCalls = (callback) => {\n return (...args) => {\n schedule(() => {\n callback(...args);\n });\n };\n };\n const flush = () => {\n const originalQueue = queue;\n queue = [];\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback);\n });\n });\n });\n }\n };\n const setNotifyFunction = (fn) => {\n notifyFn = fn;\n };\n const setBatchNotifyFunction = (fn) => {\n batchNotifyFn = fn;\n };\n return {\n batch,\n batchCalls,\n schedule,\n setNotifyFunction,\n setBatchNotifyFunction,\n setScheduler\n };\n}\nvar notifyManager = createNotifyManager();\nexport {\n createNotifyManager,\n notifyManager\n};\n//# sourceMappingURL=notifyManager.js.map","// src/removable.ts\nimport { isServer, isValidTimeout } from \"./utils.js\";\nvar Removable = class {\n #gcTimeout;\n destroy() {\n this.clearGcTimeout();\n }\n scheduleGc() {\n this.clearGcTimeout();\n if (isValidTimeout(this.gcTime)) {\n this.#gcTimeout = setTimeout(() => {\n this.optionalRemove();\n }, this.gcTime);\n }\n }\n updateGcTime(newGcTime) {\n this.gcTime = Math.max(\n this.gcTime || 0,\n newGcTime ?? (isServer ? Infinity : 5 * 60 * 1e3)\n );\n }\n clearGcTimeout() {\n if (this.#gcTimeout) {\n clearTimeout(this.#gcTimeout);\n this.#gcTimeout = void 0;\n }\n }\n};\nexport {\n Removable\n};\n//# sourceMappingURL=removable.js.map","// src/query.ts\nimport { noop, replaceData, skipToken, timeUntilStale } from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { canFetch, createRetryer, isCancelledError } from \"./retryer.js\";\nimport { Removable } from \"./removable.js\";\nvar Query = class extends Removable {\n #initialState;\n #revertState;\n #cache;\n #retryer;\n #observers;\n #defaultOptions;\n #abortSignalConsumed;\n constructor(config) {\n super();\n this.#abortSignalConsumed = false;\n this.#defaultOptions = config.defaultOptions;\n this.setOptions(config.options);\n this.#observers = [];\n this.#cache = config.cache;\n this.queryKey = config.queryKey;\n this.queryHash = config.queryHash;\n this.#initialState = config.state || getDefaultState(this.options);\n this.state = this.#initialState;\n this.scheduleGc();\n }\n get meta() {\n return this.options.meta;\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n optionalRemove() {\n if (!this.#observers.length && this.state.fetchStatus === \"idle\") {\n this.#cache.remove(this);\n }\n }\n setData(newData, options) {\n const data = replaceData(this.state.data, newData, this.options);\n this.#dispatch({\n data,\n type: \"success\",\n dataUpdatedAt: options?.updatedAt,\n manual: options?.manual\n });\n return data;\n }\n setState(state, setStateOptions) {\n this.#dispatch({ type: \"setState\", state, setStateOptions });\n }\n cancel(options) {\n const promise = this.#retryer?.promise;\n this.#retryer?.cancel(options);\n return promise ? promise.then(noop).catch(noop) : Promise.resolve();\n }\n destroy() {\n super.destroy();\n this.cancel({ silent: true });\n }\n reset() {\n this.destroy();\n this.setState(this.#initialState);\n }\n isActive() {\n return this.#observers.some(\n (observer) => observer.options.enabled !== false\n );\n }\n isDisabled() {\n return this.getObserversCount() > 0 && !this.isActive();\n }\n isStale() {\n if (this.state.isInvalidated) {\n return true;\n }\n if (this.getObserversCount() > 0) {\n return this.#observers.some(\n (observer) => observer.getCurrentResult().isStale\n );\n }\n return this.state.data === void 0;\n }\n isStaleByTime(staleTime = 0) {\n return this.state.isInvalidated || this.state.data === void 0 || !timeUntilStale(this.state.dataUpdatedAt, staleTime);\n }\n onFocus() {\n const observer = this.#observers.find((x) => x.shouldFetchOnWindowFocus());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n onOnline() {\n const observer = this.#observers.find((x) => x.shouldFetchOnReconnect());\n observer?.refetch({ cancelRefetch: false });\n this.#retryer?.continue();\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#cache.notify({ type: \"observerAdded\", query: this, observer });\n }\n }\n removeObserver(observer) {\n if (this.#observers.includes(observer)) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n if (!this.#observers.length) {\n if (this.#retryer) {\n if (this.#abortSignalConsumed) {\n this.#retryer.cancel({ revert: true });\n } else {\n this.#retryer.cancelRetry();\n }\n }\n this.scheduleGc();\n }\n this.#cache.notify({ type: \"observerRemoved\", query: this, observer });\n }\n }\n getObserversCount() {\n return this.#observers.length;\n }\n invalidate() {\n if (!this.state.isInvalidated) {\n this.#dispatch({ type: \"invalidate\" });\n }\n }\n fetch(options, fetchOptions) {\n if (this.state.fetchStatus !== \"idle\") {\n if (this.state.data !== void 0 && fetchOptions?.cancelRefetch) {\n this.cancel({ silent: true });\n } else if (this.#retryer) {\n this.#retryer.continueRetry();\n return this.#retryer.promise;\n }\n }\n if (options) {\n this.setOptions(options);\n }\n if (!this.options.queryFn) {\n const observer = this.#observers.find((x) => x.options.queryFn);\n if (observer) {\n this.setOptions(observer.options);\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (!Array.isArray(this.options.queryKey)) {\n console.error(\n `As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']`\n );\n }\n }\n const abortController = new AbortController();\n const queryFnContext = {\n queryKey: this.queryKey,\n meta: this.meta\n };\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n this.#abortSignalConsumed = true;\n return abortController.signal;\n }\n });\n };\n addSignalProperty(queryFnContext);\n const fetchFn = () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (this.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${this.options.queryHash}'`\n );\n }\n }\n if (!this.options.queryFn || this.options.queryFn === skipToken) {\n return Promise.reject(\n new Error(`Missing queryFn: '${this.options.queryHash}'`)\n );\n }\n this.#abortSignalConsumed = false;\n if (this.options.persister) {\n return this.options.persister(\n this.options.queryFn,\n queryFnContext,\n this\n );\n }\n return this.options.queryFn(\n queryFnContext\n );\n };\n const context = {\n fetchOptions,\n options: this.options,\n queryKey: this.queryKey,\n state: this.state,\n fetchFn\n };\n addSignalProperty(context);\n this.options.behavior?.onFetch(\n context,\n this\n );\n this.#revertState = this.state;\n if (this.state.fetchStatus === \"idle\" || this.state.fetchMeta !== context.fetchOptions?.meta) {\n this.#dispatch({ type: \"fetch\", meta: context.fetchOptions?.meta });\n }\n const onError = (error) => {\n if (!(isCancelledError(error) && error.silent)) {\n this.#dispatch({\n type: \"error\",\n error\n });\n }\n if (!isCancelledError(error)) {\n this.#cache.config.onError?.(\n error,\n this\n );\n this.#cache.config.onSettled?.(\n this.state.data,\n error,\n this\n );\n }\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n };\n this.#retryer = createRetryer({\n fn: context.fetchFn,\n abort: abortController.abort.bind(abortController),\n onSuccess: (data) => {\n if (data === void 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\n `Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`\n );\n }\n onError(new Error(`${this.queryHash} data is undefined`));\n return;\n }\n this.setData(data);\n this.#cache.config.onSuccess?.(data, this);\n this.#cache.config.onSettled?.(\n data,\n this.state.error,\n this\n );\n if (!this.isFetchingOptimistic) {\n this.scheduleGc();\n }\n this.isFetchingOptimistic = false;\n },\n onError,\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: context.options.retry,\n retryDelay: context.options.retryDelay,\n networkMode: context.options.networkMode\n });\n return this.#retryer.promise;\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n fetchFailureCount: action.failureCount,\n fetchFailureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n fetchStatus: \"paused\"\n };\n case \"continue\":\n return {\n ...state,\n fetchStatus: \"fetching\"\n };\n case \"fetch\":\n return {\n ...state,\n ...fetchState(state.data, this.options),\n fetchMeta: action.meta ?? null\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n dataUpdateCount: state.dataUpdateCount + 1,\n dataUpdatedAt: action.dataUpdatedAt ?? Date.now(),\n error: null,\n isInvalidated: false,\n status: \"success\",\n ...!action.manual && {\n fetchStatus: \"idle\",\n fetchFailureCount: 0,\n fetchFailureReason: null\n }\n };\n case \"error\":\n const error = action.error;\n if (isCancelledError(error) && error.revert && this.#revertState) {\n return { ...this.#revertState, fetchStatus: \"idle\" };\n }\n return {\n ...state,\n error,\n errorUpdateCount: state.errorUpdateCount + 1,\n errorUpdatedAt: Date.now(),\n fetchFailureCount: state.fetchFailureCount + 1,\n fetchFailureReason: error,\n fetchStatus: \"idle\",\n status: \"error\"\n };\n case \"invalidate\":\n return {\n ...state,\n isInvalidated: true\n };\n case \"setState\":\n return {\n ...state,\n ...action.state\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onQueryUpdate();\n });\n this.#cache.notify({ query: this, type: \"updated\", action });\n });\n }\n};\nfunction fetchState(data, options) {\n return {\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchStatus: canFetch(options.networkMode) ? \"fetching\" : \"paused\",\n ...data === void 0 && {\n error: null,\n status: \"pending\"\n }\n };\n}\nfunction getDefaultState(options) {\n const data = typeof options.initialData === \"function\" ? options.initialData() : options.initialData;\n const hasData = data !== void 0;\n const initialDataUpdatedAt = hasData ? typeof options.initialDataUpdatedAt === \"function\" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0;\n return {\n data,\n dataUpdateCount: 0,\n dataUpdatedAt: hasData ? initialDataUpdatedAt ?? Date.now() : 0,\n error: null,\n errorUpdateCount: 0,\n errorUpdatedAt: 0,\n fetchFailureCount: 0,\n fetchFailureReason: null,\n fetchMeta: null,\n isInvalidated: false,\n status: hasData ? \"success\" : \"pending\",\n fetchStatus: \"idle\"\n };\n}\nexport {\n Query,\n fetchState\n};\n//# sourceMappingURL=query.js.map","// src/queryCache.ts\nimport { hashQueryKeyByOptions, matchQuery } from \"./utils.js\";\nimport { Query } from \"./query.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar QueryCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#queries = /* @__PURE__ */ new Map();\n }\n #queries;\n build(client, options, state) {\n const queryKey = options.queryKey;\n const queryHash = options.queryHash ?? hashQueryKeyByOptions(queryKey, options);\n let query = this.get(queryHash);\n if (!query) {\n query = new Query({\n cache: this,\n queryKey,\n queryHash,\n options: client.defaultQueryOptions(options),\n state,\n defaultOptions: client.getQueryDefaults(queryKey)\n });\n this.add(query);\n }\n return query;\n }\n add(query) {\n if (!this.#queries.has(query.queryHash)) {\n this.#queries.set(query.queryHash, query);\n this.notify({\n type: \"added\",\n query\n });\n }\n }\n remove(query) {\n const queryInMap = this.#queries.get(query.queryHash);\n if (queryInMap) {\n query.destroy();\n if (queryInMap === query) {\n this.#queries.delete(query.queryHash);\n }\n this.notify({ type: \"removed\", query });\n }\n }\n clear() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n this.remove(query);\n });\n });\n }\n get(queryHash) {\n return this.#queries.get(queryHash);\n }\n getAll() {\n return [...this.#queries.values()];\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.getAll().find(\n (query) => matchQuery(defaultedFilters, query)\n );\n }\n findAll(filters = {}) {\n const queries = this.getAll();\n return Object.keys(filters).length > 0 ? queries.filter((query) => matchQuery(filters, query)) : queries;\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n onFocus() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onFocus();\n });\n });\n }\n onOnline() {\n notifyManager.batch(() => {\n this.getAll().forEach((query) => {\n query.onOnline();\n });\n });\n }\n};\nexport {\n QueryCache\n};\n//# sourceMappingURL=queryCache.js.map","// src/mutation.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Removable } from \"./removable.js\";\nimport { canFetch, createRetryer } from \"./retryer.js\";\nvar Mutation = class extends Removable {\n #observers;\n #defaultOptions;\n #mutationCache;\n #retryer;\n constructor(config) {\n super();\n this.mutationId = config.mutationId;\n this.#defaultOptions = config.defaultOptions;\n this.#mutationCache = config.mutationCache;\n this.#observers = [];\n this.state = config.state || getDefaultState();\n this.setOptions(config.options);\n this.scheduleGc();\n }\n setOptions(options) {\n this.options = { ...this.#defaultOptions, ...options };\n this.updateGcTime(this.options.gcTime);\n }\n get meta() {\n return this.options.meta;\n }\n addObserver(observer) {\n if (!this.#observers.includes(observer)) {\n this.#observers.push(observer);\n this.clearGcTimeout();\n this.#mutationCache.notify({\n type: \"observerAdded\",\n mutation: this,\n observer\n });\n }\n }\n removeObserver(observer) {\n this.#observers = this.#observers.filter((x) => x !== observer);\n this.scheduleGc();\n this.#mutationCache.notify({\n type: \"observerRemoved\",\n mutation: this,\n observer\n });\n }\n optionalRemove() {\n if (!this.#observers.length) {\n if (this.state.status === \"pending\") {\n this.scheduleGc();\n } else {\n this.#mutationCache.remove(this);\n }\n }\n }\n continue() {\n return this.#retryer?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before\n this.execute(this.state.variables);\n }\n async execute(variables) {\n const executeMutation = () => {\n this.#retryer = createRetryer({\n fn: () => {\n if (!this.options.mutationFn) {\n return Promise.reject(new Error(\"No mutationFn found\"));\n }\n return this.options.mutationFn(variables);\n },\n onFail: (failureCount, error) => {\n this.#dispatch({ type: \"failed\", failureCount, error });\n },\n onPause: () => {\n this.#dispatch({ type: \"pause\" });\n },\n onContinue: () => {\n this.#dispatch({ type: \"continue\" });\n },\n retry: this.options.retry ?? 0,\n retryDelay: this.options.retryDelay,\n networkMode: this.options.networkMode\n });\n return this.#retryer.promise;\n };\n const restored = this.state.status === \"pending\";\n try {\n if (!restored) {\n this.#dispatch({ type: \"pending\", variables });\n await this.#mutationCache.config.onMutate?.(\n variables,\n this\n );\n const context = await this.options.onMutate?.(variables);\n if (context !== this.state.context) {\n this.#dispatch({\n type: \"pending\",\n context,\n variables\n });\n }\n }\n const data = await executeMutation();\n await this.#mutationCache.config.onSuccess?.(\n data,\n variables,\n this.state.context,\n this\n );\n await this.options.onSuccess?.(data, variables, this.state.context);\n await this.#mutationCache.config.onSettled?.(\n data,\n null,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(data, null, variables, this.state.context);\n this.#dispatch({ type: \"success\", data });\n return data;\n } catch (error) {\n try {\n await this.#mutationCache.config.onError?.(\n error,\n variables,\n this.state.context,\n this\n );\n await this.options.onError?.(\n error,\n variables,\n this.state.context\n );\n await this.#mutationCache.config.onSettled?.(\n void 0,\n error,\n this.state.variables,\n this.state.context,\n this\n );\n await this.options.onSettled?.(\n void 0,\n error,\n variables,\n this.state.context\n );\n throw error;\n } finally {\n this.#dispatch({ type: \"error\", error });\n }\n }\n }\n #dispatch(action) {\n const reducer = (state) => {\n switch (action.type) {\n case \"failed\":\n return {\n ...state,\n failureCount: action.failureCount,\n failureReason: action.error\n };\n case \"pause\":\n return {\n ...state,\n isPaused: true\n };\n case \"continue\":\n return {\n ...state,\n isPaused: false\n };\n case \"pending\":\n return {\n ...state,\n context: action.context,\n data: void 0,\n failureCount: 0,\n failureReason: null,\n error: null,\n isPaused: !canFetch(this.options.networkMode),\n status: \"pending\",\n variables: action.variables,\n submittedAt: Date.now()\n };\n case \"success\":\n return {\n ...state,\n data: action.data,\n failureCount: 0,\n failureReason: null,\n error: null,\n status: \"success\",\n isPaused: false\n };\n case \"error\":\n return {\n ...state,\n data: void 0,\n error: action.error,\n failureCount: state.failureCount + 1,\n failureReason: action.error,\n isPaused: false,\n status: \"error\"\n };\n }\n };\n this.state = reducer(this.state);\n notifyManager.batch(() => {\n this.#observers.forEach((observer) => {\n observer.onMutationUpdate(action);\n });\n this.#mutationCache.notify({\n mutation: this,\n type: \"updated\",\n action\n });\n });\n }\n};\nfunction getDefaultState() {\n return {\n context: void 0,\n data: void 0,\n error: null,\n failureCount: 0,\n failureReason: null,\n isPaused: false,\n status: \"idle\",\n variables: void 0,\n submittedAt: 0\n };\n}\nexport {\n Mutation,\n getDefaultState\n};\n//# sourceMappingURL=mutation.js.map","// src/mutationCache.ts\nimport { notifyManager } from \"./notifyManager.js\";\nimport { Mutation } from \"./mutation.js\";\nimport { matchMutation, noop } from \"./utils.js\";\nimport { Subscribable } from \"./subscribable.js\";\nvar MutationCache = class extends Subscribable {\n constructor(config = {}) {\n super();\n this.config = config;\n this.#mutations = [];\n this.#mutationId = 0;\n }\n #mutations;\n #mutationId;\n #resuming;\n build(client, options, state) {\n const mutation = new Mutation({\n mutationCache: this,\n mutationId: ++this.#mutationId,\n options: client.defaultMutationOptions(options),\n state\n });\n this.add(mutation);\n return mutation;\n }\n add(mutation) {\n this.#mutations.push(mutation);\n this.notify({ type: \"added\", mutation });\n }\n remove(mutation) {\n this.#mutations = this.#mutations.filter((x) => x !== mutation);\n this.notify({ type: \"removed\", mutation });\n }\n clear() {\n notifyManager.batch(() => {\n this.#mutations.forEach((mutation) => {\n this.remove(mutation);\n });\n });\n }\n getAll() {\n return this.#mutations;\n }\n find(filters) {\n const defaultedFilters = { exact: true, ...filters };\n return this.#mutations.find(\n (mutation) => matchMutation(defaultedFilters, mutation)\n );\n }\n findAll(filters = {}) {\n return this.#mutations.filter(\n (mutation) => matchMutation(filters, mutation)\n );\n }\n notify(event) {\n notifyManager.batch(() => {\n this.listeners.forEach((listener) => {\n listener(event);\n });\n });\n }\n resumePausedMutations() {\n this.#resuming = (this.#resuming ?? Promise.resolve()).then(() => {\n const pausedMutations = this.#mutations.filter((x) => x.state.isPaused);\n return notifyManager.batch(\n () => pausedMutations.reduce(\n (promise, mutation) => promise.then(() => mutation.continue().catch(noop)),\n Promise.resolve()\n )\n );\n }).then(() => {\n this.#resuming = void 0;\n });\n return this.#resuming;\n }\n};\nexport {\n MutationCache\n};\n//# sourceMappingURL=mutationCache.js.map","// src/infiniteQueryBehavior.ts\nimport { addToEnd, addToStart, skipToken } from \"./utils.js\";\nfunction infiniteQueryBehavior(pages) {\n return {\n onFetch: (context, query) => {\n const fetchFn = async () => {\n const options = context.options;\n const direction = context.fetchOptions?.meta?.fetchMore?.direction;\n const oldPages = context.state.data?.pages || [];\n const oldPageParams = context.state.data?.pageParams || [];\n const empty = { pages: [], pageParams: [] };\n let cancelled = false;\n const addSignalProperty = (object) => {\n Object.defineProperty(object, \"signal\", {\n enumerable: true,\n get: () => {\n if (context.signal.aborted) {\n cancelled = true;\n } else {\n context.signal.addEventListener(\"abort\", () => {\n cancelled = true;\n });\n }\n return context.signal;\n }\n });\n };\n const queryFn = context.options.queryFn && context.options.queryFn !== skipToken ? context.options.queryFn : () => {\n if (process.env.NODE_ENV !== \"production\") {\n if (context.options.queryFn === skipToken) {\n console.error(\n `Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${context.options.queryHash}'`\n );\n }\n }\n return Promise.reject(\n new Error(`Missing queryFn: '${context.options.queryHash}'`)\n );\n };\n const fetchPage = async (data, param, previous) => {\n if (cancelled) {\n return Promise.reject();\n }\n if (param == null && data.pages.length) {\n return Promise.resolve(data);\n }\n const queryFnContext = {\n queryKey: context.queryKey,\n pageParam: param,\n direction: previous ? \"backward\" : \"forward\",\n meta: context.options.meta\n };\n addSignalProperty(queryFnContext);\n const page = await queryFn(\n queryFnContext\n );\n const { maxPages } = context.options;\n const addTo = previous ? addToStart : addToEnd;\n return {\n pages: addTo(data.pages, page, maxPages),\n pageParams: addTo(data.pageParams, param, maxPages)\n };\n };\n let result;\n if (direction && oldPages.length) {\n const previous = direction === \"backward\";\n const pageParamFn = previous ? getPreviousPageParam : getNextPageParam;\n const oldData = {\n pages: oldPages,\n pageParams: oldPageParams\n };\n const param = pageParamFn(options, oldData);\n result = await fetchPage(oldData, param, previous);\n } else {\n result = await fetchPage(\n empty,\n oldPageParams[0] ?? options.initialPageParam\n );\n const remainingPages = pages ?? oldPages.length;\n for (let i = 1; i < remainingPages; i++) {\n const param = getNextPageParam(options, result);\n result = await fetchPage(result, param);\n }\n }\n return result;\n };\n if (context.options.persister) {\n context.fetchFn = () => {\n return context.options.persister?.(\n fetchFn,\n {\n queryKey: context.queryKey,\n meta: context.options.meta,\n signal: context.signal\n },\n query\n );\n };\n } else {\n context.fetchFn = fetchFn;\n }\n }\n };\n}\nfunction getNextPageParam(options, { pages, pageParams }) {\n const lastIndex = pages.length - 1;\n return options.getNextPageParam(\n pages[lastIndex],\n pages,\n pageParams[lastIndex],\n pageParams\n );\n}\nfunction getPreviousPageParam(options, { pages, pageParams }) {\n return options.getPreviousPageParam?.(\n pages[0],\n pages,\n pageParams[0],\n pageParams\n );\n}\nfunction hasNextPage(options, data) {\n if (!data)\n return false;\n return getNextPageParam(options, data) != null;\n}\nfunction hasPreviousPage(options, data) {\n if (!data || !options.getPreviousPageParam)\n return false;\n return getPreviousPageParam(options, data) != null;\n}\nexport {\n hasNextPage,\n hasPreviousPage,\n infiniteQueryBehavior\n};\n//# sourceMappingURL=infiniteQueryBehavior.js.map","// src/queryClient.ts\nimport {\n functionalUpdate,\n hashKey,\n hashQueryKeyByOptions,\n noop,\n partialMatchKey,\n skipToken\n} from \"./utils.js\";\nimport { QueryCache } from \"./queryCache.js\";\nimport { MutationCache } from \"./mutationCache.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { onlineManager } from \"./onlineManager.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { infiniteQueryBehavior } from \"./infiniteQueryBehavior.js\";\nvar QueryClient = class {\n #queryCache;\n #mutationCache;\n #defaultOptions;\n #queryDefaults;\n #mutationDefaults;\n #mountCount;\n #unsubscribeFocus;\n #unsubscribeOnline;\n constructor(config = {}) {\n this.#queryCache = config.queryCache || new QueryCache();\n this.#mutationCache = config.mutationCache || new MutationCache();\n this.#defaultOptions = config.defaultOptions || {};\n this.#queryDefaults = /* @__PURE__ */ new Map();\n this.#mutationDefaults = /* @__PURE__ */ new Map();\n this.#mountCount = 0;\n }\n mount() {\n this.#mountCount++;\n if (this.#mountCount !== 1)\n return;\n this.#unsubscribeFocus = focusManager.subscribe(async (focused) => {\n if (focused) {\n await this.resumePausedMutations();\n this.#queryCache.onFocus();\n }\n });\n this.#unsubscribeOnline = onlineManager.subscribe(async (online) => {\n if (online) {\n await this.resumePausedMutations();\n this.#queryCache.onOnline();\n }\n });\n }\n unmount() {\n this.#mountCount--;\n if (this.#mountCount !== 0)\n return;\n this.#unsubscribeFocus?.();\n this.#unsubscribeFocus = void 0;\n this.#unsubscribeOnline?.();\n this.#unsubscribeOnline = void 0;\n }\n isFetching(filters) {\n return this.#queryCache.findAll({ ...filters, fetchStatus: \"fetching\" }).length;\n }\n isMutating(filters) {\n return this.#mutationCache.findAll({ ...filters, status: \"pending\" }).length;\n }\n getQueryData(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state.data;\n }\n ensureQueryData(options) {\n const cachedData = this.getQueryData(options.queryKey);\n if (cachedData === void 0)\n return this.fetchQuery(options);\n else {\n const defaultedOptions = this.defaultQueryOptions(options);\n const query = this.#queryCache.build(this, defaultedOptions);\n if (options.revalidateIfStale && query.isStaleByTime(defaultedOptions.staleTime)) {\n void this.prefetchQuery(defaultedOptions);\n }\n return Promise.resolve(cachedData);\n }\n }\n getQueriesData(filters) {\n return this.#queryCache.findAll(filters).map(({ queryKey, state }) => {\n const data = state.data;\n return [queryKey, data];\n });\n }\n setQueryData(queryKey, updater, options) {\n const defaultedOptions = this.defaultQueryOptions({ queryKey });\n const query = this.#queryCache.get(\n defaultedOptions.queryHash\n );\n const prevData = query?.state.data;\n const data = functionalUpdate(updater, prevData);\n if (data === void 0) {\n return void 0;\n }\n return this.#queryCache.build(this, defaultedOptions).setData(data, { ...options, manual: true });\n }\n setQueriesData(filters, updater, options) {\n return notifyManager.batch(\n () => this.#queryCache.findAll(filters).map(({ queryKey }) => [\n queryKey,\n this.setQueryData(queryKey, updater, options)\n ])\n );\n }\n getQueryState(queryKey) {\n const options = this.defaultQueryOptions({ queryKey });\n return this.#queryCache.get(options.queryHash)?.state;\n }\n removeQueries(filters) {\n const queryCache = this.#queryCache;\n notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n queryCache.remove(query);\n });\n });\n }\n resetQueries(filters, options) {\n const queryCache = this.#queryCache;\n const refetchFilters = {\n type: \"active\",\n ...filters\n };\n return notifyManager.batch(() => {\n queryCache.findAll(filters).forEach((query) => {\n query.reset();\n });\n return this.refetchQueries(refetchFilters, options);\n });\n }\n cancelQueries(filters = {}, cancelOptions = {}) {\n const defaultedCancelOptions = { revert: true, ...cancelOptions };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).map((query) => query.cancel(defaultedCancelOptions))\n );\n return Promise.all(promises).then(noop).catch(noop);\n }\n invalidateQueries(filters = {}, options = {}) {\n return notifyManager.batch(() => {\n this.#queryCache.findAll(filters).forEach((query) => {\n query.invalidate();\n });\n if (filters.refetchType === \"none\") {\n return Promise.resolve();\n }\n const refetchFilters = {\n ...filters,\n type: filters.refetchType ?? filters.type ?? \"active\"\n };\n return this.refetchQueries(refetchFilters, options);\n });\n }\n refetchQueries(filters = {}, options) {\n const fetchOptions = {\n ...options,\n cancelRefetch: options?.cancelRefetch ?? true\n };\n const promises = notifyManager.batch(\n () => this.#queryCache.findAll(filters).filter((query) => !query.isDisabled()).map((query) => {\n let promise = query.fetch(void 0, fetchOptions);\n if (!fetchOptions.throwOnError) {\n promise = promise.catch(noop);\n }\n return query.state.fetchStatus === \"paused\" ? Promise.resolve() : promise;\n })\n );\n return Promise.all(promises).then(noop);\n }\n fetchQuery(options) {\n const defaultedOptions = this.defaultQueryOptions(options);\n if (defaultedOptions.retry === void 0) {\n defaultedOptions.retry = false;\n }\n const query = this.#queryCache.build(this, defaultedOptions);\n return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data);\n }\n prefetchQuery(options) {\n return this.fetchQuery(options).then(noop).catch(noop);\n }\n fetchInfiniteQuery(options) {\n options.behavior = infiniteQueryBehavior(options.pages);\n return this.fetchQuery(options);\n }\n prefetchInfiniteQuery(options) {\n return this.fetchInfiniteQuery(options).then(noop).catch(noop);\n }\n resumePausedMutations() {\n if (onlineManager.isOnline()) {\n return this.#mutationCache.resumePausedMutations();\n }\n return Promise.resolve();\n }\n getQueryCache() {\n return this.#queryCache;\n }\n getMutationCache() {\n return this.#mutationCache;\n }\n getDefaultOptions() {\n return this.#defaultOptions;\n }\n setDefaultOptions(options) {\n this.#defaultOptions = options;\n }\n setQueryDefaults(queryKey, options) {\n this.#queryDefaults.set(hashKey(queryKey), {\n queryKey,\n defaultOptions: options\n });\n }\n getQueryDefaults(queryKey) {\n const defaults = [...this.#queryDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(queryKey, queryDefault.queryKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n setMutationDefaults(mutationKey, options) {\n this.#mutationDefaults.set(hashKey(mutationKey), {\n mutationKey,\n defaultOptions: options\n });\n }\n getMutationDefaults(mutationKey) {\n const defaults = [...this.#mutationDefaults.values()];\n let result = {};\n defaults.forEach((queryDefault) => {\n if (partialMatchKey(mutationKey, queryDefault.mutationKey)) {\n result = { ...result, ...queryDefault.defaultOptions };\n }\n });\n return result;\n }\n defaultQueryOptions(options) {\n if (options._defaulted) {\n return options;\n }\n const defaultedOptions = {\n ...this.#defaultOptions.queries,\n ...this.getQueryDefaults(options.queryKey),\n ...options,\n _defaulted: true\n };\n if (!defaultedOptions.queryHash) {\n defaultedOptions.queryHash = hashQueryKeyByOptions(\n defaultedOptions.queryKey,\n defaultedOptions\n );\n }\n if (defaultedOptions.refetchOnReconnect === void 0) {\n defaultedOptions.refetchOnReconnect = defaultedOptions.networkMode !== \"always\";\n }\n if (defaultedOptions.throwOnError === void 0) {\n defaultedOptions.throwOnError = !!defaultedOptions.suspense;\n }\n if (!defaultedOptions.networkMode && defaultedOptions.persister) {\n defaultedOptions.networkMode = \"offlineFirst\";\n }\n if (defaultedOptions.enabled !== true && defaultedOptions.queryFn === skipToken) {\n defaultedOptions.enabled = false;\n }\n return defaultedOptions;\n }\n defaultMutationOptions(options) {\n if (options?._defaulted) {\n return options;\n }\n return {\n ...this.#defaultOptions.mutations,\n ...options?.mutationKey && this.getMutationDefaults(options.mutationKey),\n ...options,\n _defaulted: true\n };\n }\n clear() {\n this.#queryCache.clear();\n this.#mutationCache.clear();\n }\n};\nexport {\n QueryClient\n};\n//# sourceMappingURL=queryClient.js.map","// src/queryObserver.ts\nimport {\n isServer,\n isValidTimeout,\n noop,\n replaceData,\n shallowEqualObjects,\n timeUntilStale\n} from \"./utils.js\";\nimport { notifyManager } from \"./notifyManager.js\";\nimport { focusManager } from \"./focusManager.js\";\nimport { Subscribable } from \"./subscribable.js\";\nimport { fetchState } from \"./query.js\";\nvar QueryObserver = class extends Subscribable {\n constructor(client, options) {\n super();\n this.options = options;\n this.#client = client;\n this.#selectError = null;\n this.bindMethods();\n this.setOptions(options);\n }\n #client;\n #currentQuery = void 0;\n #currentQueryInitialState = void 0;\n #currentResult = void 0;\n #currentResultState;\n #currentResultOptions;\n #selectError;\n #selectFn;\n #selectResult;\n // This property keeps track of the last query with defined data.\n // It will be used to pass the previous data and query to the placeholder function between renders.\n #lastQueryWithDefinedData;\n #staleTimeoutId;\n #refetchIntervalId;\n #currentRefetchInterval;\n #trackedProps = /* @__PURE__ */ new Set();\n bindMethods() {\n this.refetch = this.refetch.bind(this);\n }\n onSubscribe() {\n if (this.listeners.size === 1) {\n this.#currentQuery.addObserver(this);\n if (shouldFetchOnMount(this.#currentQuery, this.options)) {\n this.#executeFetch();\n } else {\n this.updateResult();\n }\n this.#updateTimers();\n }\n }\n onUnsubscribe() {\n if (!this.hasListeners()) {\n this.destroy();\n }\n }\n shouldFetchOnReconnect() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnReconnect\n );\n }\n shouldFetchOnWindowFocus() {\n return shouldFetchOn(\n this.#currentQuery,\n this.options,\n this.options.refetchOnWindowFocus\n );\n }\n destroy() {\n this.listeners = /* @__PURE__ */ new Set();\n this.#clearStaleTimeout();\n this.#clearRefetchInterval();\n this.#currentQuery.removeObserver(this);\n }\n setOptions(options, notifyOptions) {\n const prevOptions = this.options;\n const prevQuery = this.#currentQuery;\n this.options = this.#client.defaultQueryOptions(options);\n if (this.options.enabled !== void 0 && typeof this.options.enabled !== \"boolean\") {\n throw new Error(\"Expected enabled to be a boolean\");\n }\n this.#updateQuery();\n this.#currentQuery.setOptions(this.options);\n if (prevOptions._defaulted && !shallowEqualObjects(this.options, prevOptions)) {\n this.#client.getQueryCache().notify({\n type: \"observerOptionsUpdated\",\n query: this.#currentQuery,\n observer: this\n });\n }\n const mounted = this.hasListeners();\n if (mounted && shouldFetchOptionally(\n this.#currentQuery,\n prevQuery,\n this.options,\n prevOptions\n )) {\n this.#executeFetch();\n }\n this.updateResult(notifyOptions);\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) {\n this.#updateStaleTimeout();\n }\n const nextRefetchInterval = this.#computeRefetchInterval();\n if (mounted && (this.#currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.#currentRefetchInterval)) {\n this.#updateRefetchInterval(nextRefetchInterval);\n }\n }\n getOptimisticResult(options) {\n const query = this.#client.getQueryCache().build(this.#client, options);\n const result = this.createResult(query, options);\n if (shouldAssignObserverCurrentProperties(this, result)) {\n this.#currentResult = result;\n this.#currentResultOptions = this.options;\n this.#currentResultState = this.#currentQuery.state;\n }\n return result;\n }\n getCurrentResult() {\n return this.#currentResult;\n }\n trackResult(result, onPropTracked) {\n const trackedResult = {};\n Object.keys(result).forEach((key) => {\n Object.defineProperty(trackedResult, key, {\n configurable: false,\n enumerable: true,\n get: () => {\n this.trackProp(key);\n onPropTracked?.(key);\n return result[key];\n }\n });\n });\n return trackedResult;\n }\n trackProp(key) {\n this.#trackedProps.add(key);\n }\n getCurrentQuery() {\n return this.#currentQuery;\n }\n refetch({ ...options } = {}) {\n return this.fetch({\n ...options\n });\n }\n fetchOptimistic(options) {\n const defaultedOptions = this.#client.defaultQueryOptions(options);\n const query = this.#client.getQueryCache().build(this.#client, defaultedOptions);\n query.isFetchingOptimistic = true;\n return query.fetch().then(() => this.createResult(query, defaultedOptions));\n }\n fetch(fetchOptions) {\n return this.#executeFetch({\n ...fetchOptions,\n cancelRefetch: fetchOptions.cancelRefetch ?? true\n }).then(() => {\n this.updateResult();\n return this.#currentResult;\n });\n }\n #executeFetch(fetchOptions) {\n this.#updateQuery();\n let promise = this.#currentQuery.fetch(\n this.options,\n fetchOptions\n );\n if (!fetchOptions?.throwOnError) {\n promise = promise.catch(noop);\n }\n return promise;\n }\n #updateStaleTimeout() {\n this.#clearStaleTimeout();\n if (isServer || this.#currentResult.isStale || !isValidTimeout(this.options.staleTime)) {\n return;\n }\n const time = timeUntilStale(\n this.#currentResult.dataUpdatedAt,\n this.options.staleTime\n );\n const timeout = time + 1;\n this.#staleTimeoutId = setTimeout(() => {\n if (!this.#currentResult.isStale) {\n this.updateResult();\n }\n }, timeout);\n }\n #computeRefetchInterval() {\n return (typeof this.options.refetchInterval === \"function\" ? this.options.refetchInterval(this.#currentQuery) : this.options.refetchInterval) ?? false;\n }\n #updateRefetchInterval(nextInterval) {\n this.#clearRefetchInterval();\n this.#currentRefetchInterval = nextInterval;\n if (isServer || this.options.enabled === false || !isValidTimeout(this.#currentRefetchInterval) || this.#currentRefetchInterval === 0) {\n return;\n }\n this.#refetchIntervalId = setInterval(() => {\n if (this.options.refetchIntervalInBackground || focusManager.isFocused()) {\n this.#executeFetch();\n }\n }, this.#currentRefetchInterval);\n }\n #updateTimers() {\n this.#updateStaleTimeout();\n this.#updateRefetchInterval(this.#computeRefetchInterval());\n }\n #clearStaleTimeout() {\n if (this.#staleTimeoutId) {\n clearTimeout(this.#staleTimeoutId);\n this.#staleTimeoutId = void 0;\n }\n }\n #clearRefetchInterval() {\n if (this.#refetchIntervalId) {\n clearInterval(this.#refetchIntervalId);\n this.#refetchIntervalId = void 0;\n }\n }\n createResult(query, options) {\n const prevQuery = this.#currentQuery;\n const prevOptions = this.options;\n const prevResult = this.#currentResult;\n const prevResultState = this.#currentResultState;\n const prevResultOptions = this.#currentResultOptions;\n const queryChange = query !== prevQuery;\n const queryInitialState = queryChange ? query.state : this.#currentQueryInitialState;\n const { state } = query;\n let newState = { ...state };\n let isPlaceholderData = false;\n let data;\n if (options._optimisticResults) {\n const mounted = this.hasListeners();\n const fetchOnMount = !mounted && shouldFetchOnMount(query, options);\n const fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions);\n if (fetchOnMount || fetchOptionally) {\n newState = {\n ...newState,\n ...fetchState(state.data, query.options)\n };\n }\n if (options._optimisticResults === \"isRestoring\") {\n newState.fetchStatus = \"idle\";\n }\n }\n let { error, errorUpdatedAt, status } = newState;\n if (options.select && newState.data !== void 0) {\n if (prevResult && newState.data === prevResultState?.data && options.select === this.#selectFn) {\n data = this.#selectResult;\n } else {\n try {\n this.#selectFn = options.select;\n data = options.select(newState.data);\n data = replaceData(prevResult?.data, data, options);\n this.#selectResult = data;\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n } else {\n data = newState.data;\n }\n if (options.placeholderData !== void 0 && data === void 0 && status === \"pending\") {\n let placeholderData;\n if (prevResult?.isPlaceholderData && options.placeholderData === prevResultOptions?.placeholderData) {\n placeholderData = prevResult.data;\n } else {\n placeholderData = typeof options.placeholderData === \"function\" ? options.placeholderData(\n this.#lastQueryWithDefinedData?.state.data,\n this.#lastQueryWithDefinedData\n ) : options.placeholderData;\n if (options.select && placeholderData !== void 0) {\n try {\n placeholderData = options.select(placeholderData);\n this.#selectError = null;\n } catch (selectError) {\n this.#selectError = selectError;\n }\n }\n }\n if (placeholderData !== void 0) {\n status = \"success\";\n data = replaceData(\n prevResult?.data,\n placeholderData,\n options\n );\n isPlaceholderData = true;\n }\n }\n if (this.#selectError) {\n error = this.#selectError;\n data = this.#selectResult;\n errorUpdatedAt = Date.now();\n status = \"error\";\n }\n const isFetching = newState.fetchStatus === \"fetching\";\n const isPending = status === \"pending\";\n const isError = status === \"error\";\n const isLoading = isPending && isFetching;\n const hasData = data !== void 0;\n const result = {\n status,\n fetchStatus: newState.fetchStatus,\n isPending,\n isSuccess: status === \"success\",\n isError,\n isInitialLoading: isLoading,\n isLoading,\n data,\n dataUpdatedAt: newState.dataUpdatedAt,\n error,\n errorUpdatedAt,\n failureCount: newState.fetchFailureCount,\n failureReason: newState.fetchFailureReason,\n errorUpdateCount: newState.errorUpdateCount,\n isFetched: newState.dataUpdateCount > 0 || newState.errorUpdateCount > 0,\n isFetchedAfterMount: newState.dataUpdateCount > queryInitialState.dataUpdateCount || newState.errorUpdateCount > queryInitialState.errorUpdateCount,\n isFetching,\n isRefetching: isFetching && !isPending,\n isLoadingError: isError && !hasData,\n isPaused: newState.fetchStatus === \"paused\",\n isPlaceholderData,\n isRefetchError: isError && hasData,\n isStale: isStale(query, options),\n refetch: this.refetch\n };\n return result;\n }\n updateResult(notifyOptions) {\n const prevResult = this.#currentResult;\n const nextResult = this.createResult(this.#currentQuery, this.options);\n this.#currentResultState = this.#currentQuery.state;\n this.#currentResultOptions = this.options;\n if (this.#currentResultState.data !== void 0) {\n this.#lastQueryWithDefinedData = this.#currentQuery;\n }\n if (shallowEqualObjects(nextResult, prevResult)) {\n return;\n }\n this.#currentResult = nextResult;\n const defaultNotifyOptions = {};\n const shouldNotifyListeners = () => {\n if (!prevResult) {\n return true;\n }\n const { notifyOnChangeProps } = this.options;\n const notifyOnChangePropsValue = typeof notifyOnChangeProps === \"function\" ? notifyOnChangeProps() : notifyOnChangeProps;\n if (notifyOnChangePropsValue === \"all\" || !notifyOnChangePropsValue && !this.#trackedProps.size) {\n return true;\n }\n const includedProps = new Set(\n notifyOnChangePropsValue ?? this.#trackedProps\n );\n if (this.options.throwOnError) {\n includedProps.add(\"error\");\n }\n return Object.keys(this.#currentResult).some((key) => {\n const typedKey = key;\n const changed = this.#currentResult[typedKey] !== prevResult[typedKey];\n return changed && includedProps.has(typedKey);\n });\n };\n if (notifyOptions?.listeners !== false && shouldNotifyListeners()) {\n defaultNotifyOptions.listeners = true;\n }\n this.#notify({ ...defaultNotifyOptions, ...notifyOptions });\n }\n #updateQuery() {\n const query = this.#client.getQueryCache().build(this.#client, this.options);\n if (query === this.#currentQuery) {\n return;\n }\n const prevQuery = this.#currentQuery;\n this.#currentQuery = query;\n this.#currentQueryInitialState = query.state;\n if (this.hasListeners()) {\n prevQuery?.removeObserver(this);\n query.addObserver(this);\n }\n }\n onQueryUpdate() {\n this.updateResult();\n if (this.hasListeners()) {\n this.#updateTimers();\n }\n }\n #notify(notifyOptions) {\n notifyManager.batch(() => {\n if (notifyOptions.listeners) {\n this.listeners.forEach((listener) => {\n listener(this.#currentResult);\n });\n }\n this.#client.getQueryCache().notify({\n query: this.#currentQuery,\n type: \"observerResultsUpdated\"\n });\n });\n }\n};\nfunction shouldLoadOnMount(query, options) {\n return options.enabled !== false && query.state.data === void 0 && !(query.state.status === \"error\" && options.retryOnMount === false);\n}\nfunction shouldFetchOnMount(query, options) {\n return shouldLoadOnMount(query, options) || query.state.data !== void 0 && shouldFetchOn(query, options, options.refetchOnMount);\n}\nfunction shouldFetchOn(query, options, field) {\n if (options.enabled !== false) {\n const value = typeof field === \"function\" ? field(query) : field;\n return value === \"always\" || value !== false && isStale(query, options);\n }\n return false;\n}\nfunction shouldFetchOptionally(query, prevQuery, options, prevOptions) {\n return (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== \"error\") && isStale(query, options);\n}\nfunction isStale(query, options) {\n return options.enabled !== false && query.isStaleByTime(options.staleTime);\n}\nfunction shouldAssignObserverCurrentProperties(observer, optimisticResult) {\n if (!shallowEqualObjects(observer.getCurrentResult(), optimisticResult)) {\n return true;\n }\n return false;\n}\nexport {\n QueryObserver\n};\n//# sourceMappingURL=queryObserver.js.map","\"use client\";\n\n// src/QueryClientProvider.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar QueryClientContext = React.createContext(\n void 0\n);\nvar useQueryClient = (queryClient) => {\n const client = React.useContext(QueryClientContext);\n if (queryClient) {\n return queryClient;\n }\n if (!client) {\n throw new Error(\"No QueryClient set, use QueryClientProvider to set one\");\n }\n return client;\n};\nvar QueryClientProvider = ({\n client,\n children\n}) => {\n React.useEffect(() => {\n client.mount();\n return () => {\n client.unmount();\n };\n }, [client]);\n return /* @__PURE__ */ jsx(QueryClientContext.Provider, { value: client, children });\n};\nexport {\n QueryClientContext,\n QueryClientProvider,\n useQueryClient\n};\n//# sourceMappingURL=QueryClientProvider.js.map","\"use client\";\n\n// src/isRestoring.ts\nimport * as React from \"react\";\nvar IsRestoringContext = React.createContext(false);\nvar useIsRestoring = () => React.useContext(IsRestoringContext);\nvar IsRestoringProvider = IsRestoringContext.Provider;\nexport {\n IsRestoringProvider,\n useIsRestoring\n};\n//# sourceMappingURL=isRestoring.js.map","\"use client\";\n\n// src/QueryErrorResetBoundary.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createValue() {\n let isReset = false;\n return {\n clearReset: () => {\n isReset = false;\n },\n reset: () => {\n isReset = true;\n },\n isReset: () => {\n return isReset;\n }\n };\n}\nvar QueryErrorResetBoundaryContext = React.createContext(createValue());\nvar useQueryErrorResetBoundary = () => React.useContext(QueryErrorResetBoundaryContext);\nvar QueryErrorResetBoundary = ({\n children\n}) => {\n const [value] = React.useState(() => createValue());\n return /* @__PURE__ */ jsx(QueryErrorResetBoundaryContext.Provider, { value, children: typeof children === \"function\" ? children(value) : children });\n};\nexport {\n QueryErrorResetBoundary,\n useQueryErrorResetBoundary\n};\n//# sourceMappingURL=QueryErrorResetBoundary.js.map","// src/utils.ts\nfunction shouldThrowError(throwError, params) {\n if (typeof throwError === \"function\") {\n return throwError(...params);\n }\n return !!throwError;\n}\nfunction noop() {\n}\nexport {\n noop,\n shouldThrowError\n};\n//# sourceMappingURL=utils.js.map","\"use client\";\n\n// src/errorBoundaryUtils.ts\nimport * as React from \"react\";\nimport { shouldThrowError } from \"./utils.js\";\nvar ensurePreventErrorBoundaryRetry = (options, errorResetBoundary) => {\n if (options.suspense || options.throwOnError) {\n if (!errorResetBoundary.isReset()) {\n options.retryOnMount = false;\n }\n }\n};\nvar useClearResetErrorBoundary = (errorResetBoundary) => {\n React.useEffect(() => {\n errorResetBoundary.clearReset();\n }, [errorResetBoundary]);\n};\nvar getHasError = ({\n result,\n errorResetBoundary,\n throwOnError,\n query\n}) => {\n return result.isError && !errorResetBoundary.isReset() && !result.isFetching && query && shouldThrowError(throwOnError, [result.error, query]);\n};\nexport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n};\n//# sourceMappingURL=errorBoundaryUtils.js.map","// src/suspense.ts\nvar defaultThrowOnError = (_error, query) => query.state.data === void 0;\nvar ensureStaleTime = (defaultedOptions) => {\n if (defaultedOptions.suspense) {\n if (typeof defaultedOptions.staleTime !== \"number\") {\n defaultedOptions.staleTime = 1e3;\n }\n }\n};\nvar willFetch = (result, isRestoring) => result.isLoading && result.isFetching && !isRestoring;\nvar shouldSuspend = (defaultedOptions, result) => defaultedOptions?.suspense && result.isPending;\nvar fetchOptimistic = (defaultedOptions, observer, errorResetBoundary) => observer.fetchOptimistic(defaultedOptions).catch(() => {\n errorResetBoundary.clearReset();\n});\nexport {\n defaultThrowOnError,\n ensureStaleTime,\n fetchOptimistic,\n shouldSuspend,\n willFetch\n};\n//# sourceMappingURL=suspense.js.map","\"use client\";\n\n// src/useBaseQuery.ts\nimport * as React from \"react\";\nimport { notifyManager } from \"@tanstack/query-core\";\nimport { useQueryErrorResetBoundary } from \"./QueryErrorResetBoundary.js\";\nimport { useQueryClient } from \"./QueryClientProvider.js\";\nimport { useIsRestoring } from \"./isRestoring.js\";\nimport {\n ensurePreventErrorBoundaryRetry,\n getHasError,\n useClearResetErrorBoundary\n} from \"./errorBoundaryUtils.js\";\nimport { ensureStaleTime, fetchOptimistic, shouldSuspend } from \"./suspense.js\";\nfunction useBaseQuery(options, Observer, queryClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options !== \"object\" || Array.isArray(options)) {\n throw new Error(\n 'Bad argument type. Starting with v5, only the \"Object\" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'\n );\n }\n }\n const client = useQueryClient(queryClient);\n const isRestoring = useIsRestoring();\n const errorResetBoundary = useQueryErrorResetBoundary();\n const defaultedOptions = client.defaultQueryOptions(options);\n defaultedOptions._optimisticResults = isRestoring ? \"isRestoring\" : \"optimistic\";\n ensureStaleTime(defaultedOptions);\n ensurePreventErrorBoundaryRetry(defaultedOptions, errorResetBoundary);\n useClearResetErrorBoundary(errorResetBoundary);\n const [observer] = React.useState(\n () => new Observer(\n client,\n defaultedOptions\n )\n );\n const result = observer.getOptimisticResult(defaultedOptions);\n React.useSyncExternalStore(\n React.useCallback(\n (onStoreChange) => {\n const unsubscribe = isRestoring ? () => void 0 : observer.subscribe(notifyManager.batchCalls(onStoreChange));\n observer.updateResult();\n return unsubscribe;\n },\n [observer, isRestoring]\n ),\n () => observer.getCurrentResult(),\n () => observer.getCurrentResult()\n );\n React.useEffect(() => {\n observer.setOptions(defaultedOptions, { listeners: false });\n }, [defaultedOptions, observer]);\n if (shouldSuspend(defaultedOptions, result)) {\n throw fetchOptimistic(defaultedOptions, observer, errorResetBoundary);\n }\n if (getHasError({\n result,\n errorResetBoundary,\n throwOnError: defaultedOptions.throwOnError,\n query: client.getQueryCache().get(defaultedOptions.queryHash)\n })) {\n throw result.error;\n }\n return !defaultedOptions.notifyOnChangeProps ? observer.trackResult(result) : result;\n}\nexport {\n useBaseQuery\n};\n//# sourceMappingURL=useBaseQuery.js.map","\"use client\";\n\n// src/useQuery.ts\nimport { QueryObserver } from \"@tanstack/query-core\";\nimport { useBaseQuery } from \"./useBaseQuery.js\";\nfunction useQuery(options, queryClient) {\n return useBaseQuery(options, QueryObserver, queryClient);\n}\nexport {\n useQuery\n};\n//# sourceMappingURL=useQuery.js.map","const PACKET_TYPES = Object.create(null); // no Map = no polyfill\nPACKET_TYPES[\"open\"] = \"0\";\nPACKET_TYPES[\"close\"] = \"1\";\nPACKET_TYPES[\"ping\"] = \"2\";\nPACKET_TYPES[\"pong\"] = \"3\";\nPACKET_TYPES[\"message\"] = \"4\";\nPACKET_TYPES[\"upgrade\"] = \"5\";\nPACKET_TYPES[\"noop\"] = \"6\";\nconst PACKET_TYPES_REVERSE = Object.create(null);\nObject.keys(PACKET_TYPES).forEach((key) => {\n PACKET_TYPES_REVERSE[PACKET_TYPES[key]] = key;\n});\nconst ERROR_PACKET = { type: \"error\", data: \"parser error\" };\nexport { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };\n","import { PACKET_TYPES } from \"./commons.js\";\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n Object.prototype.toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\n// ArrayBuffer.isView method is not defined in IE10\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj && obj.buffer instanceof ArrayBuffer;\n};\nconst encodePacket = ({ type, data }, supportsBinary, callback) => {\n if (withNativeBlob && data instanceof Blob) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(data, callback);\n }\n }\n else if (withNativeArrayBuffer &&\n (data instanceof ArrayBuffer || isView(data))) {\n if (supportsBinary) {\n return callback(data);\n }\n else {\n return encodeBlobAsBase64(new Blob([data]), callback);\n }\n }\n // plain string\n return callback(PACKET_TYPES[type] + (data || \"\"));\n};\nconst encodeBlobAsBase64 = (data, callback) => {\n const fileReader = new FileReader();\n fileReader.onload = function () {\n const content = fileReader.result.split(\",\")[1];\n callback(\"b\" + (content || \"\"));\n };\n return fileReader.readAsDataURL(data);\n};\nfunction toArray(data) {\n if (data instanceof Uint8Array) {\n return data;\n }\n else if (data instanceof ArrayBuffer) {\n return new Uint8Array(data);\n }\n else {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n }\n}\nlet TEXT_ENCODER;\nexport function encodePacketToBinary(packet, callback) {\n if (withNativeBlob && packet.data instanceof Blob) {\n return packet.data.arrayBuffer().then(toArray).then(callback);\n }\n else if (withNativeArrayBuffer &&\n (packet.data instanceof ArrayBuffer || isView(packet.data))) {\n return callback(toArray(packet.data));\n }\n encodePacket(packet, false, (encoded) => {\n if (!TEXT_ENCODER) {\n TEXT_ENCODER = new TextEncoder();\n }\n callback(TEXT_ENCODER.encode(encoded));\n });\n}\nexport { encodePacket };\n","// imported from https://github.com/socketio/base64-arraybuffer\nconst chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n// Use a lookup table to find the index.\nconst lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\nfor (let i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n}\nexport const encode = (arraybuffer) => {\n let bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = '';\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + '=';\n }\n else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + '==';\n }\n return base64;\n};\nexport const decode = (base64) => {\n let bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n const arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup[base64.charCodeAt(i)];\n encoded2 = lookup[base64.charCodeAt(i + 1)];\n encoded3 = lookup[base64.charCodeAt(i + 2)];\n encoded4 = lookup[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return arraybuffer;\n};\n","import { ERROR_PACKET, PACKET_TYPES_REVERSE, } from \"./commons.js\";\nimport { decode } from \"./contrib/base64-arraybuffer.js\";\nconst withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nexport const decodePacket = (encodedPacket, binaryType) => {\n if (typeof encodedPacket !== \"string\") {\n return {\n type: \"message\",\n data: mapBinary(encodedPacket, binaryType),\n };\n }\n const type = encodedPacket.charAt(0);\n if (type === \"b\") {\n return {\n type: \"message\",\n data: decodeBase64Packet(encodedPacket.substring(1), binaryType),\n };\n }\n const packetType = PACKET_TYPES_REVERSE[type];\n if (!packetType) {\n return ERROR_PACKET;\n }\n return encodedPacket.length > 1\n ? {\n type: PACKET_TYPES_REVERSE[type],\n data: encodedPacket.substring(1),\n }\n : {\n type: PACKET_TYPES_REVERSE[type],\n };\n};\nconst decodeBase64Packet = (data, binaryType) => {\n if (withNativeArrayBuffer) {\n const decoded = decode(data);\n return mapBinary(decoded, binaryType);\n }\n else {\n return { base64: true, data }; // fallback for old browsers\n }\n};\nconst mapBinary = (data, binaryType) => {\n switch (binaryType) {\n case \"blob\":\n if (data instanceof Blob) {\n // from WebSocket + binaryType \"blob\"\n return data;\n }\n else {\n // from HTTP long-polling or WebTransport\n return new Blob([data]);\n }\n case \"arraybuffer\":\n default:\n if (data instanceof ArrayBuffer) {\n // from HTTP long-polling (base64) or WebSocket + binaryType \"arraybuffer\"\n return data;\n }\n else {\n // from WebTransport (Uint8Array)\n return data.buffer;\n }\n }\n};\n","import { encodePacket, encodePacketToBinary } from \"./encodePacket.js\";\nimport { decodePacket } from \"./decodePacket.js\";\nimport { ERROR_PACKET, } from \"./commons.js\";\nconst SEPARATOR = String.fromCharCode(30); // see https://en.wikipedia.org/wiki/Delimiter#ASCII_delimited_text\nconst encodePayload = (packets, callback) => {\n // some packets may be added to the array while encoding, so the initial length must be saved\n const length = packets.length;\n const encodedPackets = new Array(length);\n let count = 0;\n packets.forEach((packet, i) => {\n // force base64 encoding for binary packets\n encodePacket(packet, false, (encodedPacket) => {\n encodedPackets[i] = encodedPacket;\n if (++count === length) {\n callback(encodedPackets.join(SEPARATOR));\n }\n });\n });\n};\nconst decodePayload = (encodedPayload, binaryType) => {\n const encodedPackets = encodedPayload.split(SEPARATOR);\n const packets = [];\n for (let i = 0; i < encodedPackets.length; i++) {\n const decodedPacket = decodePacket(encodedPackets[i], binaryType);\n packets.push(decodedPacket);\n if (decodedPacket.type === \"error\") {\n break;\n }\n }\n return packets;\n};\nexport function createPacketEncoderStream() {\n // @ts-expect-error\n return new TransformStream({\n transform(packet, controller) {\n encodePacketToBinary(packet, (encodedPacket) => {\n const payloadLength = encodedPacket.length;\n let header;\n // inspired by the WebSocket format: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#decoding_payload_length\n if (payloadLength < 126) {\n header = new Uint8Array(1);\n new DataView(header.buffer).setUint8(0, payloadLength);\n }\n else if (payloadLength < 65536) {\n header = new Uint8Array(3);\n const view = new DataView(header.buffer);\n view.setUint8(0, 126);\n view.setUint16(1, payloadLength);\n }\n else {\n header = new Uint8Array(9);\n const view = new DataView(header.buffer);\n view.setUint8(0, 127);\n view.setBigUint64(1, BigInt(payloadLength));\n }\n // first bit indicates whether the payload is plain text (0) or binary (1)\n if (packet.data && typeof packet.data !== \"string\") {\n header[0] |= 0x80;\n }\n controller.enqueue(header);\n controller.enqueue(encodedPacket);\n });\n },\n });\n}\nlet TEXT_DECODER;\nfunction totalLength(chunks) {\n return chunks.reduce((acc, chunk) => acc + chunk.length, 0);\n}\nfunction concatChunks(chunks, size) {\n if (chunks[0].length === size) {\n return chunks.shift();\n }\n const buffer = new Uint8Array(size);\n let j = 0;\n for (let i = 0; i < size; i++) {\n buffer[i] = chunks[0][j++];\n if (j === chunks[0].length) {\n chunks.shift();\n j = 0;\n }\n }\n if (chunks.length && j < chunks[0].length) {\n chunks[0] = chunks[0].slice(j);\n }\n return buffer;\n}\nexport function createPacketDecoderStream(maxPayload, binaryType) {\n if (!TEXT_DECODER) {\n TEXT_DECODER = new TextDecoder();\n }\n const chunks = [];\n let state = 0 /* READ_HEADER */;\n let expectedLength = -1;\n let isBinary = false;\n // @ts-expect-error\n return new TransformStream({\n transform(chunk, controller) {\n chunks.push(chunk);\n while (true) {\n if (state === 0 /* READ_HEADER */) {\n if (totalLength(chunks) < 1) {\n break;\n }\n const header = concatChunks(chunks, 1);\n isBinary = (header[0] & 0x80) === 0x80;\n expectedLength = header[0] & 0x7f;\n if (expectedLength < 126) {\n state = 3 /* READ_PAYLOAD */;\n }\n else if (expectedLength === 126) {\n state = 1 /* READ_EXTENDED_LENGTH_16 */;\n }\n else {\n state = 2 /* READ_EXTENDED_LENGTH_64 */;\n }\n }\n else if (state === 1 /* READ_EXTENDED_LENGTH_16 */) {\n if (totalLength(chunks) < 2) {\n break;\n }\n const headerArray = concatChunks(chunks, 2);\n expectedLength = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length).getUint16(0);\n state = 3 /* READ_PAYLOAD */;\n }\n else if (state === 2 /* READ_EXTENDED_LENGTH_64 */) {\n if (totalLength(chunks) < 8) {\n break;\n }\n const headerArray = concatChunks(chunks, 8);\n const view = new DataView(headerArray.buffer, headerArray.byteOffset, headerArray.length);\n const n = view.getUint32(0);\n if (n > Math.pow(2, 53 - 32) - 1) {\n // the maximum safe integer in JavaScript is 2^53 - 1\n controller.enqueue(ERROR_PACKET);\n break;\n }\n expectedLength = n * Math.pow(2, 32) + view.getUint32(4);\n state = 3 /* READ_PAYLOAD */;\n }\n else {\n if (totalLength(chunks) < expectedLength) {\n break;\n }\n const data = concatChunks(chunks, expectedLength);\n controller.enqueue(decodePacket(isBinary ? data : TEXT_DECODER.decode(data), binaryType));\n state = 0 /* READ_HEADER */;\n }\n if (expectedLength === 0 || expectedLength > maxPayload) {\n controller.enqueue(ERROR_PACKET);\n break;\n }\n }\n },\n });\n}\nexport const protocol = 4;\nexport { encodePacket, encodePayload, decodePacket, decodePayload, };\n","/**\n * Initialize a new `Emitter`.\n *\n * @api public\n */\n\nexport function Emitter(obj) {\n if (obj) return mixin(obj);\n}\n\n/**\n * Mixin the emitter properties.\n *\n * @param {Object} obj\n * @return {Object}\n * @api private\n */\n\nfunction mixin(obj) {\n for (var key in Emitter.prototype) {\n obj[key] = Emitter.prototype[key];\n }\n return obj;\n}\n\n/**\n * Listen on the given `event` with `fn`.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.on =\nEmitter.prototype.addEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n .push(fn);\n return this;\n};\n\n/**\n * Adds an `event` listener that will be invoked a single\n * time then automatically removed.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.once = function(event, fn){\n function on() {\n this.off(event, on);\n fn.apply(this, arguments);\n }\n\n on.fn = fn;\n this.on(event, on);\n return this;\n};\n\n/**\n * Remove the given callback for `event` or all\n * registered callbacks.\n *\n * @param {String} event\n * @param {Function} fn\n * @return {Emitter}\n * @api public\n */\n\nEmitter.prototype.off =\nEmitter.prototype.removeListener =\nEmitter.prototype.removeAllListeners =\nEmitter.prototype.removeEventListener = function(event, fn){\n this._callbacks = this._callbacks || {};\n\n // all\n if (0 == arguments.length) {\n this._callbacks = {};\n return this;\n }\n\n // specific event\n var callbacks = this._callbacks['$' + event];\n if (!callbacks) return this;\n\n // remove all handlers\n if (1 == arguments.length) {\n delete this._callbacks['$' + event];\n return this;\n }\n\n // remove specific handler\n var cb;\n for (var i = 0; i < callbacks.length; i++) {\n cb = callbacks[i];\n if (cb === fn || cb.fn === fn) {\n callbacks.splice(i, 1);\n break;\n }\n }\n\n // Remove event specific arrays for event types that no\n // one is subscribed for to avoid memory leak.\n if (callbacks.length === 0) {\n delete this._callbacks['$' + event];\n }\n\n return this;\n};\n\n/**\n * Emit `event` with the given args.\n *\n * @param {String} event\n * @param {Mixed} ...\n * @return {Emitter}\n */\n\nEmitter.prototype.emit = function(event){\n this._callbacks = this._callbacks || {};\n\n var args = new Array(arguments.length - 1)\n , callbacks = this._callbacks['$' + event];\n\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n\n if (callbacks) {\n callbacks = callbacks.slice(0);\n for (var i = 0, len = callbacks.length; i < len; ++i) {\n callbacks[i].apply(this, args);\n }\n }\n\n return this;\n};\n\n// alias used for reserved events (protected method)\nEmitter.prototype.emitReserved = Emitter.prototype.emit;\n\n/**\n * Return array of callbacks for `event`.\n *\n * @param {String} event\n * @return {Array}\n * @api public\n */\n\nEmitter.prototype.listeners = function(event){\n this._callbacks = this._callbacks || {};\n return this._callbacks['$' + event] || [];\n};\n\n/**\n * Check if this emitter has `event` handlers.\n *\n * @param {String} event\n * @return {Boolean}\n * @api public\n */\n\nEmitter.prototype.hasListeners = function(event){\n return !! this.listeners(event).length;\n};\n","export const globalThisShim = (() => {\n if (typeof self !== \"undefined\") {\n return self;\n }\n else if (typeof window !== \"undefined\") {\n return window;\n }\n else {\n return Function(\"return this\")();\n }\n})();\n","import { globalThisShim as globalThis } from \"./globalThis.js\";\nexport function pick(obj, ...attr) {\n return attr.reduce((acc, k) => {\n if (obj.hasOwnProperty(k)) {\n acc[k] = obj[k];\n }\n return acc;\n }, {});\n}\n// Keep a reference to the real timeout functions so they can be used when overridden\nconst NATIVE_SET_TIMEOUT = globalThis.setTimeout;\nconst NATIVE_CLEAR_TIMEOUT = globalThis.clearTimeout;\nexport function installTimerFunctions(obj, opts) {\n if (opts.useNativeTimers) {\n obj.setTimeoutFn = NATIVE_SET_TIMEOUT.bind(globalThis);\n obj.clearTimeoutFn = NATIVE_CLEAR_TIMEOUT.bind(globalThis);\n }\n else {\n obj.setTimeoutFn = globalThis.setTimeout.bind(globalThis);\n obj.clearTimeoutFn = globalThis.clearTimeout.bind(globalThis);\n }\n}\n// base64 encoded buffers are about 33% bigger (https://en.wikipedia.org/wiki/Base64)\nconst BASE64_OVERHEAD = 1.33;\n// we could also have used `new Blob([obj]).size`, but it isn't supported in IE9\nexport function byteLength(obj) {\n if (typeof obj === \"string\") {\n return utf8Length(obj);\n }\n // arraybuffer or blob\n return Math.ceil((obj.byteLength || obj.size) * BASE64_OVERHEAD);\n}\nfunction utf8Length(str) {\n let c = 0, length = 0;\n for (let i = 0, l = str.length; i < l; i++) {\n c = str.charCodeAt(i);\n if (c < 0x80) {\n length += 1;\n }\n else if (c < 0x800) {\n length += 2;\n }\n else if (c < 0xd800 || c >= 0xe000) {\n length += 3;\n }\n else {\n i++;\n length += 4;\n }\n }\n return length;\n}\n","// imported from https://github.com/galkn/querystring\n/**\n * Compiles a querystring\n * Returns string representation of the object\n *\n * @param {Object}\n * @api private\n */\nexport function encode(obj) {\n let str = '';\n for (let i in obj) {\n if (obj.hasOwnProperty(i)) {\n if (str.length)\n str += '&';\n str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n }\n }\n return str;\n}\n/**\n * Parses a simple querystring into an object\n *\n * @param {String} qs\n * @api private\n */\nexport function decode(qs) {\n let qry = {};\n let pairs = qs.split('&');\n for (let i = 0, l = pairs.length; i < l; i++) {\n let pair = pairs[i].split('=');\n qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n }\n return qry;\n}\n","import { decodePacket } from \"engine.io-parser\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions } from \"./util.js\";\nimport { encode } from \"./contrib/parseqs.js\";\nexport class TransportError extends Error {\n constructor(reason, description, context) {\n super(reason);\n this.description = description;\n this.context = context;\n this.type = \"TransportError\";\n }\n}\nexport class Transport extends Emitter {\n /**\n * Transport abstract constructor.\n *\n * @param {Object} opts - options\n * @protected\n */\n constructor(opts) {\n super();\n this.writable = false;\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.query = opts.query;\n this.socket = opts.socket;\n }\n /**\n * Emits an error.\n *\n * @param {String} reason\n * @param description\n * @param context - the error context\n * @return {Transport} for chaining\n * @protected\n */\n onError(reason, description, context) {\n super.emitReserved(\"error\", new TransportError(reason, description, context));\n return this;\n }\n /**\n * Opens the transport.\n */\n open() {\n this.readyState = \"opening\";\n this.doOpen();\n return this;\n }\n /**\n * Closes the transport.\n */\n close() {\n if (this.readyState === \"opening\" || this.readyState === \"open\") {\n this.doClose();\n this.onClose();\n }\n return this;\n }\n /**\n * Sends multiple packets.\n *\n * @param {Array} packets\n */\n send(packets) {\n if (this.readyState === \"open\") {\n this.write(packets);\n }\n else {\n // this might happen if the transport was silently closed in the beforeunload event handler\n }\n }\n /**\n * Called upon open\n *\n * @protected\n */\n onOpen() {\n this.readyState = \"open\";\n this.writable = true;\n super.emitReserved(\"open\");\n }\n /**\n * Called with data.\n *\n * @param {String} data\n * @protected\n */\n onData(data) {\n const packet = decodePacket(data, this.socket.binaryType);\n this.onPacket(packet);\n }\n /**\n * Called with a decoded packet.\n *\n * @protected\n */\n onPacket(packet) {\n super.emitReserved(\"packet\", packet);\n }\n /**\n * Called upon close.\n *\n * @protected\n */\n onClose(details) {\n this.readyState = \"closed\";\n super.emitReserved(\"close\", details);\n }\n /**\n * Pauses the transport, in order not to lose packets during an upgrade.\n *\n * @param onPause\n */\n pause(onPause) { }\n createUri(schema, query = {}) {\n return (schema +\n \"://\" +\n this._hostname() +\n this._port() +\n this.opts.path +\n this._query(query));\n }\n _hostname() {\n const hostname = this.opts.hostname;\n return hostname.indexOf(\":\") === -1 ? hostname : \"[\" + hostname + \"]\";\n }\n _port() {\n if (this.opts.port &&\n ((this.opts.secure && Number(this.opts.port !== 443)) ||\n (!this.opts.secure && Number(this.opts.port) !== 80))) {\n return \":\" + this.opts.port;\n }\n else {\n return \"\";\n }\n }\n _query(query) {\n const encodedQuery = encode(query);\n return encodedQuery.length ? \"?\" + encodedQuery : \"\";\n }\n}\n","// imported from https://github.com/unshiftio/yeast\n'use strict';\nconst alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''), length = 64, map = {};\nlet seed = 0, i = 0, prev;\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nexport function encode(num) {\n let encoded = '';\n do {\n encoded = alphabet[num % length] + encoded;\n num = Math.floor(num / length);\n } while (num > 0);\n return encoded;\n}\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nexport function decode(str) {\n let decoded = 0;\n for (i = 0; i < str.length; i++) {\n decoded = decoded * length + map[str.charAt(i)];\n }\n return decoded;\n}\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nexport function yeast() {\n const now = encode(+new Date());\n if (now !== prev)\n return seed = 0, prev = now;\n return now + '.' + encode(seed++);\n}\n//\n// Map each character to its index.\n//\nfor (; i < length; i++)\n map[alphabet[i]] = i;\n","// imported from https://github.com/component/has-cors\nlet value = false;\ntry {\n value = typeof XMLHttpRequest !== 'undefined' &&\n 'withCredentials' in new XMLHttpRequest();\n}\ncatch (err) {\n // if XMLHttp support is disabled in IE then it will throw\n // when trying to create\n}\nexport const hasCORS = value;\n","// browser shim for xmlhttprequest module\nimport { hasCORS } from \"../contrib/has-cors.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nexport function XHR(opts) {\n const xdomain = opts.xdomain;\n // XMLHttpRequest can be disabled on IE\n try {\n if (\"undefined\" !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n return new XMLHttpRequest();\n }\n }\n catch (e) { }\n if (!xdomain) {\n try {\n return new globalThis[[\"Active\"].concat(\"Object\").join(\"X\")](\"Microsoft.XMLHTTP\");\n }\n catch (e) { }\n }\n}\nexport function createCookieJar() { }\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { encodePayload, decodePayload } from \"engine.io-parser\";\nimport { createCookieJar, XHR as XMLHttpRequest, } from \"./xmlhttprequest.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { installTimerFunctions, pick } from \"../util.js\";\nimport { globalThisShim as globalThis } from \"../globalThis.js\";\nfunction empty() { }\nconst hasXHR2 = (function () {\n const xhr = new XMLHttpRequest({\n xdomain: false,\n });\n return null != xhr.responseType;\n})();\nexport class Polling extends Transport {\n /**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @package\n */\n constructor(opts) {\n super(opts);\n this.polling = false;\n if (typeof location !== \"undefined\") {\n const isSSL = \"https:\" === location.protocol;\n let port = location.port;\n // some user agents have empty `location.port`\n if (!port) {\n port = isSSL ? \"443\" : \"80\";\n }\n this.xd =\n (typeof location !== \"undefined\" &&\n opts.hostname !== location.hostname) ||\n port !== opts.port;\n }\n /**\n * XHR supports binary\n */\n const forceBase64 = opts && opts.forceBase64;\n this.supportsBinary = hasXHR2 && !forceBase64;\n if (this.opts.withCredentials) {\n this.cookieJar = createCookieJar();\n }\n }\n get name() {\n return \"polling\";\n }\n /**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @protected\n */\n doOpen() {\n this.poll();\n }\n /**\n * Pauses polling.\n *\n * @param {Function} onPause - callback upon buffers are flushed and transport is paused\n * @package\n */\n pause(onPause) {\n this.readyState = \"pausing\";\n const pause = () => {\n this.readyState = \"paused\";\n onPause();\n };\n if (this.polling || !this.writable) {\n let total = 0;\n if (this.polling) {\n total++;\n this.once(\"pollComplete\", function () {\n --total || pause();\n });\n }\n if (!this.writable) {\n total++;\n this.once(\"drain\", function () {\n --total || pause();\n });\n }\n }\n else {\n pause();\n }\n }\n /**\n * Starts polling cycle.\n *\n * @private\n */\n poll() {\n this.polling = true;\n this.doPoll();\n this.emitReserved(\"poll\");\n }\n /**\n * Overloads onData to detect payloads.\n *\n * @protected\n */\n onData(data) {\n const callback = (packet) => {\n // if its the first message we consider the transport open\n if (\"opening\" === this.readyState && packet.type === \"open\") {\n this.onOpen();\n }\n // if its a close packet, we close the ongoing requests\n if (\"close\" === packet.type) {\n this.onClose({ description: \"transport closed by the server\" });\n return false;\n }\n // otherwise bypass onData and handle the message\n this.onPacket(packet);\n };\n // decode payload\n decodePayload(data, this.socket.binaryType).forEach(callback);\n // if an event did not trigger closing\n if (\"closed\" !== this.readyState) {\n // if we got data we're not polling\n this.polling = false;\n this.emitReserved(\"pollComplete\");\n if (\"open\" === this.readyState) {\n this.poll();\n }\n else {\n }\n }\n }\n /**\n * For polling, send a close packet.\n *\n * @protected\n */\n doClose() {\n const close = () => {\n this.write([{ type: \"close\" }]);\n };\n if (\"open\" === this.readyState) {\n close();\n }\n else {\n // in case we're trying to close while\n // handshaking is in progress (GH-164)\n this.once(\"open\", close);\n }\n }\n /**\n * Writes a packets payload.\n *\n * @param {Array} packets - data packets\n * @protected\n */\n write(packets) {\n this.writable = false;\n encodePayload(packets, (data) => {\n this.doWrite(data, () => {\n this.writable = true;\n this.emitReserved(\"drain\");\n });\n });\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"https\" : \"http\";\n const query = this.query || {};\n // cache busting is forced\n if (false !== this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n if (!this.supportsBinary && !query.sid) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Creates a request.\n *\n * @param {String} method\n * @private\n */\n request(opts = {}) {\n Object.assign(opts, { xd: this.xd, cookieJar: this.cookieJar }, this.opts);\n return new Request(this.uri(), opts);\n }\n /**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @private\n */\n doWrite(data, fn) {\n const req = this.request({\n method: \"POST\",\n data: data,\n });\n req.on(\"success\", fn);\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr post error\", xhrStatus, context);\n });\n }\n /**\n * Starts a poll cycle.\n *\n * @private\n */\n doPoll() {\n const req = this.request();\n req.on(\"data\", this.onData.bind(this));\n req.on(\"error\", (xhrStatus, context) => {\n this.onError(\"xhr poll error\", xhrStatus, context);\n });\n this.pollXhr = req;\n }\n}\nexport class Request extends Emitter {\n /**\n * Request constructor\n *\n * @param {Object} options\n * @package\n */\n constructor(uri, opts) {\n super();\n installTimerFunctions(this, opts);\n this.opts = opts;\n this.method = opts.method || \"GET\";\n this.uri = uri;\n this.data = undefined !== opts.data ? opts.data : null;\n this.create();\n }\n /**\n * Creates the XHR object and sends the request.\n *\n * @private\n */\n create() {\n var _a;\n const opts = pick(this.opts, \"agent\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"autoUnref\");\n opts.xdomain = !!this.opts.xd;\n const xhr = (this.xhr = new XMLHttpRequest(opts));\n try {\n xhr.open(this.method, this.uri, true);\n try {\n if (this.opts.extraHeaders) {\n xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n for (let i in this.opts.extraHeaders) {\n if (this.opts.extraHeaders.hasOwnProperty(i)) {\n xhr.setRequestHeader(i, this.opts.extraHeaders[i]);\n }\n }\n }\n }\n catch (e) { }\n if (\"POST\" === this.method) {\n try {\n xhr.setRequestHeader(\"Content-type\", \"text/plain;charset=UTF-8\");\n }\n catch (e) { }\n }\n try {\n xhr.setRequestHeader(\"Accept\", \"*/*\");\n }\n catch (e) { }\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);\n // ie6 check\n if (\"withCredentials\" in xhr) {\n xhr.withCredentials = this.opts.withCredentials;\n }\n if (this.opts.requestTimeout) {\n xhr.timeout = this.opts.requestTimeout;\n }\n xhr.onreadystatechange = () => {\n var _a;\n if (xhr.readyState === 3) {\n (_a = this.opts.cookieJar) === null || _a === void 0 ? void 0 : _a.parseCookies(xhr);\n }\n if (4 !== xhr.readyState)\n return;\n if (200 === xhr.status || 1223 === xhr.status) {\n this.onLoad();\n }\n else {\n // make sure the `error` event handler that's user-set\n // does not throw in the same tick and gets caught here\n this.setTimeoutFn(() => {\n this.onError(typeof xhr.status === \"number\" ? xhr.status : 0);\n }, 0);\n }\n };\n xhr.send(this.data);\n }\n catch (e) {\n // Need to defer since .create() is called directly from the constructor\n // and thus the 'error' event can only be only bound *after* this exception\n // occurs. Therefore, also, we cannot throw here at all.\n this.setTimeoutFn(() => {\n this.onError(e);\n }, 0);\n return;\n }\n if (typeof document !== \"undefined\") {\n this.index = Request.requestsCount++;\n Request.requests[this.index] = this;\n }\n }\n /**\n * Called upon error.\n *\n * @private\n */\n onError(err) {\n this.emitReserved(\"error\", err, this.xhr);\n this.cleanup(true);\n }\n /**\n * Cleans up house.\n *\n * @private\n */\n cleanup(fromError) {\n if (\"undefined\" === typeof this.xhr || null === this.xhr) {\n return;\n }\n this.xhr.onreadystatechange = empty;\n if (fromError) {\n try {\n this.xhr.abort();\n }\n catch (e) { }\n }\n if (typeof document !== \"undefined\") {\n delete Request.requests[this.index];\n }\n this.xhr = null;\n }\n /**\n * Called upon load.\n *\n * @private\n */\n onLoad() {\n const data = this.xhr.responseText;\n if (data !== null) {\n this.emitReserved(\"data\", data);\n this.emitReserved(\"success\");\n this.cleanup();\n }\n }\n /**\n * Aborts the request.\n *\n * @package\n */\n abort() {\n this.cleanup();\n }\n}\nRequest.requestsCount = 0;\nRequest.requests = {};\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\nif (typeof document !== \"undefined\") {\n // @ts-ignore\n if (typeof attachEvent === \"function\") {\n // @ts-ignore\n attachEvent(\"onunload\", unloadHandler);\n }\n else if (typeof addEventListener === \"function\") {\n const terminationEvent = \"onpagehide\" in globalThis ? \"pagehide\" : \"unload\";\n addEventListener(terminationEvent, unloadHandler, false);\n }\n}\nfunction unloadHandler() {\n for (let i in Request.requests) {\n if (Request.requests.hasOwnProperty(i)) {\n Request.requests[i].abort();\n }\n }\n}\n","import { globalThisShim as globalThis } from \"../globalThis.js\";\nexport const nextTick = (() => {\n const isPromiseAvailable = typeof Promise === \"function\" && typeof Promise.resolve === \"function\";\n if (isPromiseAvailable) {\n return (cb) => Promise.resolve().then(cb);\n }\n else {\n return (cb, setTimeoutFn) => setTimeoutFn(cb, 0);\n }\n})();\nexport const WebSocket = globalThis.WebSocket || globalThis.MozWebSocket;\nexport const usingBrowserWebSocket = true;\nexport const defaultBinaryType = \"arraybuffer\";\n","import { Transport } from \"../transport.js\";\nimport { yeast } from \"../contrib/yeast.js\";\nimport { pick } from \"../util.js\";\nimport { nextTick, usingBrowserWebSocket, WebSocket, } from \"./websocket-constructor.js\";\nimport { encodePacket } from \"engine.io-parser\";\n// detect ReactNative environment\nconst isReactNative = typeof navigator !== \"undefined\" &&\n typeof navigator.product === \"string\" &&\n navigator.product.toLowerCase() === \"reactnative\";\nexport class WS extends Transport {\n /**\n * WebSocket transport constructor.\n *\n * @param {Object} opts - connection options\n * @protected\n */\n constructor(opts) {\n super(opts);\n this.supportsBinary = !opts.forceBase64;\n }\n get name() {\n return \"websocket\";\n }\n doOpen() {\n if (!this.check()) {\n // let probe timeout\n return;\n }\n const uri = this.uri();\n const protocols = this.opts.protocols;\n // React Native only supports the 'headers' option, and will print a warning if anything else is passed\n const opts = isReactNative\n ? {}\n : pick(this.opts, \"agent\", \"perMessageDeflate\", \"pfx\", \"key\", \"passphrase\", \"cert\", \"ca\", \"ciphers\", \"rejectUnauthorized\", \"localAddress\", \"protocolVersion\", \"origin\", \"maxPayload\", \"family\", \"checkServerIdentity\");\n if (this.opts.extraHeaders) {\n opts.headers = this.opts.extraHeaders;\n }\n try {\n this.ws =\n usingBrowserWebSocket && !isReactNative\n ? protocols\n ? new WebSocket(uri, protocols)\n : new WebSocket(uri)\n : new WebSocket(uri, protocols, opts);\n }\n catch (err) {\n return this.emitReserved(\"error\", err);\n }\n this.ws.binaryType = this.socket.binaryType;\n this.addEventListeners();\n }\n /**\n * Adds event listeners to the socket\n *\n * @private\n */\n addEventListeners() {\n this.ws.onopen = () => {\n if (this.opts.autoUnref) {\n this.ws._socket.unref();\n }\n this.onOpen();\n };\n this.ws.onclose = (closeEvent) => this.onClose({\n description: \"websocket connection closed\",\n context: closeEvent,\n });\n this.ws.onmessage = (ev) => this.onData(ev.data);\n this.ws.onerror = (e) => this.onError(\"websocket error\", e);\n }\n write(packets) {\n this.writable = false;\n // encodePacket efficient as it uses WS framing\n // no need for encodePayload\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n encodePacket(packet, this.supportsBinary, (data) => {\n // always create a new object (GH-437)\n const opts = {};\n if (!usingBrowserWebSocket) {\n if (packet.options) {\n opts.compress = packet.options.compress;\n }\n if (this.opts.perMessageDeflate) {\n const len = \n // @ts-ignore\n \"string\" === typeof data ? Buffer.byteLength(data) : data.length;\n if (len < this.opts.perMessageDeflate.threshold) {\n opts.compress = false;\n }\n }\n }\n // Sometimes the websocket has already been closed but the browser didn't\n // have a chance of informing us about it yet, in that case send will\n // throw an error\n try {\n if (usingBrowserWebSocket) {\n // TypeError is thrown when passing the second argument on Safari\n this.ws.send(data);\n }\n else {\n this.ws.send(data, opts);\n }\n }\n catch (e) {\n }\n if (lastPacket) {\n // fake drain\n // defer to next tick to allow Socket to clear writeBuffer\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n if (typeof this.ws !== \"undefined\") {\n this.ws.close();\n this.ws = null;\n }\n }\n /**\n * Generates uri for connection.\n *\n * @private\n */\n uri() {\n const schema = this.opts.secure ? \"wss\" : \"ws\";\n const query = this.query || {};\n // append timestamp to URI\n if (this.opts.timestampRequests) {\n query[this.opts.timestampParam] = yeast();\n }\n // communicate binary support capabilities\n if (!this.supportsBinary) {\n query.b64 = 1;\n }\n return this.createUri(schema, query);\n }\n /**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @private\n */\n check() {\n return !!WebSocket;\n }\n}\n","import { Transport } from \"../transport.js\";\nimport { nextTick } from \"./websocket-constructor.js\";\nimport { createPacketDecoderStream, createPacketEncoderStream, } from \"engine.io-parser\";\nexport class WT extends Transport {\n get name() {\n return \"webtransport\";\n }\n doOpen() {\n // @ts-ignore\n if (typeof WebTransport !== \"function\") {\n return;\n }\n // @ts-ignore\n this.transport = new WebTransport(this.createUri(\"https\"), this.opts.transportOptions[this.name]);\n this.transport.closed\n .then(() => {\n this.onClose();\n })\n .catch((err) => {\n this.onError(\"webtransport error\", err);\n });\n // note: we could have used async/await, but that would require some additional polyfills\n this.transport.ready.then(() => {\n this.transport.createBidirectionalStream().then((stream) => {\n const decoderStream = createPacketDecoderStream(Number.MAX_SAFE_INTEGER, this.socket.binaryType);\n const reader = stream.readable.pipeThrough(decoderStream).getReader();\n const encoderStream = createPacketEncoderStream();\n encoderStream.readable.pipeTo(stream.writable);\n this.writer = encoderStream.writable.getWriter();\n const read = () => {\n reader\n .read()\n .then(({ done, value }) => {\n if (done) {\n return;\n }\n this.onPacket(value);\n read();\n })\n .catch((err) => {\n });\n };\n read();\n const packet = { type: \"open\" };\n if (this.query.sid) {\n packet.data = `{\"sid\":\"${this.query.sid}\"}`;\n }\n this.writer.write(packet).then(() => this.onOpen());\n });\n });\n }\n write(packets) {\n this.writable = false;\n for (let i = 0; i < packets.length; i++) {\n const packet = packets[i];\n const lastPacket = i === packets.length - 1;\n this.writer.write(packet).then(() => {\n if (lastPacket) {\n nextTick(() => {\n this.writable = true;\n this.emitReserved(\"drain\");\n }, this.setTimeoutFn);\n }\n });\n }\n }\n doClose() {\n var _a;\n (_a = this.transport) === null || _a === void 0 ? void 0 : _a.close();\n }\n}\n","import { Polling } from \"./polling.js\";\nimport { WS } from \"./websocket.js\";\nimport { WT } from \"./webtransport.js\";\nexport const transports = {\n websocket: WS,\n webtransport: WT,\n polling: Polling,\n};\n","// imported from https://github.com/galkn/parseuri\n/**\n * Parses a URI\n *\n * Note: we could also have used the built-in URL object, but it isn't supported on all platforms.\n *\n * See:\n * - https://developer.mozilla.org/en-US/docs/Web/API/URL\n * - https://caniuse.com/url\n * - https://www.rfc-editor.org/rfc/rfc3986#appendix-B\n *\n * History of the parse() method:\n * - first commit: https://github.com/socketio/socket.io-client/commit/4ee1d5d94b3906a9c052b459f1a818b15f38f91c\n * - export into its own module: https://github.com/socketio/engine.io-client/commit/de2c561e4564efeb78f1bdb1ba39ef81b2822cb3\n * - reimport: https://github.com/socketio/engine.io-client/commit/df32277c3f6d622eec5ed09f493cae3f3391d242\n *\n * @author Steven Levithan (MIT license)\n * @api private\n */\nconst re = /^(?:(?![^:@\\/?#]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@\\/?#]*)(?::([^:@\\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\nconst parts = [\n 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n];\nexport function parse(str) {\n if (str.length > 2000) {\n throw \"URI too long\";\n }\n const src = str, b = str.indexOf('['), e = str.indexOf(']');\n if (b != -1 && e != -1) {\n str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n }\n let m = re.exec(str || ''), uri = {}, i = 14;\n while (i--) {\n uri[parts[i]] = m[i] || '';\n }\n if (b != -1 && e != -1) {\n uri.source = src;\n uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n uri.ipv6uri = true;\n }\n uri.pathNames = pathNames(uri, uri['path']);\n uri.queryKey = queryKey(uri, uri['query']);\n return uri;\n}\nfunction pathNames(obj, path) {\n const regx = /\\/{2,9}/g, names = path.replace(regx, \"/\").split(\"/\");\n if (path.slice(0, 1) == '/' || path.length === 0) {\n names.splice(0, 1);\n }\n if (path.slice(-1) == '/') {\n names.splice(names.length - 1, 1);\n }\n return names;\n}\nfunction queryKey(uri, query) {\n const data = {};\n query.replace(/(?:^|&)([^&=]*)=?([^&]*)/g, function ($0, $1, $2) {\n if ($1) {\n data[$1] = $2;\n }\n });\n return data;\n}\n","import { transports } from \"./transports/index.js\";\nimport { installTimerFunctions, byteLength } from \"./util.js\";\nimport { decode } from \"./contrib/parseqs.js\";\nimport { parse } from \"./contrib/parseuri.js\";\nimport { Emitter } from \"@socket.io/component-emitter\";\nimport { protocol } from \"engine.io-parser\";\nimport { defaultBinaryType } from \"./transports/websocket-constructor.js\";\nexport class Socket extends Emitter {\n /**\n * Socket constructor.\n *\n * @param {String|Object} uri - uri or options\n * @param {Object} opts - options\n */\n constructor(uri, opts = {}) {\n super();\n this.binaryType = defaultBinaryType;\n this.writeBuffer = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = null;\n }\n if (uri) {\n uri = parse(uri);\n opts.hostname = uri.host;\n opts.secure = uri.protocol === \"https\" || uri.protocol === \"wss\";\n opts.port = uri.port;\n if (uri.query)\n opts.query = uri.query;\n }\n else if (opts.host) {\n opts.hostname = parse(opts.host).host;\n }\n installTimerFunctions(this, opts);\n this.secure =\n null != opts.secure\n ? opts.secure\n : typeof location !== \"undefined\" && \"https:\" === location.protocol;\n if (opts.hostname && !opts.port) {\n // if no port is specified manually, use the protocol default\n opts.port = this.secure ? \"443\" : \"80\";\n }\n this.hostname =\n opts.hostname ||\n (typeof location !== \"undefined\" ? location.hostname : \"localhost\");\n this.port =\n opts.port ||\n (typeof location !== \"undefined\" && location.port\n ? location.port\n : this.secure\n ? \"443\"\n : \"80\");\n this.transports = opts.transports || [\n \"polling\",\n \"websocket\",\n \"webtransport\",\n ];\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n this.opts = Object.assign({\n path: \"/engine.io\",\n agent: false,\n withCredentials: false,\n upgrade: true,\n timestampParam: \"t\",\n rememberUpgrade: false,\n addTrailingSlash: true,\n rejectUnauthorized: true,\n perMessageDeflate: {\n threshold: 1024,\n },\n transportOptions: {},\n closeOnBeforeunload: false,\n }, opts);\n this.opts.path =\n this.opts.path.replace(/\\/$/, \"\") +\n (this.opts.addTrailingSlash ? \"/\" : \"\");\n if (typeof this.opts.query === \"string\") {\n this.opts.query = decode(this.opts.query);\n }\n // set on handshake\n this.id = null;\n this.upgrades = null;\n this.pingInterval = null;\n this.pingTimeout = null;\n // set on heartbeat\n this.pingTimeoutTimer = null;\n if (typeof addEventListener === \"function\") {\n if (this.opts.closeOnBeforeunload) {\n // Firefox closes the connection when the \"beforeunload\" event is emitted but not Chrome. This event listener\n // ensures every browser behaves the same (no \"disconnect\" event at the Socket.IO level when the page is\n // closed/reloaded)\n this.beforeunloadEventListener = () => {\n if (this.transport) {\n // silently close the transport\n this.transport.removeAllListeners();\n this.transport.close();\n }\n };\n addEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n }\n if (this.hostname !== \"localhost\") {\n this.offlineEventListener = () => {\n this.onClose(\"transport close\", {\n description: \"network connection lost\",\n });\n };\n addEventListener(\"offline\", this.offlineEventListener, false);\n }\n }\n this.open();\n }\n /**\n * Creates transport of the given type.\n *\n * @param {String} name - transport name\n * @return {Transport}\n * @private\n */\n createTransport(name) {\n const query = Object.assign({}, this.opts.query);\n // append engine.io protocol identifier\n query.EIO = protocol;\n // transport name\n query.transport = name;\n // session id if we already have one\n if (this.id)\n query.sid = this.id;\n const opts = Object.assign({}, this.opts, {\n query,\n socket: this,\n hostname: this.hostname,\n secure: this.secure,\n port: this.port,\n }, this.opts.transportOptions[name]);\n return new transports[name](opts);\n }\n /**\n * Initializes transport to use and starts probe.\n *\n * @private\n */\n open() {\n let transport;\n if (this.opts.rememberUpgrade &&\n Socket.priorWebsocketSuccess &&\n this.transports.indexOf(\"websocket\") !== -1) {\n transport = \"websocket\";\n }\n else if (0 === this.transports.length) {\n // Emit error on next tick so it can be listened to\n this.setTimeoutFn(() => {\n this.emitReserved(\"error\", \"No transports available\");\n }, 0);\n return;\n }\n else {\n transport = this.transports[0];\n }\n this.readyState = \"opening\";\n // Retry with the next transport if the transport is disabled (jsonp: false)\n try {\n transport = this.createTransport(transport);\n }\n catch (e) {\n this.transports.shift();\n this.open();\n return;\n }\n transport.open();\n this.setTransport(transport);\n }\n /**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @private\n */\n setTransport(transport) {\n if (this.transport) {\n this.transport.removeAllListeners();\n }\n // set up transport\n this.transport = transport;\n // set up transport listeners\n transport\n .on(\"drain\", this.onDrain.bind(this))\n .on(\"packet\", this.onPacket.bind(this))\n .on(\"error\", this.onError.bind(this))\n .on(\"close\", (reason) => this.onClose(\"transport close\", reason));\n }\n /**\n * Probes a transport.\n *\n * @param {String} name - transport name\n * @private\n */\n probe(name) {\n let transport = this.createTransport(name);\n let failed = false;\n Socket.priorWebsocketSuccess = false;\n const onTransportOpen = () => {\n if (failed)\n return;\n transport.send([{ type: \"ping\", data: \"probe\" }]);\n transport.once(\"packet\", (msg) => {\n if (failed)\n return;\n if (\"pong\" === msg.type && \"probe\" === msg.data) {\n this.upgrading = true;\n this.emitReserved(\"upgrading\", transport);\n if (!transport)\n return;\n Socket.priorWebsocketSuccess = \"websocket\" === transport.name;\n this.transport.pause(() => {\n if (failed)\n return;\n if (\"closed\" === this.readyState)\n return;\n cleanup();\n this.setTransport(transport);\n transport.send([{ type: \"upgrade\" }]);\n this.emitReserved(\"upgrade\", transport);\n transport = null;\n this.upgrading = false;\n this.flush();\n });\n }\n else {\n const err = new Error(\"probe error\");\n // @ts-ignore\n err.transport = transport.name;\n this.emitReserved(\"upgradeError\", err);\n }\n });\n };\n function freezeTransport() {\n if (failed)\n return;\n // Any callback called by transport should be ignored since now\n failed = true;\n cleanup();\n transport.close();\n transport = null;\n }\n // Handle any error that happens while probing\n const onerror = (err) => {\n const error = new Error(\"probe error: \" + err);\n // @ts-ignore\n error.transport = transport.name;\n freezeTransport();\n this.emitReserved(\"upgradeError\", error);\n };\n function onTransportClose() {\n onerror(\"transport closed\");\n }\n // When the socket is closed while we're probing\n function onclose() {\n onerror(\"socket closed\");\n }\n // When the socket is upgraded while we're probing\n function onupgrade(to) {\n if (transport && to.name !== transport.name) {\n freezeTransport();\n }\n }\n // Remove all listeners on the transport and on self\n const cleanup = () => {\n transport.removeListener(\"open\", onTransportOpen);\n transport.removeListener(\"error\", onerror);\n transport.removeListener(\"close\", onTransportClose);\n this.off(\"close\", onclose);\n this.off(\"upgrading\", onupgrade);\n };\n transport.once(\"open\", onTransportOpen);\n transport.once(\"error\", onerror);\n transport.once(\"close\", onTransportClose);\n this.once(\"close\", onclose);\n this.once(\"upgrading\", onupgrade);\n if (this.upgrades.indexOf(\"webtransport\") !== -1 &&\n name !== \"webtransport\") {\n // favor WebTransport\n this.setTimeoutFn(() => {\n if (!failed) {\n transport.open();\n }\n }, 200);\n }\n else {\n transport.open();\n }\n }\n /**\n * Called when connection is deemed open.\n *\n * @private\n */\n onOpen() {\n this.readyState = \"open\";\n Socket.priorWebsocketSuccess = \"websocket\" === this.transport.name;\n this.emitReserved(\"open\");\n this.flush();\n // we check for `readyState` in case an `open`\n // listener already closed the socket\n if (\"open\" === this.readyState && this.opts.upgrade) {\n let i = 0;\n const l = this.upgrades.length;\n for (; i < l; i++) {\n this.probe(this.upgrades[i]);\n }\n }\n }\n /**\n * Handles a packet.\n *\n * @private\n */\n onPacket(packet) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n this.emitReserved(\"packet\", packet);\n // Socket is live - any packet counts\n this.emitReserved(\"heartbeat\");\n this.resetPingTimeout();\n switch (packet.type) {\n case \"open\":\n this.onHandshake(JSON.parse(packet.data));\n break;\n case \"ping\":\n this.sendPacket(\"pong\");\n this.emitReserved(\"ping\");\n this.emitReserved(\"pong\");\n break;\n case \"error\":\n const err = new Error(\"server error\");\n // @ts-ignore\n err.code = packet.data;\n this.onError(err);\n break;\n case \"message\":\n this.emitReserved(\"data\", packet.data);\n this.emitReserved(\"message\", packet.data);\n break;\n }\n }\n else {\n }\n }\n /**\n * Called upon handshake completion.\n *\n * @param {Object} data - handshake obj\n * @private\n */\n onHandshake(data) {\n this.emitReserved(\"handshake\", data);\n this.id = data.sid;\n this.transport.query.sid = data.sid;\n this.upgrades = this.filterUpgrades(data.upgrades);\n this.pingInterval = data.pingInterval;\n this.pingTimeout = data.pingTimeout;\n this.maxPayload = data.maxPayload;\n this.onOpen();\n // In case open handler closes socket\n if (\"closed\" === this.readyState)\n return;\n this.resetPingTimeout();\n }\n /**\n * Sets and resets ping timeout timer based on server pings.\n *\n * @private\n */\n resetPingTimeout() {\n this.clearTimeoutFn(this.pingTimeoutTimer);\n this.pingTimeoutTimer = this.setTimeoutFn(() => {\n this.onClose(\"ping timeout\");\n }, this.pingInterval + this.pingTimeout);\n if (this.opts.autoUnref) {\n this.pingTimeoutTimer.unref();\n }\n }\n /**\n * Called on `drain` event\n *\n * @private\n */\n onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 === this.writeBuffer.length) {\n this.emitReserved(\"drain\");\n }\n else {\n this.flush();\n }\n }\n /**\n * Flush write buffers.\n *\n * @private\n */\n flush() {\n if (\"closed\" !== this.readyState &&\n this.transport.writable &&\n !this.upgrading &&\n this.writeBuffer.length) {\n const packets = this.getWritablePackets();\n this.transport.send(packets);\n // keep track of current length of writeBuffer\n // splice writeBuffer and callbackBuffer on `drain`\n this.prevBufferLen = packets.length;\n this.emitReserved(\"flush\");\n }\n }\n /**\n * Ensure the encoded size of the writeBuffer is below the maxPayload value sent by the server (only for HTTP\n * long-polling)\n *\n * @private\n */\n getWritablePackets() {\n const shouldCheckPayloadSize = this.maxPayload &&\n this.transport.name === \"polling\" &&\n this.writeBuffer.length > 1;\n if (!shouldCheckPayloadSize) {\n return this.writeBuffer;\n }\n let payloadSize = 1; // first packet type\n for (let i = 0; i < this.writeBuffer.length; i++) {\n const data = this.writeBuffer[i].data;\n if (data) {\n payloadSize += byteLength(data);\n }\n if (i > 0 && payloadSize > this.maxPayload) {\n return this.writeBuffer.slice(0, i);\n }\n payloadSize += 2; // separator + packet type\n }\n return this.writeBuffer;\n }\n /**\n * Sends a message.\n *\n * @param {String} msg - message.\n * @param {Object} options.\n * @param {Function} callback function.\n * @return {Socket} for chaining.\n */\n write(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n send(msg, options, fn) {\n this.sendPacket(\"message\", msg, options, fn);\n return this;\n }\n /**\n * Sends a packet.\n *\n * @param {String} type: packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} fn - callback function.\n * @private\n */\n sendPacket(type, data, options, fn) {\n if (\"function\" === typeof data) {\n fn = data;\n data = undefined;\n }\n if (\"function\" === typeof options) {\n fn = options;\n options = null;\n }\n if (\"closing\" === this.readyState || \"closed\" === this.readyState) {\n return;\n }\n options = options || {};\n options.compress = false !== options.compress;\n const packet = {\n type: type,\n data: data,\n options: options,\n };\n this.emitReserved(\"packetCreate\", packet);\n this.writeBuffer.push(packet);\n if (fn)\n this.once(\"flush\", fn);\n this.flush();\n }\n /**\n * Closes the connection.\n */\n close() {\n const close = () => {\n this.onClose(\"forced close\");\n this.transport.close();\n };\n const cleanupAndClose = () => {\n this.off(\"upgrade\", cleanupAndClose);\n this.off(\"upgradeError\", cleanupAndClose);\n close();\n };\n const waitForUpgrade = () => {\n // wait for upgrade to finish since we can't send packets while pausing a transport\n this.once(\"upgrade\", cleanupAndClose);\n this.once(\"upgradeError\", cleanupAndClose);\n };\n if (\"opening\" === this.readyState || \"open\" === this.readyState) {\n this.readyState = \"closing\";\n if (this.writeBuffer.length) {\n this.once(\"drain\", () => {\n if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n });\n }\n else if (this.upgrading) {\n waitForUpgrade();\n }\n else {\n close();\n }\n }\n return this;\n }\n /**\n * Called upon transport error\n *\n * @private\n */\n onError(err) {\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }\n /**\n * Called upon transport close.\n *\n * @private\n */\n onClose(reason, description) {\n if (\"opening\" === this.readyState ||\n \"open\" === this.readyState ||\n \"closing\" === this.readyState) {\n // clear timers\n this.clearTimeoutFn(this.pingTimeoutTimer);\n // stop event from firing again for transport\n this.transport.removeAllListeners(\"close\");\n // ensure transport won't stay open\n this.transport.close();\n // ignore further transport communication\n this.transport.removeAllListeners();\n if (typeof removeEventListener === \"function\") {\n removeEventListener(\"beforeunload\", this.beforeunloadEventListener, false);\n removeEventListener(\"offline\", this.offlineEventListener, false);\n }\n // set ready state\n this.readyState = \"closed\";\n // clear session id\n this.id = null;\n // emit close event\n this.emitReserved(\"close\", reason, description);\n // clean buffers after, so users can still\n // grab the buffers on `close` event\n this.writeBuffer = [];\n this.prevBufferLen = 0;\n }\n }\n /**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} upgrades - server upgrades\n * @private\n */\n filterUpgrades(upgrades) {\n const filteredUpgrades = [];\n let i = 0;\n const j = upgrades.length;\n for (; i < j; i++) {\n if (~this.transports.indexOf(upgrades[i]))\n filteredUpgrades.push(upgrades[i]);\n }\n return filteredUpgrades;\n }\n}\nSocket.protocol = protocol;\n","import { parse } from \"engine.io-client\";\n/**\n * URL parser.\n *\n * @param uri - url\n * @param path - the request path of the connection\n * @param loc - An object meant to mimic window.location.\n * Defaults to window.location.\n * @public\n */\nexport function url(uri, path = \"\", loc) {\n let obj = uri;\n // default to window.location\n loc = loc || (typeof location !== \"undefined\" && location);\n if (null == uri)\n uri = loc.protocol + \"//\" + loc.host;\n // relative path support\n if (typeof uri === \"string\") {\n if (\"/\" === uri.charAt(0)) {\n if (\"/\" === uri.charAt(1)) {\n uri = loc.protocol + uri;\n }\n else {\n uri = loc.host + uri;\n }\n }\n if (!/^(https?|wss?):\\/\\//.test(uri)) {\n if (\"undefined\" !== typeof loc) {\n uri = loc.protocol + \"//\" + uri;\n }\n else {\n uri = \"https://\" + uri;\n }\n }\n // parse\n obj = parse(uri);\n }\n // make sure we treat `localhost:80` and `localhost` equally\n if (!obj.port) {\n if (/^(http|ws)$/.test(obj.protocol)) {\n obj.port = \"80\";\n }\n else if (/^(http|ws)s$/.test(obj.protocol)) {\n obj.port = \"443\";\n }\n }\n obj.path = obj.path || \"/\";\n const ipv6 = obj.host.indexOf(\":\") !== -1;\n const host = ipv6 ? \"[\" + obj.host + \"]\" : obj.host;\n // define unique id\n obj.id = obj.protocol + \"://\" + host + \":\" + obj.port + path;\n // define href\n obj.href =\n obj.protocol +\n \"://\" +\n host +\n (loc && loc.port === obj.port ? \"\" : \":\" + obj.port);\n return obj;\n}\n","const withNativeArrayBuffer = typeof ArrayBuffer === \"function\";\nconst isView = (obj) => {\n return typeof ArrayBuffer.isView === \"function\"\n ? ArrayBuffer.isView(obj)\n : obj.buffer instanceof ArrayBuffer;\n};\nconst toString = Object.prototype.toString;\nconst withNativeBlob = typeof Blob === \"function\" ||\n (typeof Blob !== \"undefined\" &&\n toString.call(Blob) === \"[object BlobConstructor]\");\nconst withNativeFile = typeof File === \"function\" ||\n (typeof File !== \"undefined\" &&\n toString.call(File) === \"[object FileConstructor]\");\n/**\n * Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.\n *\n * @private\n */\nexport function isBinary(obj) {\n return ((withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj))) ||\n (withNativeBlob && obj instanceof Blob) ||\n (withNativeFile && obj instanceof File));\n}\nexport function hasBinary(obj, toJSON) {\n if (!obj || typeof obj !== \"object\") {\n return false;\n }\n if (Array.isArray(obj)) {\n for (let i = 0, l = obj.length; i < l; i++) {\n if (hasBinary(obj[i])) {\n return true;\n }\n }\n return false;\n }\n if (isBinary(obj)) {\n return true;\n }\n if (obj.toJSON &&\n typeof obj.toJSON === \"function\" &&\n arguments.length === 1) {\n return hasBinary(obj.toJSON(), true);\n }\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n return true;\n }\n }\n return false;\n}\n","import { isBinary } from \"./is-binary.js\";\n/**\n * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @public\n */\nexport function deconstructPacket(packet) {\n const buffers = [];\n const packetData = packet.data;\n const pack = packet;\n pack.data = _deconstructPacket(packetData, buffers);\n pack.attachments = buffers.length; // number of binary 'attachments'\n return { packet: pack, buffers: buffers };\n}\nfunction _deconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (isBinary(data)) {\n const placeholder = { _placeholder: true, num: buffers.length };\n buffers.push(data);\n return placeholder;\n }\n else if (Array.isArray(data)) {\n const newData = new Array(data.length);\n for (let i = 0; i < data.length; i++) {\n newData[i] = _deconstructPacket(data[i], buffers);\n }\n return newData;\n }\n else if (typeof data === \"object\" && !(data instanceof Date)) {\n const newData = {};\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n newData[key] = _deconstructPacket(data[key], buffers);\n }\n }\n return newData;\n }\n return data;\n}\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @public\n */\nexport function reconstructPacket(packet, buffers) {\n packet.data = _reconstructPacket(packet.data, buffers);\n delete packet.attachments; // no longer useful\n return packet;\n}\nfunction _reconstructPacket(data, buffers) {\n if (!data)\n return data;\n if (data && data._placeholder === true) {\n const isIndexValid = typeof data.num === \"number\" &&\n data.num >= 0 &&\n data.num < buffers.length;\n if (isIndexValid) {\n return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n }\n else {\n throw new Error(\"illegal attachments\");\n }\n }\n else if (Array.isArray(data)) {\n for (let i = 0; i < data.length; i++) {\n data[i] = _reconstructPacket(data[i], buffers);\n }\n }\n else if (typeof data === \"object\") {\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n data[key] = _reconstructPacket(data[key], buffers);\n }\n }\n }\n return data;\n}\n","import { Emitter } from \"@socket.io/component-emitter\";\nimport { deconstructPacket, reconstructPacket } from \"./binary.js\";\nimport { isBinary, hasBinary } from \"./is-binary.js\";\n/**\n * These strings must not be used as event names, as they have a special meaning.\n */\nconst RESERVED_EVENTS = [\n \"connect\",\n \"connect_error\",\n \"disconnect\",\n \"disconnecting\",\n \"newListener\",\n \"removeListener\", // used by the Node.js EventEmitter\n];\n/**\n * Protocol version.\n *\n * @public\n */\nexport const protocol = 5;\nexport var PacketType;\n(function (PacketType) {\n PacketType[PacketType[\"CONNECT\"] = 0] = \"CONNECT\";\n PacketType[PacketType[\"DISCONNECT\"] = 1] = \"DISCONNECT\";\n PacketType[PacketType[\"EVENT\"] = 2] = \"EVENT\";\n PacketType[PacketType[\"ACK\"] = 3] = \"ACK\";\n PacketType[PacketType[\"CONNECT_ERROR\"] = 4] = \"CONNECT_ERROR\";\n PacketType[PacketType[\"BINARY_EVENT\"] = 5] = \"BINARY_EVENT\";\n PacketType[PacketType[\"BINARY_ACK\"] = 6] = \"BINARY_ACK\";\n})(PacketType || (PacketType = {}));\n/**\n * A socket.io Encoder instance\n */\nexport class Encoder {\n /**\n * Encoder constructor\n *\n * @param {function} replacer - custom replacer to pass down to JSON.parse\n */\n constructor(replacer) {\n this.replacer = replacer;\n }\n /**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n */\n encode(obj) {\n if (obj.type === PacketType.EVENT || obj.type === PacketType.ACK) {\n if (hasBinary(obj)) {\n return this.encodeAsBinary({\n type: obj.type === PacketType.EVENT\n ? PacketType.BINARY_EVENT\n : PacketType.BINARY_ACK,\n nsp: obj.nsp,\n data: obj.data,\n id: obj.id,\n });\n }\n }\n return [this.encodeAsString(obj)];\n }\n /**\n * Encode packet as string.\n */\n encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namespace other than `/`\n // we append it followed by a comma `,`\n if (obj.nsp && \"/\" !== obj.nsp) {\n str += obj.nsp + \",\";\n }\n // immediately followed by the id\n if (null != obj.id) {\n str += obj.id;\n }\n // json data\n if (null != obj.data) {\n str += JSON.stringify(obj.data, this.replacer);\n }\n return str;\n }\n /**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n */\n encodeAsBinary(obj) {\n const deconstruction = deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // write all the buffers\n }\n}\n// see https://stackoverflow.com/questions/8511281/check-if-a-value-is-an-object-in-javascript\nfunction isObject(value) {\n return Object.prototype.toString.call(value) === \"[object Object]\";\n}\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n */\nexport class Decoder extends Emitter {\n /**\n * Decoder constructor\n *\n * @param {function} reviver - custom reviver to pass down to JSON.stringify\n */\n constructor(reviver) {\n super();\n this.reviver = reviver;\n }\n /**\n * Decodes an encoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n */\n add(obj) {\n let packet;\n if (typeof obj === \"string\") {\n if (this.reconstructor) {\n throw new Error(\"got plaintext data when reconstructing a packet\");\n }\n packet = this.decodeString(obj);\n const isBinaryEvent = packet.type === PacketType.BINARY_EVENT;\n if (isBinaryEvent || packet.type === PacketType.BINARY_ACK) {\n packet.type = isBinaryEvent ? PacketType.EVENT : PacketType.ACK;\n // binary packet's json\n this.reconstructor = new BinaryReconstructor(packet);\n // no attachments, labeled binary but no binary data to follow\n if (packet.attachments === 0) {\n super.emitReserved(\"decoded\", packet);\n }\n }\n else {\n // non-binary full packet\n super.emitReserved(\"decoded\", packet);\n }\n }\n else if (isBinary(obj) || obj.base64) {\n // raw binary data\n if (!this.reconstructor) {\n throw new Error(\"got binary data when not reconstructing a packet\");\n }\n else {\n packet = this.reconstructor.takeBinaryData(obj);\n if (packet) {\n // received final buffer\n this.reconstructor = null;\n super.emitReserved(\"decoded\", packet);\n }\n }\n }\n else {\n throw new Error(\"Unknown type: \" + obj);\n }\n }\n /**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n */\n decodeString(str) {\n let i = 0;\n // look up type\n const p = {\n type: Number(str.charAt(0)),\n };\n if (PacketType[p.type] === undefined) {\n throw new Error(\"unknown packet type \" + p.type);\n }\n // look up attachments if type binary\n if (p.type === PacketType.BINARY_EVENT ||\n p.type === PacketType.BINARY_ACK) {\n const start = i + 1;\n while (str.charAt(++i) !== \"-\" && i != str.length) { }\n const buf = str.substring(start, i);\n if (buf != Number(buf) || str.charAt(i) !== \"-\") {\n throw new Error(\"Illegal attachments\");\n }\n p.attachments = Number(buf);\n }\n // look up namespace (if any)\n if (\"/\" === str.charAt(i + 1)) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (\",\" === c)\n break;\n if (i === str.length)\n break;\n }\n p.nsp = str.substring(start, i);\n }\n else {\n p.nsp = \"/\";\n }\n // look up id\n const next = str.charAt(i + 1);\n if (\"\" !== next && Number(next) == next) {\n const start = i + 1;\n while (++i) {\n const c = str.charAt(i);\n if (null == c || Number(c) != c) {\n --i;\n break;\n }\n if (i === str.length)\n break;\n }\n p.id = Number(str.substring(start, i + 1));\n }\n // look up json data\n if (str.charAt(++i)) {\n const payload = this.tryParse(str.substr(i));\n if (Decoder.isPayloadValid(p.type, payload)) {\n p.data = payload;\n }\n else {\n throw new Error(\"invalid payload\");\n }\n }\n return p;\n }\n tryParse(str) {\n try {\n return JSON.parse(str, this.reviver);\n }\n catch (e) {\n return false;\n }\n }\n static isPayloadValid(type, payload) {\n switch (type) {\n case PacketType.CONNECT:\n return isObject(payload);\n case PacketType.DISCONNECT:\n return payload === undefined;\n case PacketType.CONNECT_ERROR:\n return typeof payload === \"string\" || isObject(payload);\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n return (Array.isArray(payload) &&\n (typeof payload[0] === \"number\" ||\n (typeof payload[0] === \"string\" &&\n RESERVED_EVENTS.indexOf(payload[0]) === -1)));\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n return Array.isArray(payload);\n }\n }\n /**\n * Deallocates a parser's resources\n */\n destroy() {\n if (this.reconstructor) {\n this.reconstructor.finishedReconstruction();\n this.reconstructor = null;\n }\n }\n}\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n */\nclass BinaryReconstructor {\n constructor(packet) {\n this.packet = packet;\n this.buffers = [];\n this.reconPack = packet;\n }\n /**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n * a reconstructed packet object if all buffers have been received.\n */\n takeBinaryData(binData) {\n this.buffers.push(binData);\n if (this.buffers.length === this.reconPack.attachments) {\n // done with buffer list\n const packet = reconstructPacket(this.reconPack, this.buffers);\n this.finishedReconstruction();\n return packet;\n }\n return null;\n }\n /**\n * Cleans up binary packet reconstruction variables.\n */\n finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }\n}\n","export function on(obj, ev, fn) {\n obj.on(ev, fn);\n return function subDestroy() {\n obj.off(ev, fn);\n };\n}\n","import { PacketType } from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\n/**\n * Internal events.\n * These events can't be emitted by the user.\n */\nconst RESERVED_EVENTS = Object.freeze({\n connect: 1,\n connect_error: 1,\n disconnect: 1,\n disconnecting: 1,\n // EventEmitter reserved events: https://nodejs.org/api/events.html#events_event_newlistener\n newListener: 1,\n removeListener: 1,\n});\n/**\n * A Socket is the fundamental class for interacting with the server.\n *\n * A Socket belongs to a certain Namespace (by default /) and uses an underlying {@link Manager} to communicate.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(\"connected\");\n * });\n *\n * // send an event to the server\n * socket.emit(\"foo\", \"bar\");\n *\n * socket.on(\"foobar\", () => {\n * // an event was received from the server\n * });\n *\n * // upon disconnection\n * socket.on(\"disconnect\", (reason) => {\n * console.log(`disconnected due to ${reason}`);\n * });\n */\nexport class Socket extends Emitter {\n /**\n * `Socket` constructor.\n */\n constructor(io, nsp, opts) {\n super();\n /**\n * Whether the socket is currently connected to the server.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.connected); // true\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.connected); // false\n * });\n */\n this.connected = false;\n /**\n * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will\n * be transmitted by the server.\n */\n this.recovered = false;\n /**\n * Buffer for packets received before the CONNECT packet\n */\n this.receiveBuffer = [];\n /**\n * Buffer for packets that will be sent once the socket is connected\n */\n this.sendBuffer = [];\n /**\n * The queue of packets to be sent with retry in case of failure.\n *\n * Packets are sent one by one, each waiting for the server acknowledgement, in order to guarantee the delivery order.\n * @private\n */\n this._queue = [];\n /**\n * A sequence to generate the ID of the {@link QueuedPacket}.\n * @private\n */\n this._queueSeq = 0;\n this.ids = 0;\n /**\n * A map containing acknowledgement handlers.\n *\n * The `withError` attribute is used to differentiate handlers that accept an error as first argument:\n *\n * - `socket.emit(\"test\", (err, value) => { ... })` with `ackTimeout` option\n * - `socket.timeout(5000).emit(\"test\", (err, value) => { ... })`\n * - `const value = await socket.emitWithAck(\"test\")`\n *\n * From those that don't:\n *\n * - `socket.emit(\"test\", (value) => { ... });`\n *\n * In the first case, the handlers will be called with an error when:\n *\n * - the timeout is reached\n * - the socket gets disconnected\n *\n * In the second case, the handlers will be simply discarded upon disconnection, since the client will never receive\n * an acknowledgement from the server.\n *\n * @private\n */\n this.acks = {};\n this.flags = {};\n this.io = io;\n this.nsp = nsp;\n if (opts && opts.auth) {\n this.auth = opts.auth;\n }\n this._opts = Object.assign({}, opts);\n if (this.io._autoConnect)\n this.open();\n }\n /**\n * Whether the socket is currently disconnected\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"connect\", () => {\n * console.log(socket.disconnected); // false\n * });\n *\n * socket.on(\"disconnect\", () => {\n * console.log(socket.disconnected); // true\n * });\n */\n get disconnected() {\n return !this.connected;\n }\n /**\n * Subscribe to open, close and packet events\n *\n * @private\n */\n subEvents() {\n if (this.subs)\n return;\n const io = this.io;\n this.subs = [\n on(io, \"open\", this.onopen.bind(this)),\n on(io, \"packet\", this.onpacket.bind(this)),\n on(io, \"error\", this.onerror.bind(this)),\n on(io, \"close\", this.onclose.bind(this)),\n ];\n }\n /**\n * Whether the Socket will try to reconnect when its Manager connects or reconnects.\n *\n * @example\n * const socket = io();\n *\n * console.log(socket.active); // true\n *\n * socket.on(\"disconnect\", (reason) => {\n * if (reason === \"io server disconnect\") {\n * // the disconnection was initiated by the server, you need to manually reconnect\n * console.log(socket.active); // false\n * }\n * // else the socket will automatically try to reconnect\n * console.log(socket.active); // true\n * });\n */\n get active() {\n return !!this.subs;\n }\n /**\n * \"Opens\" the socket.\n *\n * @example\n * const socket = io({\n * autoConnect: false\n * });\n *\n * socket.connect();\n */\n connect() {\n if (this.connected)\n return this;\n this.subEvents();\n if (!this.io[\"_reconnecting\"])\n this.io.open(); // ensure open\n if (\"open\" === this.io._readyState)\n this.onopen();\n return this;\n }\n /**\n * Alias for {@link connect()}.\n */\n open() {\n return this.connect();\n }\n /**\n * Sends a `message` event.\n *\n * This method mimics the WebSocket.send() method.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send\n *\n * @example\n * socket.send(\"hello\");\n *\n * // this is equivalent to\n * socket.emit(\"message\", \"hello\");\n *\n * @return self\n */\n send(...args) {\n args.unshift(\"message\");\n this.emit.apply(this, args);\n return this;\n }\n /**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @example\n * socket.emit(\"hello\", \"world\");\n *\n * // all serializable datastructures are supported (no need to call JSON.stringify)\n * socket.emit(\"hello\", 1, \"2\", { 3: [\"4\"], 5: Uint8Array.from([6]) });\n *\n * // with an acknowledgement from the server\n * socket.emit(\"hello\", \"world\", (val) => {\n * // ...\n * });\n *\n * @return self\n */\n emit(ev, ...args) {\n if (RESERVED_EVENTS.hasOwnProperty(ev)) {\n throw new Error('\"' + ev.toString() + '\" is a reserved event name');\n }\n args.unshift(ev);\n if (this._opts.retries && !this.flags.fromQueue && !this.flags.volatile) {\n this._addToQueue(args);\n return this;\n }\n const packet = {\n type: PacketType.EVENT,\n data: args,\n };\n packet.options = {};\n packet.options.compress = this.flags.compress !== false;\n // event ack callback\n if (\"function\" === typeof args[args.length - 1]) {\n const id = this.ids++;\n const ack = args.pop();\n this._registerAckCallback(id, ack);\n packet.id = id;\n }\n const isTransportWritable = this.io.engine &&\n this.io.engine.transport &&\n this.io.engine.transport.writable;\n const discardPacket = this.flags.volatile && (!isTransportWritable || !this.connected);\n if (discardPacket) {\n }\n else if (this.connected) {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n }\n else {\n this.sendBuffer.push(packet);\n }\n this.flags = {};\n return this;\n }\n /**\n * @private\n */\n _registerAckCallback(id, ack) {\n var _a;\n const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;\n if (timeout === undefined) {\n this.acks[id] = ack;\n return;\n }\n // @ts-ignore\n const timer = this.io.setTimeoutFn(() => {\n delete this.acks[id];\n for (let i = 0; i < this.sendBuffer.length; i++) {\n if (this.sendBuffer[i].id === id) {\n this.sendBuffer.splice(i, 1);\n }\n }\n ack.call(this, new Error(\"operation has timed out\"));\n }, timeout);\n const fn = (...args) => {\n // @ts-ignore\n this.io.clearTimeoutFn(timer);\n ack.apply(this, args);\n };\n fn.withError = true;\n this.acks[id] = fn;\n }\n /**\n * Emits an event and waits for an acknowledgement\n *\n * @example\n * // without timeout\n * const response = await socket.emitWithAck(\"hello\", \"world\");\n *\n * // with a specific timeout\n * try {\n * const response = await socket.timeout(1000).emitWithAck(\"hello\", \"world\");\n * } catch (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n *\n * @return a Promise that will be fulfilled when the server acknowledges the event\n */\n emitWithAck(ev, ...args) {\n return new Promise((resolve, reject) => {\n const fn = (arg1, arg2) => {\n return arg1 ? reject(arg1) : resolve(arg2);\n };\n fn.withError = true;\n args.push(fn);\n this.emit(ev, ...args);\n });\n }\n /**\n * Add the packet to the queue.\n * @param args\n * @private\n */\n _addToQueue(args) {\n let ack;\n if (typeof args[args.length - 1] === \"function\") {\n ack = args.pop();\n }\n const packet = {\n id: this._queueSeq++,\n tryCount: 0,\n pending: false,\n args,\n flags: Object.assign({ fromQueue: true }, this.flags),\n };\n args.push((err, ...responseArgs) => {\n if (packet !== this._queue[0]) {\n // the packet has already been acknowledged\n return;\n }\n const hasError = err !== null;\n if (hasError) {\n if (packet.tryCount > this._opts.retries) {\n this._queue.shift();\n if (ack) {\n ack(err);\n }\n }\n }\n else {\n this._queue.shift();\n if (ack) {\n ack(null, ...responseArgs);\n }\n }\n packet.pending = false;\n return this._drainQueue();\n });\n this._queue.push(packet);\n this._drainQueue();\n }\n /**\n * Send the first packet of the queue, and wait for an acknowledgement from the server.\n * @param force - whether to resend a packet that has not been acknowledged yet\n *\n * @private\n */\n _drainQueue(force = false) {\n if (!this.connected || this._queue.length === 0) {\n return;\n }\n const packet = this._queue[0];\n if (packet.pending && !force) {\n return;\n }\n packet.pending = true;\n packet.tryCount++;\n this.flags = packet.flags;\n this.emit.apply(this, packet.args);\n }\n /**\n * Sends a packet.\n *\n * @param packet\n * @private\n */\n packet(packet) {\n packet.nsp = this.nsp;\n this.io._packet(packet);\n }\n /**\n * Called upon engine `open`.\n *\n * @private\n */\n onopen() {\n if (typeof this.auth == \"function\") {\n this.auth((data) => {\n this._sendConnectPacket(data);\n });\n }\n else {\n this._sendConnectPacket(this.auth);\n }\n }\n /**\n * Sends a CONNECT packet to initiate the Socket.IO session.\n *\n * @param data\n * @private\n */\n _sendConnectPacket(data) {\n this.packet({\n type: PacketType.CONNECT,\n data: this._pid\n ? Object.assign({ pid: this._pid, offset: this._lastOffset }, data)\n : data,\n });\n }\n /**\n * Called upon engine or manager `error`.\n *\n * @param err\n * @private\n */\n onerror(err) {\n if (!this.connected) {\n this.emitReserved(\"connect_error\", err);\n }\n }\n /**\n * Called upon engine `close`.\n *\n * @param reason\n * @param description\n * @private\n */\n onclose(reason, description) {\n this.connected = false;\n delete this.id;\n this.emitReserved(\"disconnect\", reason, description);\n this._clearAcks();\n }\n /**\n * Clears the acknowledgement handlers upon disconnection, since the client will never receive an acknowledgement from\n * the server.\n *\n * @private\n */\n _clearAcks() {\n Object.keys(this.acks).forEach((id) => {\n const isBuffered = this.sendBuffer.some((packet) => String(packet.id) === id);\n if (!isBuffered) {\n // note: handlers that do not accept an error as first argument are ignored here\n const ack = this.acks[id];\n delete this.acks[id];\n if (ack.withError) {\n ack.call(this, new Error(\"socket has been disconnected\"));\n }\n }\n });\n }\n /**\n * Called with socket packet.\n *\n * @param packet\n * @private\n */\n onpacket(packet) {\n const sameNamespace = packet.nsp === this.nsp;\n if (!sameNamespace)\n return;\n switch (packet.type) {\n case PacketType.CONNECT:\n if (packet.data && packet.data.sid) {\n this.onconnect(packet.data.sid, packet.data.pid);\n }\n else {\n this.emitReserved(\"connect_error\", new Error(\"It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)\"));\n }\n break;\n case PacketType.EVENT:\n case PacketType.BINARY_EVENT:\n this.onevent(packet);\n break;\n case PacketType.ACK:\n case PacketType.BINARY_ACK:\n this.onack(packet);\n break;\n case PacketType.DISCONNECT:\n this.ondisconnect();\n break;\n case PacketType.CONNECT_ERROR:\n this.destroy();\n const err = new Error(packet.data.message);\n // @ts-ignore\n err.data = packet.data.data;\n this.emitReserved(\"connect_error\", err);\n break;\n }\n }\n /**\n * Called upon a server event.\n *\n * @param packet\n * @private\n */\n onevent(packet) {\n const args = packet.data || [];\n if (null != packet.id) {\n args.push(this.ack(packet.id));\n }\n if (this.connected) {\n this.emitEvent(args);\n }\n else {\n this.receiveBuffer.push(Object.freeze(args));\n }\n }\n emitEvent(args) {\n if (this._anyListeners && this._anyListeners.length) {\n const listeners = this._anyListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, args);\n }\n }\n super.emit.apply(this, args);\n if (this._pid && args.length && typeof args[args.length - 1] === \"string\") {\n this._lastOffset = args[args.length - 1];\n }\n }\n /**\n * Produces an ack callback to emit with an event.\n *\n * @private\n */\n ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n self.packet({\n type: PacketType.ACK,\n id: id,\n data: args,\n });\n };\n }\n /**\n * Called upon a server acknowledgement.\n *\n * @param packet\n * @private\n */\n onack(packet) {\n const ack = this.acks[packet.id];\n if (typeof ack !== \"function\") {\n return;\n }\n delete this.acks[packet.id];\n // @ts-ignore FIXME ack is incorrectly inferred as 'never'\n if (ack.withError) {\n packet.data.unshift(null);\n }\n // @ts-ignore\n ack.apply(this, packet.data);\n }\n /**\n * Called upon server connect.\n *\n * @private\n */\n onconnect(id, pid) {\n this.id = id;\n this.recovered = pid && this._pid === pid;\n this._pid = pid; // defined only if connection state recovery is enabled\n this.connected = true;\n this.emitBuffered();\n this.emitReserved(\"connect\");\n this._drainQueue(true);\n }\n /**\n * Emit buffered events (received and emitted).\n *\n * @private\n */\n emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }\n /**\n * Called upon server disconnect.\n *\n * @private\n */\n ondisconnect() {\n this.destroy();\n this.onclose(\"io server disconnect\");\n }\n /**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @private\n */\n destroy() {\n if (this.subs) {\n // clean subscriptions to avoid reconnections\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs = undefined;\n }\n this.io[\"_destroy\"](this);\n }\n /**\n * Disconnects the socket manually. In that case, the socket will not try to reconnect.\n *\n * If this is the last active Socket instance of the {@link Manager}, the low-level connection will be closed.\n *\n * @example\n * const socket = io();\n *\n * socket.on(\"disconnect\", (reason) => {\n * // console.log(reason); prints \"io client disconnect\"\n * });\n *\n * socket.disconnect();\n *\n * @return self\n */\n disconnect() {\n if (this.connected) {\n this.packet({ type: PacketType.DISCONNECT });\n }\n // remove socket from pool\n this.destroy();\n if (this.connected) {\n // fire events\n this.onclose(\"io client disconnect\");\n }\n return this;\n }\n /**\n * Alias for {@link disconnect()}.\n *\n * @return self\n */\n close() {\n return this.disconnect();\n }\n /**\n * Sets the compress flag.\n *\n * @example\n * socket.compress(false).emit(\"hello\");\n *\n * @param compress - if `true`, compresses the sending data\n * @return self\n */\n compress(compress) {\n this.flags.compress = compress;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the event message will be dropped when this socket is not\n * ready to send messages.\n *\n * @example\n * socket.volatile.emit(\"hello\"); // the server may or may not receive it\n *\n * @returns self\n */\n get volatile() {\n this.flags.volatile = true;\n return this;\n }\n /**\n * Sets a modifier for a subsequent event emission that the callback will be called with an error when the\n * given number of milliseconds have elapsed without an acknowledgement from the server:\n *\n * @example\n * socket.timeout(5000).emit(\"my-event\", (err) => {\n * if (err) {\n * // the server did not acknowledge the event in the given delay\n * }\n * });\n *\n * @returns self\n */\n timeout(timeout) {\n this.flags.timeout = timeout;\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * @example\n * socket.onAny((event, ...args) => {\n * console.log(`got ${event}`);\n * });\n *\n * @param listener\n */\n onAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * @example\n * socket.prependAny((event, ...args) => {\n * console.log(`got event ${event}`);\n * });\n *\n * @param listener\n */\n prependAny(listener) {\n this._anyListeners = this._anyListeners || [];\n this._anyListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`got event ${event}`);\n * }\n *\n * socket.onAny(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAny(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAny();\n *\n * @param listener\n */\n offAny(listener) {\n if (!this._anyListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAny() {\n return this._anyListeners || [];\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.onAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n onAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.push(listener);\n return this;\n }\n /**\n * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the\n * callback. The listener is added to the beginning of the listeners array.\n *\n * Note: acknowledgements sent to the server are not included.\n *\n * @example\n * socket.prependAnyOutgoing((event, ...args) => {\n * console.log(`sent event ${event}`);\n * });\n *\n * @param listener\n */\n prependAnyOutgoing(listener) {\n this._anyOutgoingListeners = this._anyOutgoingListeners || [];\n this._anyOutgoingListeners.unshift(listener);\n return this;\n }\n /**\n * Removes the listener that will be fired when any event is emitted.\n *\n * @example\n * const catchAllListener = (event, ...args) => {\n * console.log(`sent event ${event}`);\n * }\n *\n * socket.onAnyOutgoing(catchAllListener);\n *\n * // remove a specific listener\n * socket.offAnyOutgoing(catchAllListener);\n *\n * // or remove all listeners\n * socket.offAnyOutgoing();\n *\n * @param [listener] - the catch-all listener (optional)\n */\n offAnyOutgoing(listener) {\n if (!this._anyOutgoingListeners) {\n return this;\n }\n if (listener) {\n const listeners = this._anyOutgoingListeners;\n for (let i = 0; i < listeners.length; i++) {\n if (listener === listeners[i]) {\n listeners.splice(i, 1);\n return this;\n }\n }\n }\n else {\n this._anyOutgoingListeners = [];\n }\n return this;\n }\n /**\n * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,\n * e.g. to remove listeners.\n */\n listenersAnyOutgoing() {\n return this._anyOutgoingListeners || [];\n }\n /**\n * Notify the listeners for each packet sent\n *\n * @param packet\n *\n * @private\n */\n notifyOutgoingListeners(packet) {\n if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {\n const listeners = this._anyOutgoingListeners.slice();\n for (const listener of listeners) {\n listener.apply(this, packet.data);\n }\n }\n }\n}\n","/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\nexport function Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\nBackoff.prototype.duration = function () {\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\nBackoff.prototype.reset = function () {\n this.attempts = 0;\n};\n/**\n * Set the minimum duration\n *\n * @api public\n */\nBackoff.prototype.setMin = function (min) {\n this.ms = min;\n};\n/**\n * Set the maximum duration\n *\n * @api public\n */\nBackoff.prototype.setMax = function (max) {\n this.max = max;\n};\n/**\n * Set the jitter\n *\n * @api public\n */\nBackoff.prototype.setJitter = function (jitter) {\n this.jitter = jitter;\n};\n","import { Socket as Engine, installTimerFunctions, nextTick, } from \"engine.io-client\";\nimport { Socket } from \"./socket.js\";\nimport * as parser from \"socket.io-parser\";\nimport { on } from \"./on.js\";\nimport { Backoff } from \"./contrib/backo2.js\";\nimport { Emitter, } from \"@socket.io/component-emitter\";\nexport class Manager extends Emitter {\n constructor(uri, opts) {\n var _a;\n super();\n this.nsps = {};\n this.subs = [];\n if (uri && \"object\" === typeof uri) {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n opts.path = opts.path || \"/socket.io\";\n this.opts = opts;\n installTimerFunctions(this, opts);\n this.reconnection(opts.reconnection !== false);\n this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n this.reconnectionDelay(opts.reconnectionDelay || 1000);\n this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);\n this.backoff = new Backoff({\n min: this.reconnectionDelay(),\n max: this.reconnectionDelayMax(),\n jitter: this.randomizationFactor(),\n });\n this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n this._readyState = \"closed\";\n this.uri = uri;\n const _parser = opts.parser || parser;\n this.encoder = new _parser.Encoder();\n this.decoder = new _parser.Decoder();\n this._autoConnect = opts.autoConnect !== false;\n if (this._autoConnect)\n this.open();\n }\n reconnection(v) {\n if (!arguments.length)\n return this._reconnection;\n this._reconnection = !!v;\n return this;\n }\n reconnectionAttempts(v) {\n if (v === undefined)\n return this._reconnectionAttempts;\n this._reconnectionAttempts = v;\n return this;\n }\n reconnectionDelay(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelay;\n this._reconnectionDelay = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);\n return this;\n }\n randomizationFactor(v) {\n var _a;\n if (v === undefined)\n return this._randomizationFactor;\n this._randomizationFactor = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);\n return this;\n }\n reconnectionDelayMax(v) {\n var _a;\n if (v === undefined)\n return this._reconnectionDelayMax;\n this._reconnectionDelayMax = v;\n (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);\n return this;\n }\n timeout(v) {\n if (!arguments.length)\n return this._timeout;\n this._timeout = v;\n return this;\n }\n /**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @private\n */\n maybeReconnectOnOpen() {\n // Only try to reconnect if it's the first time we're connecting\n if (!this._reconnecting &&\n this._reconnection &&\n this.backoff.attempts === 0) {\n // keeps reconnection from firing twice for the same reconnection loop\n this.reconnect();\n }\n }\n /**\n * Sets the current transport `socket`.\n *\n * @param {Function} fn - optional, callback\n * @return self\n * @public\n */\n open(fn) {\n if (~this._readyState.indexOf(\"open\"))\n return this;\n this.engine = new Engine(this.uri, this.opts);\n const socket = this.engine;\n const self = this;\n this._readyState = \"opening\";\n this.skipReconnect = false;\n // emit `open`\n const openSubDestroy = on(socket, \"open\", function () {\n self.onopen();\n fn && fn();\n });\n const onError = (err) => {\n this.cleanup();\n this._readyState = \"closed\";\n this.emitReserved(\"error\", err);\n if (fn) {\n fn(err);\n }\n else {\n // Only do this if there is no fn to handle the error\n this.maybeReconnectOnOpen();\n }\n };\n // emit `error`\n const errorSub = on(socket, \"error\", onError);\n if (false !== this._timeout) {\n const timeout = this._timeout;\n // set timer\n const timer = this.setTimeoutFn(() => {\n openSubDestroy();\n onError(new Error(\"timeout\"));\n socket.close();\n }, timeout);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n this.subs.push(openSubDestroy);\n this.subs.push(errorSub);\n return this;\n }\n /**\n * Alias for open()\n *\n * @return self\n * @public\n */\n connect(fn) {\n return this.open(fn);\n }\n /**\n * Called upon transport open.\n *\n * @private\n */\n onopen() {\n // clear old subs\n this.cleanup();\n // mark as open\n this._readyState = \"open\";\n this.emitReserved(\"open\");\n // add new subs\n const socket = this.engine;\n this.subs.push(on(socket, \"ping\", this.onping.bind(this)), on(socket, \"data\", this.ondata.bind(this)), on(socket, \"error\", this.onerror.bind(this)), on(socket, \"close\", this.onclose.bind(this)), on(this.decoder, \"decoded\", this.ondecoded.bind(this)));\n }\n /**\n * Called upon a ping.\n *\n * @private\n */\n onping() {\n this.emitReserved(\"ping\");\n }\n /**\n * Called with data.\n *\n * @private\n */\n ondata(data) {\n try {\n this.decoder.add(data);\n }\n catch (e) {\n this.onclose(\"parse error\", e);\n }\n }\n /**\n * Called when parser fully decodes a packet.\n *\n * @private\n */\n ondecoded(packet) {\n // the nextTick call prevents an exception in a user-provided event listener from triggering a disconnection due to a \"parse error\"\n nextTick(() => {\n this.emitReserved(\"packet\", packet);\n }, this.setTimeoutFn);\n }\n /**\n * Called upon socket error.\n *\n * @private\n */\n onerror(err) {\n this.emitReserved(\"error\", err);\n }\n /**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @public\n */\n socket(nsp, opts) {\n let socket = this.nsps[nsp];\n if (!socket) {\n socket = new Socket(this, nsp, opts);\n this.nsps[nsp] = socket;\n }\n else if (this._autoConnect && !socket.active) {\n socket.connect();\n }\n return socket;\n }\n /**\n * Called upon a socket close.\n *\n * @param socket\n * @private\n */\n _destroy(socket) {\n const nsps = Object.keys(this.nsps);\n for (const nsp of nsps) {\n const socket = this.nsps[nsp];\n if (socket.active) {\n return;\n }\n }\n this._close();\n }\n /**\n * Writes a packet.\n *\n * @param packet\n * @private\n */\n _packet(packet) {\n const encodedPackets = this.encoder.encode(packet);\n for (let i = 0; i < encodedPackets.length; i++) {\n this.engine.write(encodedPackets[i], packet.options);\n }\n }\n /**\n * Clean up transport subscriptions and packet buffer.\n *\n * @private\n */\n cleanup() {\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }\n /**\n * Close the current socket.\n *\n * @private\n */\n _close() {\n this.skipReconnect = true;\n this._reconnecting = false;\n this.onclose(\"forced close\");\n if (this.engine)\n this.engine.close();\n }\n /**\n * Alias for close()\n *\n * @private\n */\n disconnect() {\n return this._close();\n }\n /**\n * Called upon engine close.\n *\n * @private\n */\n onclose(reason, description) {\n this.cleanup();\n this.backoff.reset();\n this._readyState = \"closed\";\n this.emitReserved(\"close\", reason, description);\n if (this._reconnection && !this.skipReconnect) {\n this.reconnect();\n }\n }\n /**\n * Attempt a reconnection.\n *\n * @private\n */\n reconnect() {\n if (this._reconnecting || this.skipReconnect)\n return this;\n const self = this;\n if (this.backoff.attempts >= this._reconnectionAttempts) {\n this.backoff.reset();\n this.emitReserved(\"reconnect_failed\");\n this._reconnecting = false;\n }\n else {\n const delay = this.backoff.duration();\n this._reconnecting = true;\n const timer = this.setTimeoutFn(() => {\n if (self.skipReconnect)\n return;\n this.emitReserved(\"reconnect_attempt\", self.backoff.attempts);\n // check again for the case socket closed in above events\n if (self.skipReconnect)\n return;\n self.open((err) => {\n if (err) {\n self._reconnecting = false;\n self.reconnect();\n this.emitReserved(\"reconnect_error\", err);\n }\n else {\n self.onreconnect();\n }\n });\n }, delay);\n if (this.opts.autoUnref) {\n timer.unref();\n }\n this.subs.push(() => {\n this.clearTimeoutFn(timer);\n });\n }\n }\n /**\n * Called upon successful reconnect.\n *\n * @private\n */\n onreconnect() {\n const attempt = this.backoff.attempts;\n this._reconnecting = false;\n this.backoff.reset();\n this.emitReserved(\"reconnect\", attempt);\n }\n}\n","import { url } from \"./url.js\";\nimport { Manager } from \"./manager.js\";\nimport { Socket } from \"./socket.js\";\n/**\n * Managers cache.\n */\nconst cache = {};\nfunction lookup(uri, opts) {\n if (typeof uri === \"object\") {\n opts = uri;\n uri = undefined;\n }\n opts = opts || {};\n const parsed = url(uri, opts.path || \"/socket.io\");\n const source = parsed.source;\n const id = parsed.id;\n const path = parsed.path;\n const sameNamespace = cache[id] && path in cache[id][\"nsps\"];\n const newConnection = opts.forceNew ||\n opts[\"force new connection\"] ||\n false === opts.multiplex ||\n sameNamespace;\n let io;\n if (newConnection) {\n io = new Manager(source, opts);\n }\n else {\n if (!cache[id]) {\n cache[id] = new Manager(source, opts);\n }\n io = cache[id];\n }\n if (parsed.query && !opts.query) {\n opts.query = parsed.queryKey;\n }\n return io.socket(parsed.path, opts);\n}\n// so that \"lookup\" can be used both as a function (e.g. `io(...)`) and as a\n// namespace (e.g. `io.connect(...)`), for backward compatibility\nObject.assign(lookup, {\n Manager,\n Socket,\n io: lookup,\n connect: lookup,\n});\n/**\n * Protocol version.\n *\n * @public\n */\nexport { protocol } from \"socket.io-parser\";\n/**\n * Expose constructors for standalone build.\n *\n * @public\n */\nexport { Manager, Socket, lookup as io, lookup as connect, lookup as default, };\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n","import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n","import { API_URL, EVENTS_SOCKET } from '@/constants'\r\nimport { TMessage, TTemplateType } from '@/types/chatbox'\r\nimport { genId, getAddress } from '@/utils'\r\nimport { useQuery, useQueryClient } from '@tanstack/react-query'\r\nimport {\r\n createContext,\r\n useCallback,\r\n useEffect,\r\n useMemo,\r\n useRef,\r\n useState,\r\n} from 'react'\r\nimport { Socket, io } from 'socket.io-client'\r\nimport { useUnmount } from 'usehooks-ts'\r\n\r\nexport type TSocketCtx = {\r\n socket: Socket\r\n messages: TMessage[]\r\n channelId: string\r\n onEndBot?: () => void\r\n isTest?: boolean\r\n handleSendMessage: (options: {\r\n message: string\r\n cb?: (data: TMessage) => void\r\n type?: TTemplateType\r\n extraData?: string\r\n }) => void\r\n handleClose: () => void\r\n disableInput?: boolean\r\n isShowClose?: boolean\r\n isLoadingMessages?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n handleReload: () => void\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n handleTyping?: () => void\r\n adminId?: string\r\n isForManager?: boolean\r\n}\r\n\r\nexport const SocketCtx = createContext({} as TSocketCtx)\r\n\r\nexport type Props = {\r\n children: React.ReactNode\r\n channelId?: string\r\n onEndBot?: () => void\r\n className?: string\r\n isTest?: boolean\r\n onClose?: () => void\r\n isShowClose?: boolean\r\n isForLiveChat?: boolean\r\n userId?: string\r\n customStyles?: {\r\n color: string\r\n buttonSize: number\r\n position: {\r\n y: number\r\n x: number\r\n }\r\n windowSize: {\r\n width: number\r\n height: number\r\n }\r\n logoUrl?: string | undefined\r\n name?: string | undefined\r\n }\r\n isForPreview?: boolean\r\n isForManager?: boolean\r\n adminId?: string\r\n API_URL?: string\r\n}\r\n\r\nexport const SocketProvider = ({\r\n children,\r\n channelId,\r\n onEndBot,\r\n isTest = false,\r\n onClose,\r\n isShowClose = true,\r\n isForLiveChat,\r\n userId,\r\n customStyles: _customStyles,\r\n isForPreview,\r\n isForManager,\r\n adminId,\r\n ...props\r\n}: Props) => {\r\n const [disableInput, setDisableInput] = useState(false)\r\n const [customStyles, setCustomStyles] = useState(\r\n isForManager ? undefined : _customStyles,\r\n )\r\n\r\n const queryClient = useQueryClient()\r\n\r\n const urlParams = useMemo(\r\n () => new URLSearchParams(window.location.search),\r\n [],\r\n )\r\n\r\n const _userId = useMemo(() => (userId ? userId : genId()), [userId])\r\n const _channelId = useMemo(\r\n () => channelId || urlParams.get('channelId') || '',\r\n [channelId, urlParams],\r\n )\r\n\r\n const socketRef = useRef(\r\n io(props.API_URL || API_URL, {\r\n autoConnect: false,\r\n transports: ['websocket'],\r\n query: {\r\n userId: adminId ? `${_userId}_${adminId}` : _userId,\r\n },\r\n }),\r\n )\r\n\r\n const { data: messages, isLoading } = useQuery({\r\n queryKey: ['messages', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n if (isForPreview) {\r\n return [\r\n {\r\n isBot: true,\r\n message: 'Hello, how can I help you?',\r\n createdAt: new Date().toISOString(),\r\n },\r\n {\r\n isBot: false,\r\n message: 'I want to know more about your product',\r\n userId: genId(),\r\n createdAt: new Date().toISOString(),\r\n },\r\n ]\r\n }\r\n\r\n const res = await fetch(\r\n `${URL}/api/conversation-live-chat/${\r\n userId || genId()\r\n }/${_channelId}`,\r\n )\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Array\r\n } catch (error) {\r\n return []\r\n }\r\n },\r\n initialData: [],\r\n })\r\n\r\n const { data: custom } = useQuery({\r\n queryKey: ['custom-style', _channelId, userId || genId()],\r\n queryFn: async () => {\r\n try {\r\n const res = await fetch(\r\n `${props.API_URL || API_URL}/api/custom-chatbox/${_channelId}`,\r\n )\r\n\r\n const json = await res.json()\r\n\r\n const data = json.data\r\n\r\n return data as Record\r\n } catch (error) {\r\n return undefined\r\n }\r\n },\r\n enabled: !isTest && !isForPreview && !isForManager,\r\n })\r\n\r\n const handleSendMessage: TSocketCtx['handleSendMessage'] = useCallback(\r\n ({ message, cb, extraData, type }) => {\r\n const trimmedMessage = message.trim()\r\n if (trimmedMessage.length === 0) return\r\n\r\n const address = getAddress(_channelId, userId)\r\n\r\n const newMessage: TMessage = {\r\n message: type === 'list-button' ? extraData || '' : trimmedMessage,\r\n userId: adminId ? adminId : userId || genId(),\r\n template: {} as any,\r\n createdAt: new Date().toISOString(),\r\n isTest,\r\n }\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n message: trimmedMessage,\r\n address,\r\n isTest,\r\n createdAt: newMessage.createdAt,\r\n })\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, newMessage]\r\n },\r\n )\r\n\r\n cb && cb(newMessage)\r\n },\r\n [_channelId, adminId, isTest, queryClient, userId],\r\n )\r\n\r\n const handleClose = useCallback(() => {\r\n if (window.parent) {\r\n window.parent.postMessage(\r\n {\r\n type: 'TOGGLE_CHAT',\r\n },\r\n '*',\r\n )\r\n }\r\n onClose?.()\r\n }, [onClose])\r\n\r\n const handleReload = useCallback(() => {\r\n if (isForPreview) return\r\n\r\n socketRef.current.emit(EVENTS_SOCKET.MESSAGE, {\r\n type: 'event',\r\n typeName: 'endConversation',\r\n address: getAddress(_channelId, userId),\r\n isTest,\r\n message: '',\r\n })\r\n setDisableInput(false)\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n () => {\r\n return []\r\n },\r\n )\r\n }, [_channelId, isForPreview, isTest, queryClient, userId])\r\n\r\n useUnmount(() => {\r\n socketRef.current.disconnect()\r\n })\r\n\r\n useEffect(() => {\r\n // if customStyles is set, don't connect to socket because it for preview\r\n if (isForPreview) return\r\n\r\n const socket = socketRef.current\r\n\r\n socket.connect()\r\n\r\n socket.on(EVENTS_SOCKET.MESSAGE, (data) => {\r\n if (data.template?.type === 'list-button') {\r\n setDisableInput(true)\r\n } else {\r\n setDisableInput(false)\r\n }\r\n\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, data].filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return [...prev, { userId: 'typing' }]\r\n },\r\n )\r\n })\r\n\r\n socket.on(EVENTS_SOCKET.STOP_TYPING, () => {\r\n queryClient.setQueryData(\r\n ['messages', _channelId, userId || genId()],\r\n (prev: Array) => {\r\n return prev.filter((msg) => msg.userId !== 'typing')\r\n },\r\n )\r\n })\r\n\r\n return () => {\r\n socket.disconnect()\r\n }\r\n }, [_channelId, queryClient, userId, isForPreview])\r\n\r\n useEffect(() => {\r\n if (isForPreview) {\r\n setDisableInput(true)\r\n }\r\n }, [isForPreview])\r\n\r\n useEffect(() => {\r\n if (custom && !isForManager) {\r\n setCustomStyles(custom as any)\r\n }\r\n }, [custom, isForManager])\r\n\r\n useEffect(() => {\r\n if (_customStyles && !isForManager) {\r\n setCustomStyles(_customStyles)\r\n }\r\n }, [_customStyles, isForManager])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n","import { SocketCtx } from '@/context/socket.ctx'\r\nimport { useContext } from 'react'\r\n\r\n/**\r\n * Custom hook that provides access to the socket context.\r\n * @returns The socket context.\r\n * @throws {Error} If used outside of the SocketProvider.\r\n */\r\nexport const useSocket = () => {\r\n const socketCtx = useContext(SocketCtx)\r\n\r\n if (!socketCtx) {\r\n throw new Error('useSocket must be used within SocketProvider')\r\n }\r\n\r\n return socketCtx\r\n}\r\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t validator(classRest))?.classGroupId;\n}\nconst arbitraryPropertyRegex = /^\\[(.+)\\]$/;\nfunction getGroupIdForArbitraryProperty(className) {\n if (arbitraryPropertyRegex.test(className)) {\n const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];\n const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(':'));\n if (property) {\n // I use two dots here because one dot is used as prefix for class groups in plugins\n return 'arbitrary..' + property;\n }\n }\n}\n/**\n * Exported for testing only\n */\nfunction createClassMap(config) {\n const {\n theme,\n prefix\n } = config;\n const classMap = {\n nextPart: new Map(),\n validators: []\n };\n const prefixedClassGroupEntries = getPrefixedClassGroupEntries(Object.entries(config.classGroups), prefix);\n prefixedClassGroupEntries.forEach(([classGroupId, classGroup]) => {\n processClassesRecursively(classGroup, classMap, classGroupId, theme);\n });\n return classMap;\n}\nfunction processClassesRecursively(classGroup, classPartObject, classGroupId, theme) {\n classGroup.forEach(classDefinition => {\n if (typeof classDefinition === 'string') {\n const classPartObjectToEdit = classDefinition === '' ? classPartObject : getPart(classPartObject, classDefinition);\n classPartObjectToEdit.classGroupId = classGroupId;\n return;\n }\n if (typeof classDefinition === 'function') {\n if (isThemeGetter(classDefinition)) {\n processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);\n return;\n }\n classPartObject.validators.push({\n validator: classDefinition,\n classGroupId\n });\n return;\n }\n Object.entries(classDefinition).forEach(([key, classGroup]) => {\n processClassesRecursively(classGroup, getPart(classPartObject, key), classGroupId, theme);\n });\n });\n}\nfunction getPart(classPartObject, path) {\n let currentClassPartObject = classPartObject;\n path.split(CLASS_PART_SEPARATOR).forEach(pathPart => {\n if (!currentClassPartObject.nextPart.has(pathPart)) {\n currentClassPartObject.nextPart.set(pathPart, {\n nextPart: new Map(),\n validators: []\n });\n }\n currentClassPartObject = currentClassPartObject.nextPart.get(pathPart);\n });\n return currentClassPartObject;\n}\nfunction isThemeGetter(func) {\n return func.isThemeGetter;\n}\nfunction getPrefixedClassGroupEntries(classGroupEntries, prefix) {\n if (!prefix) {\n return classGroupEntries;\n }\n return classGroupEntries.map(([classGroupId, classGroup]) => {\n const prefixedClassGroup = classGroup.map(classDefinition => {\n if (typeof classDefinition === 'string') {\n return prefix + classDefinition;\n }\n if (typeof classDefinition === 'object') {\n return Object.fromEntries(Object.entries(classDefinition).map(([key, value]) => [prefix + key, value]));\n }\n return classDefinition;\n });\n return [classGroupId, prefixedClassGroup];\n });\n}\n\n// LRU cache inspired from hashlru (https://github.com/dominictarr/hashlru/blob/v1.0.4/index.js) but object replaced with Map to improve performance\nfunction createLruCache(maxCacheSize) {\n if (maxCacheSize < 1) {\n return {\n get: () => undefined,\n set: () => {}\n };\n }\n let cacheSize = 0;\n let cache = new Map();\n let previousCache = new Map();\n function update(key, value) {\n cache.set(key, value);\n cacheSize++;\n if (cacheSize > maxCacheSize) {\n cacheSize = 0;\n previousCache = cache;\n cache = new Map();\n }\n }\n return {\n get(key) {\n let value = cache.get(key);\n if (value !== undefined) {\n return value;\n }\n if ((value = previousCache.get(key)) !== undefined) {\n update(key, value);\n return value;\n }\n },\n set(key, value) {\n if (cache.has(key)) {\n cache.set(key, value);\n } else {\n update(key, value);\n }\n }\n };\n}\nconst IMPORTANT_MODIFIER = '!';\nfunction createSplitModifiers(config) {\n const separator = config.separator;\n const isSeparatorSingleCharacter = separator.length === 1;\n const firstSeparatorCharacter = separator[0];\n const separatorLength = separator.length;\n // splitModifiers inspired by https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js\n return function splitModifiers(className) {\n const modifiers = [];\n let bracketDepth = 0;\n let modifierStart = 0;\n let postfixModifierPosition;\n for (let index = 0; index < className.length; index++) {\n let currentCharacter = className[index];\n if (bracketDepth === 0) {\n if (currentCharacter === firstSeparatorCharacter && (isSeparatorSingleCharacter || className.slice(index, index + separatorLength) === separator)) {\n modifiers.push(className.slice(modifierStart, index));\n modifierStart = index + separatorLength;\n continue;\n }\n if (currentCharacter === '/') {\n postfixModifierPosition = index;\n continue;\n }\n }\n if (currentCharacter === '[') {\n bracketDepth++;\n } else if (currentCharacter === ']') {\n bracketDepth--;\n }\n }\n const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.substring(modifierStart);\n const hasImportantModifier = baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER);\n const baseClassName = hasImportantModifier ? baseClassNameWithImportantModifier.substring(1) : baseClassNameWithImportantModifier;\n const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : undefined;\n return {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n };\n };\n}\n/**\n * Sorts modifiers according to following schema:\n * - Predefined modifiers are sorted alphabetically\n * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it\n */\nfunction sortModifiers(modifiers) {\n if (modifiers.length <= 1) {\n return modifiers;\n }\n const sortedModifiers = [];\n let unsortedModifiers = [];\n modifiers.forEach(modifier => {\n const isArbitraryVariant = modifier[0] === '[';\n if (isArbitraryVariant) {\n sortedModifiers.push(...unsortedModifiers.sort(), modifier);\n unsortedModifiers = [];\n } else {\n unsortedModifiers.push(modifier);\n }\n });\n sortedModifiers.push(...unsortedModifiers.sort());\n return sortedModifiers;\n}\nfunction createConfigUtils(config) {\n return {\n cache: createLruCache(config.cacheSize),\n splitModifiers: createSplitModifiers(config),\n ...createClassUtils(config)\n };\n}\nconst SPLIT_CLASSES_REGEX = /\\s+/;\nfunction mergeClassList(classList, configUtils) {\n const {\n splitModifiers,\n getClassGroupId,\n getConflictingClassGroupIds\n } = configUtils;\n /**\n * Set of classGroupIds in following format:\n * `{importantModifier}{variantModifiers}{classGroupId}`\n * @example 'float'\n * @example 'hover:focus:bg-color'\n * @example 'md:!pr'\n */\n const classGroupsInConflict = new Set();\n return classList.trim().split(SPLIT_CLASSES_REGEX).map(originalClassName => {\n const {\n modifiers,\n hasImportantModifier,\n baseClassName,\n maybePostfixModifierPosition\n } = splitModifiers(originalClassName);\n let classGroupId = getClassGroupId(maybePostfixModifierPosition ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);\n let hasPostfixModifier = Boolean(maybePostfixModifierPosition);\n if (!classGroupId) {\n if (!maybePostfixModifierPosition) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n classGroupId = getClassGroupId(baseClassName);\n if (!classGroupId) {\n return {\n isTailwindClass: false,\n originalClassName\n };\n }\n hasPostfixModifier = false;\n }\n const variantModifier = sortModifiers(modifiers).join(':');\n const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;\n return {\n isTailwindClass: true,\n modifierId,\n classGroupId,\n originalClassName,\n hasPostfixModifier\n };\n }).reverse()\n // Last class in conflict wins, so we need to filter conflicting classes in reverse order.\n .filter(parsed => {\n if (!parsed.isTailwindClass) {\n return true;\n }\n const {\n modifierId,\n classGroupId,\n hasPostfixModifier\n } = parsed;\n const classId = modifierId + classGroupId;\n if (classGroupsInConflict.has(classId)) {\n return false;\n }\n classGroupsInConflict.add(classId);\n getConflictingClassGroupIds(classGroupId, hasPostfixModifier).forEach(group => classGroupsInConflict.add(modifierId + group));\n return true;\n }).reverse().map(parsed => parsed.originalClassName).join(' ');\n}\n\n/**\n * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.\n *\n * Specifically:\n * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js\n * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts\n *\n * Original code has MIT license: Copyright (c) Luke Edwards (lukeed.com)\n */\nfunction twJoin() {\n let index = 0;\n let argument;\n let resolvedValue;\n let string = '';\n while (index < arguments.length) {\n if (argument = arguments[index++]) {\n if (resolvedValue = toValue(argument)) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction toValue(mix) {\n if (typeof mix === 'string') {\n return mix;\n }\n let resolvedValue;\n let string = '';\n for (let k = 0; k < mix.length; k++) {\n if (mix[k]) {\n if (resolvedValue = toValue(mix[k])) {\n string && (string += ' ');\n string += resolvedValue;\n }\n }\n }\n return string;\n}\nfunction createTailwindMerge(createConfigFirst, ...createConfigRest) {\n let configUtils;\n let cacheGet;\n let cacheSet;\n let functionToCall = initTailwindMerge;\n function initTailwindMerge(classList) {\n const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());\n configUtils = createConfigUtils(config);\n cacheGet = configUtils.cache.get;\n cacheSet = configUtils.cache.set;\n functionToCall = tailwindMerge;\n return tailwindMerge(classList);\n }\n function tailwindMerge(classList) {\n const cachedResult = cacheGet(classList);\n if (cachedResult) {\n return cachedResult;\n }\n const result = mergeClassList(classList, configUtils);\n cacheSet(classList, result);\n return result;\n }\n return function callTailwindMerge() {\n return functionToCall(twJoin.apply(null, arguments));\n };\n}\nfunction fromTheme(key) {\n const themeGetter = theme => theme[key] || [];\n themeGetter.isThemeGetter = true;\n return themeGetter;\n}\nconst arbitraryValueRegex = /^\\[(?:([a-z-]+):)?(.+)\\]$/i;\nconst fractionRegex = /^\\d+\\/\\d+$/;\nconst stringLengths = /*#__PURE__*/new Set(['px', 'full', 'screen']);\nconst tshirtUnitRegex = /^(\\d+(\\.\\d+)?)?(xs|sm|md|lg|xl)$/;\nconst lengthUnitRegex = /\\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\\b(calc|min|max|clamp)\\(.+\\)|^0$/;\nconst colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\\(.+\\)$/;\n// Shadow always begins with x and y offset separated by underscore optionally prepended by inset\nconst shadowRegex = /^(inset_)?-?((\\d+)?\\.?(\\d+)[a-z]+|0)_-?((\\d+)?\\.?(\\d+)[a-z]+|0)/;\nconst imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\\(.+\\)$/;\nfunction isLength(value) {\n return isNumber(value) || stringLengths.has(value) || fractionRegex.test(value);\n}\nfunction isArbitraryLength(value) {\n return getIsArbitraryValue(value, 'length', isLengthOnly);\n}\nfunction isNumber(value) {\n return Boolean(value) && !Number.isNaN(Number(value));\n}\nfunction isArbitraryNumber(value) {\n return getIsArbitraryValue(value, 'number', isNumber);\n}\nfunction isInteger(value) {\n return Boolean(value) && Number.isInteger(Number(value));\n}\nfunction isPercent(value) {\n return value.endsWith('%') && isNumber(value.slice(0, -1));\n}\nfunction isArbitraryValue(value) {\n return arbitraryValueRegex.test(value);\n}\nfunction isTshirtSize(value) {\n return tshirtUnitRegex.test(value);\n}\nconst sizeLabels = /*#__PURE__*/new Set(['length', 'size', 'percentage']);\nfunction isArbitrarySize(value) {\n return getIsArbitraryValue(value, sizeLabels, isNever);\n}\nfunction isArbitraryPosition(value) {\n return getIsArbitraryValue(value, 'position', isNever);\n}\nconst imageLabels = /*#__PURE__*/new Set(['image', 'url']);\nfunction isArbitraryImage(value) {\n return getIsArbitraryValue(value, imageLabels, isImage);\n}\nfunction isArbitraryShadow(value) {\n return getIsArbitraryValue(value, '', isShadow);\n}\nfunction isAny() {\n return true;\n}\nfunction getIsArbitraryValue(value, label, testValue) {\n const result = arbitraryValueRegex.exec(value);\n if (result) {\n if (result[1]) {\n return typeof label === 'string' ? result[1] === label : label.has(result[1]);\n }\n return testValue(result[2]);\n }\n return false;\n}\nfunction isLengthOnly(value) {\n // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.\n // For example, `hsl(0 0% 0%)` would be classified as a length without this check.\n // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.\n return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);\n}\nfunction isNever() {\n return false;\n}\nfunction isShadow(value) {\n return shadowRegex.test(value);\n}\nfunction isImage(value) {\n return imageRegex.test(value);\n}\nconst validators = /*#__PURE__*/Object.defineProperty({\n __proto__: null,\n isAny,\n isArbitraryImage,\n isArbitraryLength,\n isArbitraryNumber,\n isArbitraryPosition,\n isArbitraryShadow,\n isArbitrarySize,\n isArbitraryValue,\n isInteger,\n isLength,\n isNumber,\n isPercent,\n isTshirtSize\n}, Symbol.toStringTag, {\n value: 'Module'\n});\nfunction getDefaultConfig() {\n const colors = fromTheme('colors');\n const spacing = fromTheme('spacing');\n const blur = fromTheme('blur');\n const brightness = fromTheme('brightness');\n const borderColor = fromTheme('borderColor');\n const borderRadius = fromTheme('borderRadius');\n const borderSpacing = fromTheme('borderSpacing');\n const borderWidth = fromTheme('borderWidth');\n const contrast = fromTheme('contrast');\n const grayscale = fromTheme('grayscale');\n const hueRotate = fromTheme('hueRotate');\n const invert = fromTheme('invert');\n const gap = fromTheme('gap');\n const gradientColorStops = fromTheme('gradientColorStops');\n const gradientColorStopPositions = fromTheme('gradientColorStopPositions');\n const inset = fromTheme('inset');\n const margin = fromTheme('margin');\n const opacity = fromTheme('opacity');\n const padding = fromTheme('padding');\n const saturate = fromTheme('saturate');\n const scale = fromTheme('scale');\n const sepia = fromTheme('sepia');\n const skew = fromTheme('skew');\n const space = fromTheme('space');\n const translate = fromTheme('translate');\n const getOverscroll = () => ['auto', 'contain', 'none'];\n const getOverflow = () => ['auto', 'hidden', 'clip', 'visible', 'scroll'];\n const getSpacingWithAutoAndArbitrary = () => ['auto', isArbitraryValue, spacing];\n const getSpacingWithArbitrary = () => [isArbitraryValue, spacing];\n const getLengthWithEmptyAndArbitrary = () => ['', isLength, isArbitraryLength];\n const getNumberWithAutoAndArbitrary = () => ['auto', isNumber, isArbitraryValue];\n const getPositions = () => ['bottom', 'center', 'left', 'left-bottom', 'left-top', 'right', 'right-bottom', 'right-top', 'top'];\n const getLineStyles = () => ['solid', 'dashed', 'dotted', 'double', 'none'];\n const getBlendModes = () => ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'hard-light', 'soft-light', 'difference', 'exclusion', 'hue', 'saturation', 'color', 'luminosity', 'plus-lighter'];\n const getAlign = () => ['start', 'end', 'center', 'between', 'around', 'evenly', 'stretch'];\n const getZeroAndEmpty = () => ['', '0', isArbitraryValue];\n const getBreaks = () => ['auto', 'avoid', 'all', 'avoid-page', 'page', 'left', 'right', 'column'];\n const getNumber = () => [isNumber, isArbitraryNumber];\n const getNumberAndArbitrary = () => [isNumber, isArbitraryValue];\n return {\n cacheSize: 500,\n separator: ':',\n theme: {\n colors: [isAny],\n spacing: [isLength, isArbitraryLength],\n blur: ['none', '', isTshirtSize, isArbitraryValue],\n brightness: getNumber(),\n borderColor: [colors],\n borderRadius: ['none', '', 'full', isTshirtSize, isArbitraryValue],\n borderSpacing: getSpacingWithArbitrary(),\n borderWidth: getLengthWithEmptyAndArbitrary(),\n contrast: getNumber(),\n grayscale: getZeroAndEmpty(),\n hueRotate: getNumberAndArbitrary(),\n invert: getZeroAndEmpty(),\n gap: getSpacingWithArbitrary(),\n gradientColorStops: [colors],\n gradientColorStopPositions: [isPercent, isArbitraryLength],\n inset: getSpacingWithAutoAndArbitrary(),\n margin: getSpacingWithAutoAndArbitrary(),\n opacity: getNumber(),\n padding: getSpacingWithArbitrary(),\n saturate: getNumber(),\n scale: getNumber(),\n sepia: getZeroAndEmpty(),\n skew: getNumberAndArbitrary(),\n space: getSpacingWithArbitrary(),\n translate: getSpacingWithArbitrary()\n },\n classGroups: {\n // Layout\n /**\n * Aspect Ratio\n * @see https://tailwindcss.com/docs/aspect-ratio\n */\n aspect: [{\n aspect: ['auto', 'square', 'video', isArbitraryValue]\n }],\n /**\n * Container\n * @see https://tailwindcss.com/docs/container\n */\n container: ['container'],\n /**\n * Columns\n * @see https://tailwindcss.com/docs/columns\n */\n columns: [{\n columns: [isTshirtSize]\n }],\n /**\n * Break After\n * @see https://tailwindcss.com/docs/break-after\n */\n 'break-after': [{\n 'break-after': getBreaks()\n }],\n /**\n * Break Before\n * @see https://tailwindcss.com/docs/break-before\n */\n 'break-before': [{\n 'break-before': getBreaks()\n }],\n /**\n * Break Inside\n * @see https://tailwindcss.com/docs/break-inside\n */\n 'break-inside': [{\n 'break-inside': ['auto', 'avoid', 'avoid-page', 'avoid-column']\n }],\n /**\n * Box Decoration Break\n * @see https://tailwindcss.com/docs/box-decoration-break\n */\n 'box-decoration': [{\n 'box-decoration': ['slice', 'clone']\n }],\n /**\n * Box Sizing\n * @see https://tailwindcss.com/docs/box-sizing\n */\n box: [{\n box: ['border', 'content']\n }],\n /**\n * Display\n * @see https://tailwindcss.com/docs/display\n */\n display: ['block', 'inline-block', 'inline', 'flex', 'inline-flex', 'table', 'inline-table', 'table-caption', 'table-cell', 'table-column', 'table-column-group', 'table-footer-group', 'table-header-group', 'table-row-group', 'table-row', 'flow-root', 'grid', 'inline-grid', 'contents', 'list-item', 'hidden'],\n /**\n * Floats\n * @see https://tailwindcss.com/docs/float\n */\n float: [{\n float: ['right', 'left', 'none', 'start', 'end']\n }],\n /**\n * Clear\n * @see https://tailwindcss.com/docs/clear\n */\n clear: [{\n clear: ['left', 'right', 'both', 'none', 'start', 'end']\n }],\n /**\n * Isolation\n * @see https://tailwindcss.com/docs/isolation\n */\n isolation: ['isolate', 'isolation-auto'],\n /**\n * Object Fit\n * @see https://tailwindcss.com/docs/object-fit\n */\n 'object-fit': [{\n object: ['contain', 'cover', 'fill', 'none', 'scale-down']\n }],\n /**\n * Object Position\n * @see https://tailwindcss.com/docs/object-position\n */\n 'object-position': [{\n object: [...getPositions(), isArbitraryValue]\n }],\n /**\n * Overflow\n * @see https://tailwindcss.com/docs/overflow\n */\n overflow: [{\n overflow: getOverflow()\n }],\n /**\n * Overflow X\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-x': [{\n 'overflow-x': getOverflow()\n }],\n /**\n * Overflow Y\n * @see https://tailwindcss.com/docs/overflow\n */\n 'overflow-y': [{\n 'overflow-y': getOverflow()\n }],\n /**\n * Overscroll Behavior\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n overscroll: [{\n overscroll: getOverscroll()\n }],\n /**\n * Overscroll Behavior X\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-x': [{\n 'overscroll-x': getOverscroll()\n }],\n /**\n * Overscroll Behavior Y\n * @see https://tailwindcss.com/docs/overscroll-behavior\n */\n 'overscroll-y': [{\n 'overscroll-y': getOverscroll()\n }],\n /**\n * Position\n * @see https://tailwindcss.com/docs/position\n */\n position: ['static', 'fixed', 'absolute', 'relative', 'sticky'],\n /**\n * Top / Right / Bottom / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n inset: [{\n inset: [inset]\n }],\n /**\n * Right / Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-x': [{\n 'inset-x': [inset]\n }],\n /**\n * Top / Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n 'inset-y': [{\n 'inset-y': [inset]\n }],\n /**\n * Start\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n start: [{\n start: [inset]\n }],\n /**\n * End\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n end: [{\n end: [inset]\n }],\n /**\n * Top\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n top: [{\n top: [inset]\n }],\n /**\n * Right\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n right: [{\n right: [inset]\n }],\n /**\n * Bottom\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n bottom: [{\n bottom: [inset]\n }],\n /**\n * Left\n * @see https://tailwindcss.com/docs/top-right-bottom-left\n */\n left: [{\n left: [inset]\n }],\n /**\n * Visibility\n * @see https://tailwindcss.com/docs/visibility\n */\n visibility: ['visible', 'invisible', 'collapse'],\n /**\n * Z-Index\n * @see https://tailwindcss.com/docs/z-index\n */\n z: [{\n z: ['auto', isInteger, isArbitraryValue]\n }],\n // Flexbox and Grid\n /**\n * Flex Basis\n * @see https://tailwindcss.com/docs/flex-basis\n */\n basis: [{\n basis: getSpacingWithAutoAndArbitrary()\n }],\n /**\n * Flex Direction\n * @see https://tailwindcss.com/docs/flex-direction\n */\n 'flex-direction': [{\n flex: ['row', 'row-reverse', 'col', 'col-reverse']\n }],\n /**\n * Flex Wrap\n * @see https://tailwindcss.com/docs/flex-wrap\n */\n 'flex-wrap': [{\n flex: ['wrap', 'wrap-reverse', 'nowrap']\n }],\n /**\n * Flex\n * @see https://tailwindcss.com/docs/flex\n */\n flex: [{\n flex: ['1', 'auto', 'initial', 'none', isArbitraryValue]\n }],\n /**\n * Flex Grow\n * @see https://tailwindcss.com/docs/flex-grow\n */\n grow: [{\n grow: getZeroAndEmpty()\n }],\n /**\n * Flex Shrink\n * @see https://tailwindcss.com/docs/flex-shrink\n */\n shrink: [{\n shrink: getZeroAndEmpty()\n }],\n /**\n * Order\n * @see https://tailwindcss.com/docs/order\n */\n order: [{\n order: ['first', 'last', 'none', isInteger, isArbitraryValue]\n }],\n /**\n * Grid Template Columns\n * @see https://tailwindcss.com/docs/grid-template-columns\n */\n 'grid-cols': [{\n 'grid-cols': [isAny]\n }],\n /**\n * Grid Column Start / End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start-end': [{\n col: ['auto', {\n span: ['full', isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Column Start\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-start': [{\n 'col-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Column End\n * @see https://tailwindcss.com/docs/grid-column\n */\n 'col-end': [{\n 'col-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Template Rows\n * @see https://tailwindcss.com/docs/grid-template-rows\n */\n 'grid-rows': [{\n 'grid-rows': [isAny]\n }],\n /**\n * Grid Row Start / End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start-end': [{\n row: ['auto', {\n span: [isInteger, isArbitraryValue]\n }, isArbitraryValue]\n }],\n /**\n * Grid Row Start\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-start': [{\n 'row-start': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Row End\n * @see https://tailwindcss.com/docs/grid-row\n */\n 'row-end': [{\n 'row-end': getNumberWithAutoAndArbitrary()\n }],\n /**\n * Grid Auto Flow\n * @see https://tailwindcss.com/docs/grid-auto-flow\n */\n 'grid-flow': [{\n 'grid-flow': ['row', 'col', 'dense', 'row-dense', 'col-dense']\n }],\n /**\n * Grid Auto Columns\n * @see https://tailwindcss.com/docs/grid-auto-columns\n */\n 'auto-cols': [{\n 'auto-cols': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Grid Auto Rows\n * @see https://tailwindcss.com/docs/grid-auto-rows\n */\n 'auto-rows': [{\n 'auto-rows': ['auto', 'min', 'max', 'fr', isArbitraryValue]\n }],\n /**\n * Gap\n * @see https://tailwindcss.com/docs/gap\n */\n gap: [{\n gap: [gap]\n }],\n /**\n * Gap X\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-x': [{\n 'gap-x': [gap]\n }],\n /**\n * Gap Y\n * @see https://tailwindcss.com/docs/gap\n */\n 'gap-y': [{\n 'gap-y': [gap]\n }],\n /**\n * Justify Content\n * @see https://tailwindcss.com/docs/justify-content\n */\n 'justify-content': [{\n justify: ['normal', ...getAlign()]\n }],\n /**\n * Justify Items\n * @see https://tailwindcss.com/docs/justify-items\n */\n 'justify-items': [{\n 'justify-items': ['start', 'end', 'center', 'stretch']\n }],\n /**\n * Justify Self\n * @see https://tailwindcss.com/docs/justify-self\n */\n 'justify-self': [{\n 'justify-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n /**\n * Align Content\n * @see https://tailwindcss.com/docs/align-content\n */\n 'align-content': [{\n content: ['normal', ...getAlign(), 'baseline']\n }],\n /**\n * Align Items\n * @see https://tailwindcss.com/docs/align-items\n */\n 'align-items': [{\n items: ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Align Self\n * @see https://tailwindcss.com/docs/align-self\n */\n 'align-self': [{\n self: ['auto', 'start', 'end', 'center', 'stretch', 'baseline']\n }],\n /**\n * Place Content\n * @see https://tailwindcss.com/docs/place-content\n */\n 'place-content': [{\n 'place-content': [...getAlign(), 'baseline']\n }],\n /**\n * Place Items\n * @see https://tailwindcss.com/docs/place-items\n */\n 'place-items': [{\n 'place-items': ['start', 'end', 'center', 'baseline', 'stretch']\n }],\n /**\n * Place Self\n * @see https://tailwindcss.com/docs/place-self\n */\n 'place-self': [{\n 'place-self': ['auto', 'start', 'end', 'center', 'stretch']\n }],\n // Spacing\n /**\n * Padding\n * @see https://tailwindcss.com/docs/padding\n */\n p: [{\n p: [padding]\n }],\n /**\n * Padding X\n * @see https://tailwindcss.com/docs/padding\n */\n px: [{\n px: [padding]\n }],\n /**\n * Padding Y\n * @see https://tailwindcss.com/docs/padding\n */\n py: [{\n py: [padding]\n }],\n /**\n * Padding Start\n * @see https://tailwindcss.com/docs/padding\n */\n ps: [{\n ps: [padding]\n }],\n /**\n * Padding End\n * @see https://tailwindcss.com/docs/padding\n */\n pe: [{\n pe: [padding]\n }],\n /**\n * Padding Top\n * @see https://tailwindcss.com/docs/padding\n */\n pt: [{\n pt: [padding]\n }],\n /**\n * Padding Right\n * @see https://tailwindcss.com/docs/padding\n */\n pr: [{\n pr: [padding]\n }],\n /**\n * Padding Bottom\n * @see https://tailwindcss.com/docs/padding\n */\n pb: [{\n pb: [padding]\n }],\n /**\n * Padding Left\n * @see https://tailwindcss.com/docs/padding\n */\n pl: [{\n pl: [padding]\n }],\n /**\n * Margin\n * @see https://tailwindcss.com/docs/margin\n */\n m: [{\n m: [margin]\n }],\n /**\n * Margin X\n * @see https://tailwindcss.com/docs/margin\n */\n mx: [{\n mx: [margin]\n }],\n /**\n * Margin Y\n * @see https://tailwindcss.com/docs/margin\n */\n my: [{\n my: [margin]\n }],\n /**\n * Margin Start\n * @see https://tailwindcss.com/docs/margin\n */\n ms: [{\n ms: [margin]\n }],\n /**\n * Margin End\n * @see https://tailwindcss.com/docs/margin\n */\n me: [{\n me: [margin]\n }],\n /**\n * Margin Top\n * @see https://tailwindcss.com/docs/margin\n */\n mt: [{\n mt: [margin]\n }],\n /**\n * Margin Right\n * @see https://tailwindcss.com/docs/margin\n */\n mr: [{\n mr: [margin]\n }],\n /**\n * Margin Bottom\n * @see https://tailwindcss.com/docs/margin\n */\n mb: [{\n mb: [margin]\n }],\n /**\n * Margin Left\n * @see https://tailwindcss.com/docs/margin\n */\n ml: [{\n ml: [margin]\n }],\n /**\n * Space Between X\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x': [{\n 'space-x': [space]\n }],\n /**\n * Space Between X Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-x-reverse': ['space-x-reverse'],\n /**\n * Space Between Y\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y': [{\n 'space-y': [space]\n }],\n /**\n * Space Between Y Reverse\n * @see https://tailwindcss.com/docs/space\n */\n 'space-y-reverse': ['space-y-reverse'],\n // Sizing\n /**\n * Width\n * @see https://tailwindcss.com/docs/width\n */\n w: [{\n w: ['auto', 'min', 'max', 'fit', 'svw', 'lvw', 'dvw', isArbitraryValue, spacing]\n }],\n /**\n * Min-Width\n * @see https://tailwindcss.com/docs/min-width\n */\n 'min-w': [{\n 'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit']\n }],\n /**\n * Max-Width\n * @see https://tailwindcss.com/docs/max-width\n */\n 'max-w': [{\n 'max-w': [isArbitraryValue, spacing, 'none', 'full', 'min', 'max', 'fit', 'prose', {\n screen: [isTshirtSize]\n }, isTshirtSize]\n }],\n /**\n * Height\n * @see https://tailwindcss.com/docs/height\n */\n h: [{\n h: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Min-Height\n * @see https://tailwindcss.com/docs/min-height\n */\n 'min-h': [{\n 'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Max-Height\n * @see https://tailwindcss.com/docs/max-height\n */\n 'max-h': [{\n 'max-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh']\n }],\n /**\n * Size\n * @see https://tailwindcss.com/docs/size\n */\n size: [{\n size: [isArbitraryValue, spacing, 'auto', 'min', 'max', 'fit']\n }],\n // Typography\n /**\n * Font Size\n * @see https://tailwindcss.com/docs/font-size\n */\n 'font-size': [{\n text: ['base', isTshirtSize, isArbitraryLength]\n }],\n /**\n * Font Smoothing\n * @see https://tailwindcss.com/docs/font-smoothing\n */\n 'font-smoothing': ['antialiased', 'subpixel-antialiased'],\n /**\n * Font Style\n * @see https://tailwindcss.com/docs/font-style\n */\n 'font-style': ['italic', 'not-italic'],\n /**\n * Font Weight\n * @see https://tailwindcss.com/docs/font-weight\n */\n 'font-weight': [{\n font: ['thin', 'extralight', 'light', 'normal', 'medium', 'semibold', 'bold', 'extrabold', 'black', isArbitraryNumber]\n }],\n /**\n * Font Family\n * @see https://tailwindcss.com/docs/font-family\n */\n 'font-family': [{\n font: [isAny]\n }],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-normal': ['normal-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-ordinal': ['ordinal'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-slashed-zero': ['slashed-zero'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-figure': ['lining-nums', 'oldstyle-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-spacing': ['proportional-nums', 'tabular-nums'],\n /**\n * Font Variant Numeric\n * @see https://tailwindcss.com/docs/font-variant-numeric\n */\n 'fvn-fraction': ['diagonal-fractions', 'stacked-fractons'],\n /**\n * Letter Spacing\n * @see https://tailwindcss.com/docs/letter-spacing\n */\n tracking: [{\n tracking: ['tighter', 'tight', 'normal', 'wide', 'wider', 'widest', isArbitraryValue]\n }],\n /**\n * Line Clamp\n * @see https://tailwindcss.com/docs/line-clamp\n */\n 'line-clamp': [{\n 'line-clamp': ['none', isNumber, isArbitraryNumber]\n }],\n /**\n * Line Height\n * @see https://tailwindcss.com/docs/line-height\n */\n leading: [{\n leading: ['none', 'tight', 'snug', 'normal', 'relaxed', 'loose', isLength, isArbitraryValue]\n }],\n /**\n * List Style Image\n * @see https://tailwindcss.com/docs/list-style-image\n */\n 'list-image': [{\n 'list-image': ['none', isArbitraryValue]\n }],\n /**\n * List Style Type\n * @see https://tailwindcss.com/docs/list-style-type\n */\n 'list-style-type': [{\n list: ['none', 'disc', 'decimal', isArbitraryValue]\n }],\n /**\n * List Style Position\n * @see https://tailwindcss.com/docs/list-style-position\n */\n 'list-style-position': [{\n list: ['inside', 'outside']\n }],\n /**\n * Placeholder Color\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/placeholder-color\n */\n 'placeholder-color': [{\n placeholder: [colors]\n }],\n /**\n * Placeholder Opacity\n * @see https://tailwindcss.com/docs/placeholder-opacity\n */\n 'placeholder-opacity': [{\n 'placeholder-opacity': [opacity]\n }],\n /**\n * Text Alignment\n * @see https://tailwindcss.com/docs/text-align\n */\n 'text-alignment': [{\n text: ['left', 'center', 'right', 'justify', 'start', 'end']\n }],\n /**\n * Text Color\n * @see https://tailwindcss.com/docs/text-color\n */\n 'text-color': [{\n text: [colors]\n }],\n /**\n * Text Opacity\n * @see https://tailwindcss.com/docs/text-opacity\n */\n 'text-opacity': [{\n 'text-opacity': [opacity]\n }],\n /**\n * Text Decoration\n * @see https://tailwindcss.com/docs/text-decoration\n */\n 'text-decoration': ['underline', 'overline', 'line-through', 'no-underline'],\n /**\n * Text Decoration Style\n * @see https://tailwindcss.com/docs/text-decoration-style\n */\n 'text-decoration-style': [{\n decoration: [...getLineStyles(), 'wavy']\n }],\n /**\n * Text Decoration Thickness\n * @see https://tailwindcss.com/docs/text-decoration-thickness\n */\n 'text-decoration-thickness': [{\n decoration: ['auto', 'from-font', isLength, isArbitraryLength]\n }],\n /**\n * Text Underline Offset\n * @see https://tailwindcss.com/docs/text-underline-offset\n */\n 'underline-offset': [{\n 'underline-offset': ['auto', isLength, isArbitraryValue]\n }],\n /**\n * Text Decoration Color\n * @see https://tailwindcss.com/docs/text-decoration-color\n */\n 'text-decoration-color': [{\n decoration: [colors]\n }],\n /**\n * Text Transform\n * @see https://tailwindcss.com/docs/text-transform\n */\n 'text-transform': ['uppercase', 'lowercase', 'capitalize', 'normal-case'],\n /**\n * Text Overflow\n * @see https://tailwindcss.com/docs/text-overflow\n */\n 'text-overflow': ['truncate', 'text-ellipsis', 'text-clip'],\n /**\n * Text Wrap\n * @see https://tailwindcss.com/docs/text-wrap\n */\n 'text-wrap': [{\n text: ['wrap', 'nowrap', 'balance', 'pretty']\n }],\n /**\n * Text Indent\n * @see https://tailwindcss.com/docs/text-indent\n */\n indent: [{\n indent: getSpacingWithArbitrary()\n }],\n /**\n * Vertical Alignment\n * @see https://tailwindcss.com/docs/vertical-align\n */\n 'vertical-align': [{\n align: ['baseline', 'top', 'middle', 'bottom', 'text-top', 'text-bottom', 'sub', 'super', isArbitraryValue]\n }],\n /**\n * Whitespace\n * @see https://tailwindcss.com/docs/whitespace\n */\n whitespace: [{\n whitespace: ['normal', 'nowrap', 'pre', 'pre-line', 'pre-wrap', 'break-spaces']\n }],\n /**\n * Word Break\n * @see https://tailwindcss.com/docs/word-break\n */\n break: [{\n break: ['normal', 'words', 'all', 'keep']\n }],\n /**\n * Hyphens\n * @see https://tailwindcss.com/docs/hyphens\n */\n hyphens: [{\n hyphens: ['none', 'manual', 'auto']\n }],\n /**\n * Content\n * @see https://tailwindcss.com/docs/content\n */\n content: [{\n content: ['none', isArbitraryValue]\n }],\n // Backgrounds\n /**\n * Background Attachment\n * @see https://tailwindcss.com/docs/background-attachment\n */\n 'bg-attachment': [{\n bg: ['fixed', 'local', 'scroll']\n }],\n /**\n * Background Clip\n * @see https://tailwindcss.com/docs/background-clip\n */\n 'bg-clip': [{\n 'bg-clip': ['border', 'padding', 'content', 'text']\n }],\n /**\n * Background Opacity\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/background-opacity\n */\n 'bg-opacity': [{\n 'bg-opacity': [opacity]\n }],\n /**\n * Background Origin\n * @see https://tailwindcss.com/docs/background-origin\n */\n 'bg-origin': [{\n 'bg-origin': ['border', 'padding', 'content']\n }],\n /**\n * Background Position\n * @see https://tailwindcss.com/docs/background-position\n */\n 'bg-position': [{\n bg: [...getPositions(), isArbitraryPosition]\n }],\n /**\n * Background Repeat\n * @see https://tailwindcss.com/docs/background-repeat\n */\n 'bg-repeat': [{\n bg: ['no-repeat', {\n repeat: ['', 'x', 'y', 'round', 'space']\n }]\n }],\n /**\n * Background Size\n * @see https://tailwindcss.com/docs/background-size\n */\n 'bg-size': [{\n bg: ['auto', 'cover', 'contain', isArbitrarySize]\n }],\n /**\n * Background Image\n * @see https://tailwindcss.com/docs/background-image\n */\n 'bg-image': [{\n bg: ['none', {\n 'gradient-to': ['t', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl']\n }, isArbitraryImage]\n }],\n /**\n * Background Color\n * @see https://tailwindcss.com/docs/background-color\n */\n 'bg-color': [{\n bg: [colors]\n }],\n /**\n * Gradient Color Stops From Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from-pos': [{\n from: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops Via Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via-pos': [{\n via: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops To Position\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to-pos': [{\n to: [gradientColorStopPositions]\n }],\n /**\n * Gradient Color Stops From\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-from': [{\n from: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops Via\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-via': [{\n via: [gradientColorStops]\n }],\n /**\n * Gradient Color Stops To\n * @see https://tailwindcss.com/docs/gradient-color-stops\n */\n 'gradient-to': [{\n to: [gradientColorStops]\n }],\n // Borders\n /**\n * Border Radius\n * @see https://tailwindcss.com/docs/border-radius\n */\n rounded: [{\n rounded: [borderRadius]\n }],\n /**\n * Border Radius Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-s': [{\n 'rounded-s': [borderRadius]\n }],\n /**\n * Border Radius End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-e': [{\n 'rounded-e': [borderRadius]\n }],\n /**\n * Border Radius Top\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-t': [{\n 'rounded-t': [borderRadius]\n }],\n /**\n * Border Radius Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-r': [{\n 'rounded-r': [borderRadius]\n }],\n /**\n * Border Radius Bottom\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-b': [{\n 'rounded-b': [borderRadius]\n }],\n /**\n * Border Radius Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-l': [{\n 'rounded-l': [borderRadius]\n }],\n /**\n * Border Radius Start Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ss': [{\n 'rounded-ss': [borderRadius]\n }],\n /**\n * Border Radius Start End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-se': [{\n 'rounded-se': [borderRadius]\n }],\n /**\n * Border Radius End End\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-ee': [{\n 'rounded-ee': [borderRadius]\n }],\n /**\n * Border Radius End Start\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-es': [{\n 'rounded-es': [borderRadius]\n }],\n /**\n * Border Radius Top Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tl': [{\n 'rounded-tl': [borderRadius]\n }],\n /**\n * Border Radius Top Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-tr': [{\n 'rounded-tr': [borderRadius]\n }],\n /**\n * Border Radius Bottom Right\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-br': [{\n 'rounded-br': [borderRadius]\n }],\n /**\n * Border Radius Bottom Left\n * @see https://tailwindcss.com/docs/border-radius\n */\n 'rounded-bl': [{\n 'rounded-bl': [borderRadius]\n }],\n /**\n * Border Width\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w': [{\n border: [borderWidth]\n }],\n /**\n * Border Width X\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-x': [{\n 'border-x': [borderWidth]\n }],\n /**\n * Border Width Y\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-y': [{\n 'border-y': [borderWidth]\n }],\n /**\n * Border Width Start\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-s': [{\n 'border-s': [borderWidth]\n }],\n /**\n * Border Width End\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-e': [{\n 'border-e': [borderWidth]\n }],\n /**\n * Border Width Top\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-t': [{\n 'border-t': [borderWidth]\n }],\n /**\n * Border Width Right\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-r': [{\n 'border-r': [borderWidth]\n }],\n /**\n * Border Width Bottom\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-b': [{\n 'border-b': [borderWidth]\n }],\n /**\n * Border Width Left\n * @see https://tailwindcss.com/docs/border-width\n */\n 'border-w-l': [{\n 'border-l': [borderWidth]\n }],\n /**\n * Border Opacity\n * @see https://tailwindcss.com/docs/border-opacity\n */\n 'border-opacity': [{\n 'border-opacity': [opacity]\n }],\n /**\n * Border Style\n * @see https://tailwindcss.com/docs/border-style\n */\n 'border-style': [{\n border: [...getLineStyles(), 'hidden']\n }],\n /**\n * Divide Width X\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x': [{\n 'divide-x': [borderWidth]\n }],\n /**\n * Divide Width X Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-x-reverse': ['divide-x-reverse'],\n /**\n * Divide Width Y\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y': [{\n 'divide-y': [borderWidth]\n }],\n /**\n * Divide Width Y Reverse\n * @see https://tailwindcss.com/docs/divide-width\n */\n 'divide-y-reverse': ['divide-y-reverse'],\n /**\n * Divide Opacity\n * @see https://tailwindcss.com/docs/divide-opacity\n */\n 'divide-opacity': [{\n 'divide-opacity': [opacity]\n }],\n /**\n * Divide Style\n * @see https://tailwindcss.com/docs/divide-style\n */\n 'divide-style': [{\n divide: getLineStyles()\n }],\n /**\n * Border Color\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color': [{\n border: [borderColor]\n }],\n /**\n * Border Color X\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-x': [{\n 'border-x': [borderColor]\n }],\n /**\n * Border Color Y\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-y': [{\n 'border-y': [borderColor]\n }],\n /**\n * Border Color Top\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-t': [{\n 'border-t': [borderColor]\n }],\n /**\n * Border Color Right\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-r': [{\n 'border-r': [borderColor]\n }],\n /**\n * Border Color Bottom\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-b': [{\n 'border-b': [borderColor]\n }],\n /**\n * Border Color Left\n * @see https://tailwindcss.com/docs/border-color\n */\n 'border-color-l': [{\n 'border-l': [borderColor]\n }],\n /**\n * Divide Color\n * @see https://tailwindcss.com/docs/divide-color\n */\n 'divide-color': [{\n divide: [borderColor]\n }],\n /**\n * Outline Style\n * @see https://tailwindcss.com/docs/outline-style\n */\n 'outline-style': [{\n outline: ['', ...getLineStyles()]\n }],\n /**\n * Outline Offset\n * @see https://tailwindcss.com/docs/outline-offset\n */\n 'outline-offset': [{\n 'outline-offset': [isLength, isArbitraryValue]\n }],\n /**\n * Outline Width\n * @see https://tailwindcss.com/docs/outline-width\n */\n 'outline-w': [{\n outline: [isLength, isArbitraryLength]\n }],\n /**\n * Outline Color\n * @see https://tailwindcss.com/docs/outline-color\n */\n 'outline-color': [{\n outline: [colors]\n }],\n /**\n * Ring Width\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w': [{\n ring: getLengthWithEmptyAndArbitrary()\n }],\n /**\n * Ring Width Inset\n * @see https://tailwindcss.com/docs/ring-width\n */\n 'ring-w-inset': ['ring-inset'],\n /**\n * Ring Color\n * @see https://tailwindcss.com/docs/ring-color\n */\n 'ring-color': [{\n ring: [colors]\n }],\n /**\n * Ring Opacity\n * @see https://tailwindcss.com/docs/ring-opacity\n */\n 'ring-opacity': [{\n 'ring-opacity': [opacity]\n }],\n /**\n * Ring Offset Width\n * @see https://tailwindcss.com/docs/ring-offset-width\n */\n 'ring-offset-w': [{\n 'ring-offset': [isLength, isArbitraryLength]\n }],\n /**\n * Ring Offset Color\n * @see https://tailwindcss.com/docs/ring-offset-color\n */\n 'ring-offset-color': [{\n 'ring-offset': [colors]\n }],\n // Effects\n /**\n * Box Shadow\n * @see https://tailwindcss.com/docs/box-shadow\n */\n shadow: [{\n shadow: ['', 'inner', 'none', isTshirtSize, isArbitraryShadow]\n }],\n /**\n * Box Shadow Color\n * @see https://tailwindcss.com/docs/box-shadow-color\n */\n 'shadow-color': [{\n shadow: [isAny]\n }],\n /**\n * Opacity\n * @see https://tailwindcss.com/docs/opacity\n */\n opacity: [{\n opacity: [opacity]\n }],\n /**\n * Mix Blend Mode\n * @see https://tailwindcss.com/docs/mix-blend-mode\n */\n 'mix-blend': [{\n 'mix-blend': getBlendModes()\n }],\n /**\n * Background Blend Mode\n * @see https://tailwindcss.com/docs/background-blend-mode\n */\n 'bg-blend': [{\n 'bg-blend': getBlendModes()\n }],\n // Filters\n /**\n * Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/filter\n */\n filter: [{\n filter: ['', 'none']\n }],\n /**\n * Blur\n * @see https://tailwindcss.com/docs/blur\n */\n blur: [{\n blur: [blur]\n }],\n /**\n * Brightness\n * @see https://tailwindcss.com/docs/brightness\n */\n brightness: [{\n brightness: [brightness]\n }],\n /**\n * Contrast\n * @see https://tailwindcss.com/docs/contrast\n */\n contrast: [{\n contrast: [contrast]\n }],\n /**\n * Drop Shadow\n * @see https://tailwindcss.com/docs/drop-shadow\n */\n 'drop-shadow': [{\n 'drop-shadow': ['', 'none', isTshirtSize, isArbitraryValue]\n }],\n /**\n * Grayscale\n * @see https://tailwindcss.com/docs/grayscale\n */\n grayscale: [{\n grayscale: [grayscale]\n }],\n /**\n * Hue Rotate\n * @see https://tailwindcss.com/docs/hue-rotate\n */\n 'hue-rotate': [{\n 'hue-rotate': [hueRotate]\n }],\n /**\n * Invert\n * @see https://tailwindcss.com/docs/invert\n */\n invert: [{\n invert: [invert]\n }],\n /**\n * Saturate\n * @see https://tailwindcss.com/docs/saturate\n */\n saturate: [{\n saturate: [saturate]\n }],\n /**\n * Sepia\n * @see https://tailwindcss.com/docs/sepia\n */\n sepia: [{\n sepia: [sepia]\n }],\n /**\n * Backdrop Filter\n * @deprecated since Tailwind CSS v3.0.0\n * @see https://tailwindcss.com/docs/backdrop-filter\n */\n 'backdrop-filter': [{\n 'backdrop-filter': ['', 'none']\n }],\n /**\n * Backdrop Blur\n * @see https://tailwindcss.com/docs/backdrop-blur\n */\n 'backdrop-blur': [{\n 'backdrop-blur': [blur]\n }],\n /**\n * Backdrop Brightness\n * @see https://tailwindcss.com/docs/backdrop-brightness\n */\n 'backdrop-brightness': [{\n 'backdrop-brightness': [brightness]\n }],\n /**\n * Backdrop Contrast\n * @see https://tailwindcss.com/docs/backdrop-contrast\n */\n 'backdrop-contrast': [{\n 'backdrop-contrast': [contrast]\n }],\n /**\n * Backdrop Grayscale\n * @see https://tailwindcss.com/docs/backdrop-grayscale\n */\n 'backdrop-grayscale': [{\n 'backdrop-grayscale': [grayscale]\n }],\n /**\n * Backdrop Hue Rotate\n * @see https://tailwindcss.com/docs/backdrop-hue-rotate\n */\n 'backdrop-hue-rotate': [{\n 'backdrop-hue-rotate': [hueRotate]\n }],\n /**\n * Backdrop Invert\n * @see https://tailwindcss.com/docs/backdrop-invert\n */\n 'backdrop-invert': [{\n 'backdrop-invert': [invert]\n }],\n /**\n * Backdrop Opacity\n * @see https://tailwindcss.com/docs/backdrop-opacity\n */\n 'backdrop-opacity': [{\n 'backdrop-opacity': [opacity]\n }],\n /**\n * Backdrop Saturate\n * @see https://tailwindcss.com/docs/backdrop-saturate\n */\n 'backdrop-saturate': [{\n 'backdrop-saturate': [saturate]\n }],\n /**\n * Backdrop Sepia\n * @see https://tailwindcss.com/docs/backdrop-sepia\n */\n 'backdrop-sepia': [{\n 'backdrop-sepia': [sepia]\n }],\n // Tables\n /**\n * Border Collapse\n * @see https://tailwindcss.com/docs/border-collapse\n */\n 'border-collapse': [{\n border: ['collapse', 'separate']\n }],\n /**\n * Border Spacing\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing': [{\n 'border-spacing': [borderSpacing]\n }],\n /**\n * Border Spacing X\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-x': [{\n 'border-spacing-x': [borderSpacing]\n }],\n /**\n * Border Spacing Y\n * @see https://tailwindcss.com/docs/border-spacing\n */\n 'border-spacing-y': [{\n 'border-spacing-y': [borderSpacing]\n }],\n /**\n * Table Layout\n * @see https://tailwindcss.com/docs/table-layout\n */\n 'table-layout': [{\n table: ['auto', 'fixed']\n }],\n /**\n * Caption Side\n * @see https://tailwindcss.com/docs/caption-side\n */\n caption: [{\n caption: ['top', 'bottom']\n }],\n // Transitions and Animation\n /**\n * Tranisition Property\n * @see https://tailwindcss.com/docs/transition-property\n */\n transition: [{\n transition: ['none', 'all', '', 'colors', 'opacity', 'shadow', 'transform', isArbitraryValue]\n }],\n /**\n * Transition Duration\n * @see https://tailwindcss.com/docs/transition-duration\n */\n duration: [{\n duration: getNumberAndArbitrary()\n }],\n /**\n * Transition Timing Function\n * @see https://tailwindcss.com/docs/transition-timing-function\n */\n ease: [{\n ease: ['linear', 'in', 'out', 'in-out', isArbitraryValue]\n }],\n /**\n * Transition Delay\n * @see https://tailwindcss.com/docs/transition-delay\n */\n delay: [{\n delay: getNumberAndArbitrary()\n }],\n /**\n * Animation\n * @see https://tailwindcss.com/docs/animation\n */\n animate: [{\n animate: ['none', 'spin', 'ping', 'pulse', 'bounce', isArbitraryValue]\n }],\n // Transforms\n /**\n * Transform\n * @see https://tailwindcss.com/docs/transform\n */\n transform: [{\n transform: ['', 'gpu', 'none']\n }],\n /**\n * Scale\n * @see https://tailwindcss.com/docs/scale\n */\n scale: [{\n scale: [scale]\n }],\n /**\n * Scale X\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-x': [{\n 'scale-x': [scale]\n }],\n /**\n * Scale Y\n * @see https://tailwindcss.com/docs/scale\n */\n 'scale-y': [{\n 'scale-y': [scale]\n }],\n /**\n * Rotate\n * @see https://tailwindcss.com/docs/rotate\n */\n rotate: [{\n rotate: [isInteger, isArbitraryValue]\n }],\n /**\n * Translate X\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-x': [{\n 'translate-x': [translate]\n }],\n /**\n * Translate Y\n * @see https://tailwindcss.com/docs/translate\n */\n 'translate-y': [{\n 'translate-y': [translate]\n }],\n /**\n * Skew X\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-x': [{\n 'skew-x': [skew]\n }],\n /**\n * Skew Y\n * @see https://tailwindcss.com/docs/skew\n */\n 'skew-y': [{\n 'skew-y': [skew]\n }],\n /**\n * Transform Origin\n * @see https://tailwindcss.com/docs/transform-origin\n */\n 'transform-origin': [{\n origin: ['center', 'top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left', isArbitraryValue]\n }],\n // Interactivity\n /**\n * Accent Color\n * @see https://tailwindcss.com/docs/accent-color\n */\n accent: [{\n accent: ['auto', colors]\n }],\n /**\n * Appearance\n * @see https://tailwindcss.com/docs/appearance\n */\n appearance: [{\n appearance: ['none', 'auto']\n }],\n /**\n * Cursor\n * @see https://tailwindcss.com/docs/cursor\n */\n cursor: [{\n cursor: ['auto', 'default', 'pointer', 'wait', 'text', 'move', 'help', 'not-allowed', 'none', 'context-menu', 'progress', 'cell', 'crosshair', 'vertical-text', 'alias', 'copy', 'no-drop', 'grab', 'grabbing', 'all-scroll', 'col-resize', 'row-resize', 'n-resize', 'e-resize', 's-resize', 'w-resize', 'ne-resize', 'nw-resize', 'se-resize', 'sw-resize', 'ew-resize', 'ns-resize', 'nesw-resize', 'nwse-resize', 'zoom-in', 'zoom-out', isArbitraryValue]\n }],\n /**\n * Caret Color\n * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities\n */\n 'caret-color': [{\n caret: [colors]\n }],\n /**\n * Pointer Events\n * @see https://tailwindcss.com/docs/pointer-events\n */\n 'pointer-events': [{\n 'pointer-events': ['none', 'auto']\n }],\n /**\n * Resize\n * @see https://tailwindcss.com/docs/resize\n */\n resize: [{\n resize: ['none', 'y', 'x', '']\n }],\n /**\n * Scroll Behavior\n * @see https://tailwindcss.com/docs/scroll-behavior\n */\n 'scroll-behavior': [{\n scroll: ['auto', 'smooth']\n }],\n /**\n * Scroll Margin\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-m': [{\n 'scroll-m': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin X\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mx': [{\n 'scroll-mx': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Y\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-my': [{\n 'scroll-my': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Start\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ms': [{\n 'scroll-ms': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin End\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-me': [{\n 'scroll-me': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Top\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mt': [{\n 'scroll-mt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Right\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mr': [{\n 'scroll-mr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Bottom\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-mb': [{\n 'scroll-mb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Margin Left\n * @see https://tailwindcss.com/docs/scroll-margin\n */\n 'scroll-ml': [{\n 'scroll-ml': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-p': [{\n 'scroll-p': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding X\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-px': [{\n 'scroll-px': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Y\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-py': [{\n 'scroll-py': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Start\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-ps': [{\n 'scroll-ps': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding End\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pe': [{\n 'scroll-pe': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Top\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pt': [{\n 'scroll-pt': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Right\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pr': [{\n 'scroll-pr': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Bottom\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pb': [{\n 'scroll-pb': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Padding Left\n * @see https://tailwindcss.com/docs/scroll-padding\n */\n 'scroll-pl': [{\n 'scroll-pl': getSpacingWithArbitrary()\n }],\n /**\n * Scroll Snap Align\n * @see https://tailwindcss.com/docs/scroll-snap-align\n */\n 'snap-align': [{\n snap: ['start', 'end', 'center', 'align-none']\n }],\n /**\n * Scroll Snap Stop\n * @see https://tailwindcss.com/docs/scroll-snap-stop\n */\n 'snap-stop': [{\n snap: ['normal', 'always']\n }],\n /**\n * Scroll Snap Type\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-type': [{\n snap: ['none', 'x', 'y', 'both']\n }],\n /**\n * Scroll Snap Type Strictness\n * @see https://tailwindcss.com/docs/scroll-snap-type\n */\n 'snap-strictness': [{\n snap: ['mandatory', 'proximity']\n }],\n /**\n * Touch Action\n * @see https://tailwindcss.com/docs/touch-action\n */\n touch: [{\n touch: ['auto', 'none', 'manipulation']\n }],\n /**\n * Touch Action X\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-x': [{\n 'touch-pan': ['x', 'left', 'right']\n }],\n /**\n * Touch Action Y\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-y': [{\n 'touch-pan': ['y', 'up', 'down']\n }],\n /**\n * Touch Action Pinch Zoom\n * @see https://tailwindcss.com/docs/touch-action\n */\n 'touch-pz': ['touch-pinch-zoom'],\n /**\n * User Select\n * @see https://tailwindcss.com/docs/user-select\n */\n select: [{\n select: ['none', 'text', 'all', 'auto']\n }],\n /**\n * Will Change\n * @see https://tailwindcss.com/docs/will-change\n */\n 'will-change': [{\n 'will-change': ['auto', 'scroll', 'contents', 'transform', isArbitraryValue]\n }],\n // SVG\n /**\n * Fill\n * @see https://tailwindcss.com/docs/fill\n */\n fill: [{\n fill: [colors, 'none']\n }],\n /**\n * Stroke Width\n * @see https://tailwindcss.com/docs/stroke-width\n */\n 'stroke-w': [{\n stroke: [isLength, isArbitraryLength, isArbitraryNumber]\n }],\n /**\n * Stroke\n * @see https://tailwindcss.com/docs/stroke\n */\n stroke: [{\n stroke: [colors, 'none']\n }],\n // Accessibility\n /**\n * Screen Readers\n * @see https://tailwindcss.com/docs/screen-readers\n */\n sr: ['sr-only', 'not-sr-only'],\n /**\n * Forced Color Adjust\n * @see https://tailwindcss.com/docs/forced-color-adjust\n */\n 'forced-color-adjust': [{\n 'forced-color-adjust': ['auto', 'none']\n }]\n },\n conflictingClassGroups: {\n overflow: ['overflow-x', 'overflow-y'],\n overscroll: ['overscroll-x', 'overscroll-y'],\n inset: ['inset-x', 'inset-y', 'start', 'end', 'top', 'right', 'bottom', 'left'],\n 'inset-x': ['right', 'left'],\n 'inset-y': ['top', 'bottom'],\n flex: ['basis', 'grow', 'shrink'],\n gap: ['gap-x', 'gap-y'],\n p: ['px', 'py', 'ps', 'pe', 'pt', 'pr', 'pb', 'pl'],\n px: ['pr', 'pl'],\n py: ['pt', 'pb'],\n m: ['mx', 'my', 'ms', 'me', 'mt', 'mr', 'mb', 'ml'],\n mx: ['mr', 'ml'],\n my: ['mt', 'mb'],\n size: ['w', 'h'],\n 'font-size': ['leading'],\n 'fvn-normal': ['fvn-ordinal', 'fvn-slashed-zero', 'fvn-figure', 'fvn-spacing', 'fvn-fraction'],\n 'fvn-ordinal': ['fvn-normal'],\n 'fvn-slashed-zero': ['fvn-normal'],\n 'fvn-figure': ['fvn-normal'],\n 'fvn-spacing': ['fvn-normal'],\n 'fvn-fraction': ['fvn-normal'],\n 'line-clamp': ['display', 'overflow'],\n rounded: ['rounded-s', 'rounded-e', 'rounded-t', 'rounded-r', 'rounded-b', 'rounded-l', 'rounded-ss', 'rounded-se', 'rounded-ee', 'rounded-es', 'rounded-tl', 'rounded-tr', 'rounded-br', 'rounded-bl'],\n 'rounded-s': ['rounded-ss', 'rounded-es'],\n 'rounded-e': ['rounded-se', 'rounded-ee'],\n 'rounded-t': ['rounded-tl', 'rounded-tr'],\n 'rounded-r': ['rounded-tr', 'rounded-br'],\n 'rounded-b': ['rounded-br', 'rounded-bl'],\n 'rounded-l': ['rounded-tl', 'rounded-bl'],\n 'border-spacing': ['border-spacing-x', 'border-spacing-y'],\n 'border-w': ['border-w-s', 'border-w-e', 'border-w-t', 'border-w-r', 'border-w-b', 'border-w-l'],\n 'border-w-x': ['border-w-r', 'border-w-l'],\n 'border-w-y': ['border-w-t', 'border-w-b'],\n 'border-color': ['border-color-t', 'border-color-r', 'border-color-b', 'border-color-l'],\n 'border-color-x': ['border-color-r', 'border-color-l'],\n 'border-color-y': ['border-color-t', 'border-color-b'],\n 'scroll-m': ['scroll-mx', 'scroll-my', 'scroll-ms', 'scroll-me', 'scroll-mt', 'scroll-mr', 'scroll-mb', 'scroll-ml'],\n 'scroll-mx': ['scroll-mr', 'scroll-ml'],\n 'scroll-my': ['scroll-mt', 'scroll-mb'],\n 'scroll-p': ['scroll-px', 'scroll-py', 'scroll-ps', 'scroll-pe', 'scroll-pt', 'scroll-pr', 'scroll-pb', 'scroll-pl'],\n 'scroll-px': ['scroll-pr', 'scroll-pl'],\n 'scroll-py': ['scroll-pt', 'scroll-pb'],\n touch: ['touch-x', 'touch-y', 'touch-pz'],\n 'touch-x': ['touch'],\n 'touch-y': ['touch'],\n 'touch-pz': ['touch']\n },\n conflictingClassGroupModifiers: {\n 'font-size': ['leading']\n }\n };\n}\n\n/**\n * @param baseConfig Config where other config will be merged into. This object will be mutated.\n * @param configExtension Partial config to merge into the `baseConfig`.\n */\nfunction mergeConfigs(baseConfig, {\n cacheSize,\n prefix,\n separator,\n extend = {},\n override = {}\n}) {\n overrideProperty(baseConfig, 'cacheSize', cacheSize);\n overrideProperty(baseConfig, 'prefix', prefix);\n overrideProperty(baseConfig, 'separator', separator);\n for (const configKey in override) {\n overrideConfigProperties(baseConfig[configKey], override[configKey]);\n }\n for (const key in extend) {\n mergeConfigProperties(baseConfig[key], extend[key]);\n }\n return baseConfig;\n}\nfunction overrideProperty(baseObject, overrideKey, overrideValue) {\n if (overrideValue !== undefined) {\n baseObject[overrideKey] = overrideValue;\n }\n}\nfunction overrideConfigProperties(baseObject, overrideObject) {\n if (overrideObject) {\n for (const key in overrideObject) {\n overrideProperty(baseObject, key, overrideObject[key]);\n }\n }\n}\nfunction mergeConfigProperties(baseObject, mergeObject) {\n if (mergeObject) {\n for (const key in mergeObject) {\n const mergeValue = mergeObject[key];\n if (mergeValue !== undefined) {\n baseObject[key] = (baseObject[key] || []).concat(mergeValue);\n }\n }\n }\n}\nfunction extendTailwindMerge(configExtension, ...createConfig) {\n return typeof configExtension === 'function' ? createTailwindMerge(getDefaultConfig, configExtension, ...createConfig) : createTailwindMerge(() => mergeConfigs(getDefaultConfig(), configExtension), ...createConfig);\n}\nconst twMerge = /*#__PURE__*/createTailwindMerge(getDefaultConfig);\nexport { createTailwindMerge, extendTailwindMerge, fromTheme, getDefaultConfig, mergeConfigs, twJoin, twMerge, validators };\n//# sourceMappingURL=bundle-mjs.mjs.map\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) string.replace(/([a-z0-9])([A-Z])/g, \"$1-$2\").toLowerCase();\n\nexport { toKebabCase };\n//# sourceMappingURL=utils.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport { forwardRef, createElement } from 'react';\nimport defaultAttributes from './defaultAttributes.js';\nimport { toKebabCase } from './shared/src/utils.js';\n\nconst createLucideIcon = (iconName, iconNode) => {\n const Component = forwardRef(\n ({\n color = \"currentColor\",\n size = 24,\n strokeWidth = 2,\n absoluteStrokeWidth,\n className = \"\",\n children,\n ...rest\n }, ref) => {\n return createElement(\n \"svg\",\n {\n ref,\n ...defaultAttributes,\n width: size,\n height: size,\n stroke: color,\n strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,\n className: [\"lucide\", `lucide-${toKebabCase(iconName)}`, className].join(\" \"),\n ...rest\n },\n [\n ...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),\n ...Array.isArray(children) ? children : [children]\n ]\n );\n }\n );\n Component.displayName = `${iconName}`;\n return Component;\n};\n\nexport { createLucideIcon as default };\n//# sourceMappingURL=createLucideIcon.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst LoaderCircle = createLucideIcon(\"LoaderCircle\", [\n [\"path\", { d: \"M21 12a9 9 0 1 1-6.219-8.56\", key: \"13zald\" }]\n]);\n\nexport { LoaderCircle as default };\n//# sourceMappingURL=loader-circle.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst RefreshCcw = createLucideIcon(\"RefreshCcw\", [\n [\"path\", { d: \"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8\", key: \"14sxne\" }],\n [\"path\", { d: \"M3 3v5h5\", key: \"1xhq8a\" }],\n [\"path\", { d: \"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16\", key: \"1hlbsb\" }],\n [\"path\", { d: \"M16 16h5v5\", key: \"ccwih5\" }]\n]);\n\nexport { RefreshCcw as default };\n//# sourceMappingURL=refresh-ccw.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Send = createLucideIcon(\"Send\", [\n [\"path\", { d: \"m22 2-7 20-4-9-9-4Z\", key: \"1q3vgg\" }],\n [\"path\", { d: \"M22 2 11 13\", key: \"nzbqef\" }]\n]);\n\nexport { Send as default };\n//# sourceMappingURL=send.js.map\n","/**\n * @license lucide-react v0.364.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst X = createLucideIcon(\"X\", [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n]);\n\nexport { X as default };\n//# sourceMappingURL=x.js.map\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { TMessage } from '@/types/chatbox'\r\n\r\ntype Props = {\r\n message: TMessage\r\n children?: React.ReactNode\r\n}\r\n\r\n/**\r\n * Represents a message component.\r\n * @param {Object} props - The component props.\r\n * @param {boolean} props.isBot - Indicates whether the message is from a bot.\r\n * @param {string} props.message - The content of the message.\r\n *\r\n */\r\nconst Message = ({ message, children }: Props) => {\r\n const { customStyles, adminId: _adminId, isForManager } = useSocket()\r\n\r\n const isLeft = message.isBot\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n {isForManager ? (message.isBot ? 'From bot' : 'From user') : null}\r\n \r\n \r\n {message.message}\r\n {children}\r\n
\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Message\r\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.mjs.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: forwardedRef ? $9IrjX$composeRefs(forwardedRef, children.ref) : children.ref\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.mjs.map\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;ttypeof value === \"boolean\" ? \"\".concat(value) : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>{\n return (props)=>{\n var ref;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants , defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{\n let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n};\n\n\n//# sourceMappingURL=index.mjs.map","import { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '../../lib/utils'\n\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n default:\n 'bg-primary text-primary-foreground shadow hover:bg-primary/90',\n destructive:\n 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',\n outline:\n 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',\n secondary:\n 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',\n ghost: 'hover:bg-accent hover:text-accent-foreground',\n link: 'text-primary underline-offset-4 hover:underline',\n message:\n 'bg-background shadow-sm border text-primary border-primary hover:bg-primary/10 !rounded-full',\n },\n size: {\n default: 'h-9 px-4 py-2',\n sm: 'h-8 rounded-md px-3 text-xs',\n lg: 'h-10 rounded-md px-8',\n icon: 'h-9 w-9',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes,\n VariantProps {\n asChild?: boolean\n}\n\nconst Button = React.forwardRef(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n return (\n \n )\n },\n)\nButton.displayName = 'Button'\n\nexport { Button, buttonVariants }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TButtonsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TButtonsMessage\r\n}\r\n\r\nconst ButtonsMessage = ({ message }: Props) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n return (\r\n
\r\n \r\n
\r\n {message.template.data.map((button) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default ButtonsMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TCard, TCardsMessage } from '@/types/chatbox'\r\nimport { hexToHSL, openInNewTab } from '@/utils'\r\nimport Message from './message'\r\nimport { Button } from './ui/button'\r\n\r\ntype Props = {\r\n message: TCardsMessage\r\n}\r\n\r\nconst Card = ({ card }: { card: TCard }) => {\r\n const { handleSendMessage, customStyles } = useSocket()\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n \r\n

{card.title}

\r\n

{card.subtitle}

\r\n {card.buttons && card.buttons.length > 0 && (\r\n
\r\n {card.buttons.map((button, index) => {\r\n return (\r\n {\r\n if (button.type === 'postback') {\r\n if (!button.payload) return\r\n handleSendMessage({\r\n message: button.payload,\r\n extraData: button.title,\r\n type: 'list-button',\r\n })\r\n }\r\n\r\n if (button.type === 'web_url') {\r\n if (!button.url) return\r\n\r\n openInNewTab(button.url)\r\n }\r\n }}\r\n style={\r\n {\r\n '--primary': hsl\r\n ? `${hsl.h} ${hsl.s}% ${hsl.l}%`\r\n : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n {button.title}\r\n \r\n )\r\n })}\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport const CardsMessage = ({ message }: Props) => {\r\n return (\r\n
\r\n {message.template.data.map((card, index) => {\r\n return (\r\n }\r\n />\r\n )\r\n })}\r\n
\r\n )\r\n}\r\n","import Message from './message'\r\n\r\nexport const TypingMessage = () => {\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n }\r\n />\r\n )\r\n}\r\n\r\nexport default TypingMessage\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { TMessage } from '@/types/chatbox'\r\nimport dayjs from 'dayjs'\r\nimport { Loader2 } from 'lucide-react'\r\nimport { Fragment, useEffect, useRef } from 'react'\r\nimport ButtonsMessage from './buttons-message'\r\nimport { CardsMessage } from './cards-message'\r\nimport Message from './message'\r\nimport TypingMessage from './typing-message'\r\n\r\n/**\r\n * Represents the body component of the chatbox.\r\n * This component displays the main content of the chatbox.\r\n */\r\n\r\nconst Body = () => {\r\n const endMessageRef = useRef(null)\r\n const { messages, isLoadingMessages } = useSocket()\r\n\r\n /**\r\n * Scrolls to the end of the messages when a new message is received.\r\n */\r\n useEffect(() => {\r\n if (!endMessageRef.current) return\r\n\r\n endMessageRef.current.scrollIntoView({ behavior: 'smooth' })\r\n }, [messages])\r\n\r\n const renderMessage = (msg: TMessage, index: number) => {\r\n if (msg?.userId === 'typing') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-button') {\r\n return \r\n }\r\n\r\n if (msg?.template?.type === 'list-card') {\r\n return \r\n }\r\n\r\n return \r\n }\r\n\r\n return (\r\n
\r\n {isLoadingMessages ? (\r\n
\r\n \r\n
\r\n ) : (\r\n
\r\n {messages.length > 0 && (\r\n
\r\n {dayjs(messages[0].createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {messages.map((msg, index) => {\r\n return (\r\n \r\n {index > 0 &&\r\n dayjs(msg.createdAt).diff(\r\n dayjs(messages[index - 1].createdAt),\r\n 'minutes',\r\n ) > 10 && (\r\n
\r\n {dayjs(msg.createdAt).format('DD/MM/YYYY HH:mm')}\r\n
\r\n )}\r\n {renderMessage(msg, index)}\r\n
\r\n )\r\n })}\r\n\r\n
\r\n
\r\n )}\r\n
\r\n )\r\n}\r\n\r\nexport default Body\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { RefreshCcw, X } from 'lucide-react'\r\n\r\n/**\r\n * Represents the header component of the chatbox.\r\n *\r\n */\r\nconst Header = () => {\r\n const { handleClose, isShowClose, handleReload, customStyles, isForManager } =\r\n useSocket()\r\n return (\r\n \r\n
\r\n
\r\n {customStyles?.logoUrl ? (\r\n \r\n ) : (\r\n \r\n \r\n B\r\n \r\n \r\n )}\r\n \r\n {customStyles?.name || 'DialogueBot'}\r\n \r\n
\r\n
\r\n {!isForManager && (\r\n \r\n \r\n
\r\n )}\r\n {isShowClose && (\r\n \r\n \r\n
\r\n )}\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default Header\r\n","import * as React from 'react'\n\nimport { cn } from '../../lib/utils'\nexport interface InputProps\n extends React.InputHTMLAttributes {}\n\nconst Input = React.forwardRef(\n ({ className, type, ...props }, ref) => {\n return (\n \n )\n },\n)\nInput.displayName = 'Input'\n\nexport { Input }\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { hexToHSL } from '@/utils'\r\nimport { Send } from 'lucide-react'\r\nimport { useState } from 'react'\r\nimport { Button } from './ui/button'\r\nimport { Input } from './ui/input'\r\n\r\n/**\r\n * Represents the send area component.\r\n */\r\nconst SendArea = () => {\r\n const { handleSendMessage, disableInput, customStyles } = useSocket()\r\n const [message, setMessage] = useState('')\r\n\r\n const handleEnter = (e: React.KeyboardEvent) => {\r\n if (e.key === 'Enter') {\r\n e.preventDefault()\r\n handleSendMessage({\r\n message,\r\n })\r\n\r\n setMessage('')\r\n }\r\n }\r\n\r\n const hsl = customStyles?.color ? hexToHSL(customStyles.color) : null\r\n\r\n return (\r\n
\r\n setMessage(e.target.value)}\r\n onKeyDown={handleEnter}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n />\r\n {\r\n handleSendMessage({\r\n message,\r\n cb: () => setMessage(''),\r\n })\r\n }}\r\n disabled={disableInput}\r\n style={\r\n {\r\n '--primary': hsl ? `${hsl.h} ${hsl.s}% ${hsl.l}%` : undefined,\r\n } as React.CSSProperties\r\n }\r\n >\r\n \r\n \r\n
\r\n )\r\n}\r\n\r\nexport default SendArea\r\n","import { useSocket } from '@/hooks/useSocket'\r\nimport { cn } from '@/lib/utils'\r\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query'\r\nimport { Body, Header, SendArea } from '../components'\r\nimport { Props, SocketProvider } from '../context/socket.ctx'\r\n\r\nconst queryClient = new QueryClient()\r\n\r\n/**\r\n * Represents the ChatBox component.\r\n * This component displays a chat box with a header, body, and send area.\r\n */\r\n\r\nconst ChatBox = ({ className }: { className?: string }) => {\r\n const { customStyles, isForManager } = useSocket()\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n \r\n {!isForManager && }\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\n/**\r\n * Wrapper component for the chat box.\r\n *\r\n * @returns The rendered chat box wrapped in a SocketProvider.\r\n */\r\nconst ChatBoxWrapper = (props: Omit) => {\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n )\r\n}\r\n\r\nexport default ChatBoxWrapper\r\n"],"names":["f","require$$0","k","l","m","n","p","q","c","a","g","b","d","e","h","reactJsxRuntime_production_min","React","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_PROVIDER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","REACT_OFFSCREEN_TYPE","MAYBE_ITERATOR_SYMBOL","FAUX_ITERATOR_SYMBOL","getIteratorFn","maybeIterable","maybeIterator","ReactSharedInternals","error","format","_len2","args","_key2","printWarning","level","ReactDebugCurrentFrame","stack","argsWithFormat","item","enableScopeAPI","enableCacheElement","enableTransitionTracing","enableLegacyHidden","enableDebugTracing","REACT_MODULE_REFERENCE","isValidElementType","type","getWrappedName","outerType","innerType","wrapperName","displayName","functionName","getContextName","getComponentNameFromType","context","provider","outerName","lazyComponent","payload","init","assign","disabledDepth","prevLog","prevInfo","prevWarn","prevError","prevGroup","prevGroupCollapsed","prevGroupEnd","disabledLog","disableLogs","props","reenableLogs","ReactCurrentDispatcher","prefix","describeBuiltInComponentFrame","name","source","ownerFn","x","match","reentry","componentFrameCache","PossiblyWeakMap","describeNativeComponentFrame","fn","construct","frame","control","previousPrepareStackTrace","previousDispatcher","Fake","sample","sampleLines","controlLines","s","_frame","syntheticFrame","describeFunctionComponentFrame","shouldConstruct","Component","prototype","describeUnknownElementTypeFrameInDEV","hasOwnProperty","loggedTypeFailures","setCurrentlyValidatingElement","element","owner","checkPropTypes","typeSpecs","values","location","componentName","has","typeSpecName","error$1","err","ex","isArrayImpl","isArray","typeName","value","hasToStringTag","willCoercionThrow","testStringCoercion","checkKeyStringCoercion","ReactCurrentOwner","RESERVED_PROPS","specialPropKeyWarningShown","specialPropRefWarningShown","didWarnAboutStringRefs","hasValidRef","config","getter","hasValidKey","warnIfStringRefCannotBeAutoConverted","self","defineKeyPropWarningGetter","warnAboutAccessingKey","defineRefPropWarningGetter","warnAboutAccessingRef","ReactElement","key","ref","jsxDEV","maybeKey","propName","defaultProps","ReactCurrentOwner$1","ReactDebugCurrentFrame$1","setCurrentlyValidatingElement$1","propTypesMisspellWarningShown","isValidElement","object","getDeclarationErrorAddendum","getSourceInfoErrorAddendum","fileName","lineNumber","ownerHasKeyUseWarning","getCurrentComponentErrorInfo","parentType","info","parentName","validateExplicitKey","currentComponentErrorInfo","childOwner","validateChildKeys","node","i","child","iteratorFn","iterator","step","validatePropTypes","propTypes","_name","validateFragmentProps","fragment","keys","jsxWithValidation","isStaticChildren","validType","sourceInfo","typeString","children","jsxWithValidationStatic","jsxWithValidationDynamic","jsx","jsxs","reactJsxRuntime_development","jsxRuntimeModule","require$$1","Object$","Map$","Set$","SetHas$","SetAdd$","MapHas$","MapGet$","MapSet$","ChildFlag","AttributeFlag","EventFlag","StyleAttributeFlag","SvgAttributeFlag","BlockFlag","TEXT_NODE_CACHE","EVENT_PATCH","EVENTS_REGISTRY","IS_NON_DIMENSIONAL","XLINK_NS","XML_NS","X_CHAR","NON_PROPS","VOID_ELEMENTS","document$","HTM_TEMPLATE","HTM_TEMPLATE_CONTENT","SVG_TEMPLATE","node$","element$","characterData$","getOwnPropertyDescriptor$","insertBefore$","cloneNode$","replaceChild$","remove$$1","addEventListener$","removeAttribute$","setAttribute$","setAttributeNS$","setTextContent$","firstChild$","nextSibling$","characterDataSet$","stringToDOM","content","svg","template","createEventListener","el","event","capture","nativeEvent","el2","handler","patch","newValue","_a","childAt","index","j","visitedNodes","removeComments","insertText","setText","setStyleAttribute","setSvgAttribute","setAttribute","isValueNully","isInput","isSelect","isTextArea","__defProp$1","__defNormalProp$1","obj","__publicField$1","AbstractBlock","renderToTemplate","vnode","edits","path","current","style","kebabKey","char","canMergeString","_b","newPath","__defProp","__defNormalProp","__publicField","mapArray","ArrayBlock","oldChildren","newChildren","oldChildrenLength","newChildrenLength","parent","arrayRemove$","arrayMount$","oldHead","newHead","oldTail","newTail","oldHeadChild","newHeadChild","oldTailChild","newTailChild","oldKeyMap","oldHeadKey","newHeadKey","patch$","oldTailKey","newTailKey","nextChild","move$","oldIndex","mount$","oldChild","remove$","refNode","block","array$","arrayPatch$","HOLE_PROXY","_","unwrap","shouldUpdate","root","shouldUpdateCurrentBlock","Block","oldBlock","newBlock","getElements","hydrateNode","elements","getCurrentElement","edit","targetEl","patch2","initsLength","shouldUpdate$","oldValue","firstEdit","newChildBlock","newTargetEl","block2","_oldProps","_newProps","cache","pathLength","isCacheAndKeyExists","siblings","block$","experimental_options","RENDER_SCOPE","SVG_RENDER_SCOPE","Effect","effect","deps","useEffect","REGISTRY","scopedContext","createContext","processProps","portals","processedProps","currentIndex","renderReactScope","wrap","createElement","unstable","isBlock","isCallable","puppetComponent","puppetBlock","reactPortal","createPortal","Fragment","millionPortal","cn","flatten","rawChildren","flattenedChildren","useLayoutEffect","useLayoutEffect$1","traverse","fiber","selector","ascending","useFiber","useRef","useState","bind","maybeFiber","useNearestParent","parentRef","useContainer","rootRef","options","noSlot","blockTarget","defaultType","block$1","MillionBlock","forwardedRef","container","hmrTimestamp","patch$1","portalRef","useCallback","currentBlock","_c","props2","marker","useMemo","childrenSize","MillionArray","each","memo2","as","rest","fragmentRef","setMountPortals","createChildren","MillionFor","typedMemo","memo","getComponent","currentCache","portals2","isEqual","shouldCompiledBlockUpdate","prev","next","compiledBlock","render","blockName","RenderBlock","portalCount","scoped","useContext","derived","scope","targets","len","EVENTS_SOCKET","USER_ID_KEY","API_URL","_assert","number","bool","isBytes","bytes","lengths","hash","exists","instance","checkFinished","output","out","min","assert","_u64","U32_MASK64","_32n","fromBig","le","split","lst","Ah","Al","toBig","shrSH","_l","shrSL","rotrSH","rotrSL","rotrBH","rotrBL","rotr32H","_h","rotr32L","rotlSH","rotlSL","rotlBH","rotlBL","add","Bh","Bl","add3L","Cl","add3H","low","Ch","add4L","Dl","add4H","Dh","add5L","El","add5H","Eh","u64","crypto","exports","crypto_1","_assert_js_1","u8","arr","u32","createView","rotr","word","shift","rotl","byteSwap","byteSwap32","hexes","bytesToHex","hex","asciis","asciiToBase16","hexToBytes","hl","al","array","ai","hi","n1","n2","nextTick","asyncLoop","iters","tick","cb","ts","diff","utf8ToBytes","str","toBytes","data","concatBytes","arrays","sum","res","pad","Hash","toStr","checkOpts","defaults","opts","wrapConstructor","hashCons","hashC","msg","tmp","wrapConstructorWithOpts","wrapXOFConstructorWithOpts","randomBytes","bytesLength","sha3","sha3$1","_u64_js_1","utils_js_1","require$$2","SHA3_PI","SHA3_ROTL","_SHA3_IOTA","_0n","_1n","_2n","_7n","_256n","_0x71n","round","R","y","t","SHA3_IOTA_H","SHA3_IOTA_L","rotlH","rotlL","keccakP","rounds","B","idx1","idx0","B0","B1","Th","Tl","curH","curL","PI","Keccak","blockLen","suffix","outputLen","enableXOF","state","pos","take","bufferOut","to","gen","genShake","defaultLength","bigLength","createEntropy","length","random","entropy","bufToBigInt","buf","bits","bi","input","alphabet","randomLetter","createFingerprint","globalObj","global","globals","sourceString","createCounter","count","initialCountMax","counter","fingerprint","firstLetter","time","salt","hashInput","createId","isCuid","id","minLength","maxLength","regex","src","getConstants","createId_1","genId","generatedId","userIdFromLocalStorage","getAddress","channelId","incomeUserId","userId","openInNewTab","url","hexToHSL","bigint","max","Subscribable","listener","isServer","noop","functionalUpdate","updater","isValidTimeout","timeUntilStale","updatedAt","staleTime","matchQuery","filters","query","exact","fetchStatus","predicate","queryKey","stale","hashQueryKeyByOptions","partialMatchKey","isActive","matchMutation","mutation","status","mutationKey","hashKey","val","isPlainObject","result","replaceEqualDeep","isPlainArray","aItems","aSize","bItems","bSize","copy","equalItems","shallowEqualObjects","o","hasObjectPrototype","ctor","prot","sleep","ms","resolve","replaceData","prevData","addToEnd","items","newItems","addToStart","skipToken","FocusManager","__privateAdd","_focused","_cleanup","_setup","__privateSet","onFocus","__privateGet","setup","focused","isFocused","focusManager","OnlineManager","_online","onOnline","onlineListener","offlineListener","online","onlineManager","defaultRetryDelay","failureCount","canFetch","networkMode","CancelledError","isCancelledError","createRetryer","isRetryCancelled","isResolved","continueFn","promiseResolve","promiseReject","promise","outerResolve","outerReject","cancel","cancelOptions","reject","cancelRetry","continueRetry","shouldPause","pause","continueResolve","canContinue","run","promiseOrValue","retry","retryDelay","delay","shouldRetry","createNotifyManager","queue","transactions","notifyFn","callback","batchNotifyFn","scheduleFn","setScheduler","batch","flush","schedule","batchCalls","originalQueue","notifyManager","Removable","_gcTimeout","newGcTime","Query","_d","_dispatch","_initialState","_revertState","_cache","_retryer","_observers","_defaultOptions","_abortSignalConsumed","getDefaultState","newData","__privateMethod","dispatch_fn","setStateOptions","observer","fetchOptions","abortController","queryFnContext","addSignalProperty","fetchFn","onError","action","reducer","fetchState","hasData","initialDataUpdatedAt","QueryCache","_e","_queries","client","queryHash","queryInMap","defaultedFilters","queries","Mutation","_f","_mutationCache","variables","executeMutation","restored","_g","_j","_i","_k","_n","_m","_p","_o","_r","_q","_t","_s","MutationCache","_mutations","_mutationId","_resuming","__privateWrapper","pausedMutations","infiniteQueryBehavior","pages","direction","oldPages","oldPageParams","empty","cancelled","queryFn","fetchPage","param","previous","page","maxPages","addTo","pageParamFn","getPreviousPageParam","getNextPageParam","oldData","remainingPages","pageParams","lastIndex","QueryClient","_queryCache","_queryDefaults","_mutationDefaults","_mountCount","_unsubscribeFocus","_unsubscribeOnline","cachedData","defaultedOptions","queryCache","refetchFilters","defaultedCancelOptions","promises","queryDefault","QueryObserver","_executeFetch","_updateStaleTimeout","_computeRefetchInterval","_updateRefetchInterval","_updateTimers","_clearStaleTimeout","_clearRefetchInterval","_updateQuery","_notify","_client","_currentQuery","_currentQueryInitialState","_currentResult","_currentResultState","_currentResultOptions","_selectError","_selectFn","_selectResult","_lastQueryWithDefinedData","_staleTimeoutId","_refetchIntervalId","_currentRefetchInterval","_trackedProps","shouldFetchOnMount","executeFetch_fn","updateTimers_fn","shouldFetchOn","clearStaleTimeout_fn","clearRefetchInterval_fn","notifyOptions","prevOptions","prevQuery","updateQuery_fn","mounted","shouldFetchOptionally","updateStaleTimeout_fn","nextRefetchInterval","computeRefetchInterval_fn","updateRefetchInterval_fn","shouldAssignObserverCurrentProperties","onPropTracked","trackedResult","prevResult","prevResultState","prevResultOptions","queryInitialState","newState","isPlaceholderData","fetchOnMount","fetchOptionally","errorUpdatedAt","selectError","placeholderData","isFetching","isPending","isError","isLoading","isStale","nextResult","defaultNotifyOptions","shouldNotifyListeners","notifyOnChangeProps","notifyOnChangePropsValue","includedProps","typedKey","notify_fn","timeout","nextInterval","shouldLoadOnMount","field","optimisticResult","QueryClientContext","useQueryClient","queryClient","QueryClientProvider","IsRestoringContext","useIsRestoring","createValue","isReset","QueryErrorResetBoundaryContext","useQueryErrorResetBoundary","shouldThrowError","throwError","params","ensurePreventErrorBoundaryRetry","errorResetBoundary","useClearResetErrorBoundary","getHasError","throwOnError","ensureStaleTime","shouldSuspend","fetchOptimistic","useBaseQuery","Observer","isRestoring","onStoreChange","unsubscribe","useQuery","PACKET_TYPES","PACKET_TYPES_REVERSE","ERROR_PACKET","withNativeBlob","withNativeArrayBuffer","isView","encodePacket","supportsBinary","encodeBlobAsBase64","fileReader","toArray","TEXT_ENCODER","encodePacketToBinary","packet","encoded","chars","lookup","decode","base64","bufferLength","encoded1","encoded2","encoded3","encoded4","arraybuffer","decodePacket","encodedPacket","binaryType","mapBinary","decodeBase64Packet","decoded","SEPARATOR","encodePayload","packets","encodedPackets","decodePayload","encodedPayload","decodedPacket","createPacketEncoderStream","controller","payloadLength","header","view","TEXT_DECODER","totalLength","chunks","acc","chunk","concatChunks","size","buffer","createPacketDecoderStream","maxPayload","expectedLength","isBinary","headerArray","protocol","Emitter","mixin","on","callbacks","globalThisShim","pick","attr","NATIVE_SET_TIMEOUT","globalThis","NATIVE_CLEAR_TIMEOUT","installTimerFunctions","BASE64_OVERHEAD","byteLength","utf8Length","encode","qs","qry","pairs","pair","TransportError","reason","description","Transport","details","onPause","schema","hostname","encodedQuery","map","seed","num","yeast","now","hasCORS","XHR","xdomain","createCookieJar","hasXHR2","XMLHttpRequest","Polling","isSSL","port","forceBase64","total","close","Request","req","xhrStatus","uri","xhr","fromError","unloadHandler","terminationEvent","setTimeoutFn","WebSocket","usingBrowserWebSocket","defaultBinaryType","isReactNative","WS","protocols","closeEvent","ev","lastPacket","WT","stream","decoderStream","reader","encoderStream","read","done","transports","re","parts","parse","pathNames","regx","names","$0","$1","$2","Socket","transport","failed","onTransportOpen","cleanup","freezeTransport","onerror","onTransportClose","onclose","onupgrade","payloadSize","cleanupAndClose","waitForUpgrade","upgrades","filteredUpgrades","Socket$1","loc","host","toString","withNativeFile","hasBinary","toJSON","deconstructPacket","buffers","packetData","pack","_deconstructPacket","placeholder","reconstructPacket","_reconstructPacket","RESERVED_EVENTS","PacketType","Encoder","replacer","deconstruction","isObject","Decoder","reviver","isBinaryEvent","BinaryReconstructor","start","binData","io","nsp","ack","isTransportWritable","timer","arg1","arg2","responseArgs","force","listeners","sent","pid","subDestroy","compress","Backoff","rand","deviation","jitter","Manager","_parser","parser","v","Engine","socket","openSubDestroy","errorSub","nsps","attempt","parsed","sameNamespace","newConnection","freeGlobal","freeSelf","useUnmount","func","funcRef","SocketCtx","SocketProvider","onEndBot","isTest","onClose","isShowClose","isForLiveChat","customStyles","_customStyles","isForPreview","isForManager","adminId","disableInput","setDisableInput","setCustomStyles","undefined","urlParams","URLSearchParams","window","search","_userId","_channelId","get","socketRef","autoConnect","messages","isBot","message","createdAt","Date","toISOString","fetch","URL","json","initialData","custom","enabled","handleSendMessage","extraData","trimmedMessage","trim","address","newMessage","emit","MESSAGE","setQueryData","handleClose","postMessage","handleReload","disconnect","connect","filter","TYPING","STOP_TYPING","isLoadingMessages","useSocket","socketCtx","r","clsx","CLASS_PART_SEPARATOR","createClassUtils","classMap","createClassMap","conflictingClassGroups","conflictingClassGroupModifiers","getClassGroupId","className","classParts","getGroupRecursive","getGroupIdForArbitraryProperty","getConflictingClassGroupIds","classGroupId","hasPostfixModifier","conflicts","classPartObject","currentClassPart","nextClassPartObject","classGroupFromNextClassPart","classRest","validator","arbitraryPropertyRegex","arbitraryPropertyClassName","property","theme","getPrefixedClassGroupEntries","classGroup","processClassesRecursively","classDefinition","classPartObjectToEdit","getPart","isThemeGetter","currentClassPartObject","pathPart","classGroupEntries","prefixedClassGroup","createLruCache","maxCacheSize","cacheSize","previousCache","update","IMPORTANT_MODIFIER","createSplitModifiers","separator","isSeparatorSingleCharacter","firstSeparatorCharacter","separatorLength","modifiers","bracketDepth","modifierStart","postfixModifierPosition","currentCharacter","baseClassNameWithImportantModifier","hasImportantModifier","baseClassName","maybePostfixModifierPosition","sortModifiers","sortedModifiers","unsortedModifiers","modifier","createConfigUtils","SPLIT_CLASSES_REGEX","mergeClassList","classList","configUtils","splitModifiers","classGroupsInConflict","originalClassName","variantModifier","modifierId","classId","group","twJoin","argument","resolvedValue","string","toValue","mix","createTailwindMerge","createConfigFirst","createConfigRest","cacheGet","cacheSet","functionToCall","initTailwindMerge","previousConfig","createConfigCurrent","tailwindMerge","cachedResult","fromTheme","themeGetter","arbitraryValueRegex","fractionRegex","stringLengths","tshirtUnitRegex","lengthUnitRegex","colorFunctionRegex","shadowRegex","imageRegex","isLength","isNumber","isArbitraryLength","getIsArbitraryValue","isLengthOnly","isArbitraryNumber","isInteger","isPercent","isArbitraryValue","isTshirtSize","sizeLabels","isArbitrarySize","isNever","isArbitraryPosition","imageLabels","isArbitraryImage","isImage","isArbitraryShadow","isShadow","isAny","label","testValue","getDefaultConfig","colors","spacing","blur","brightness","borderColor","borderRadius","borderSpacing","borderWidth","contrast","grayscale","hueRotate","invert","gap","gradientColorStops","gradientColorStopPositions","inset","margin","opacity","padding","saturate","scale","sepia","skew","space","translate","getOverscroll","getOverflow","getSpacingWithAutoAndArbitrary","getSpacingWithArbitrary","getLengthWithEmptyAndArbitrary","getNumberWithAutoAndArbitrary","getPositions","getLineStyles","getBlendModes","getAlign","getZeroAndEmpty","getBreaks","getNumber","getNumberAndArbitrary","twMerge","inputs","module","this","u","$","D","S","w","O","M","defaultAttributes","toKebabCase","createLucideIcon","iconName","iconNode","forwardRef","color","strokeWidth","absoluteStrokeWidth","tag","attrs","LoaderCircle","RefreshCcw","Send","X","Message_1","_compiledBlock","_props","v0","v1","v2","v3","v4","v5","v6","v7","Message","_adminId","isLeft","wordBreak","backgroundColor","_extends","target","$6ed0406888f73fc4$var$setRef","$6ed0406888f73fc4$export$43e446d32b3d21af","refs","$5e63c961fc1ce211$export$8c6ed5c666ac1360","$9IrjX$forwardRef","slotProps","childrenArray","$9IrjX$Children","slottable","$5e63c961fc1ce211$var$isSlottable","newElement","$9IrjX$isValidElement","$9IrjX$createElement","$5e63c961fc1ce211$var$SlotClone","$9IrjX$babelruntimehelpersesmextends","$9IrjX$cloneElement","$5e63c961fc1ce211$var$mergeProps","$9IrjX$composeRefs","$5e63c961fc1ce211$export$d9f1ccf0bdb05d45","$9IrjX$Fragment","childProps","overrideProps","slotPropValue","childPropValue","falsyToString","cx","buttonVariants","base","variants","defaultVariants","getVariantClassNames","variant","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","getCompoundVariantClassNames","param1","cvClass","cvClassName","compoundVariantOptions","default","destructive","outline","secondary","ghost","link","sm","lg","icon","Button","asChild","Comp","Slot","ButtonsMessage","hsl","button","title","Card_1","Card","card","image_url","subtitle","buttons","CardsMessage","TypingMessage","Body","endMessageRef","scrollIntoView","behavior","renderMessage","Loader2","dayjs","Header_1","Header","logoUrl","Input","SendArea","setMessage","handleEnter","preventDefault","ChatBox_1","ChatBox","width","windowSize","height","ChatBoxWrapper"],"mappings":";;;;;;;;6CASa,IAAIA,EAAEC,EAAiBC,EAAE,OAAO,IAAI,eAAe,EAAEC,EAAE,OAAO,IAAI,gBAAgB,EAAEC,EAAE,OAAO,UAAU,eAAeC,EAAEL,EAAE,mDAAmD,kBAAkBM,EAAE,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,EAAE,EAClP,SAASC,EAAEC,EAAEC,EAAEC,EAAE,CAAC,IAAIC,EAAEC,EAAE,GAAGC,EAAE,KAAKC,EAAE,KAAcJ,IAAT,SAAaG,EAAE,GAAGH,GAAYD,EAAE,MAAX,SAAiBI,EAAE,GAAGJ,EAAE,KAAcA,EAAE,MAAX,SAAiBK,E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DACbgtC,SAAAA,CAAAG,EAAAA,GACAntC,EAAAA,KAAC,MAAI,CAAA,UAAU,mCACbgtC,SAAAA,CAAAI,EAAAA,GACAJ,EAAAK,EAAAA,EACF,CAAA,CACF,CAAA,CACF,CAAA,EAAM,CAAAr0C,KAAA,YAAAwR,QAAA,CAAA,KAAA,KAAA,IAAA,CAAA,CAAA,EArBJ0oC,GAAUA,CAAC,CAAExR,UAAAA,CAAkC,IAAM,CACnD,KAAA,CAAE3D,aAAAA,EAAcG,aAAAA,GAAiB6C,GAAU,EAEjD,aAAAkS,GAAA,CAAA,GAEe1nC,GACT,2DACAm2B,CACF,EACO,GAAA,CACLyR,MAAOpV,GAAAA,YAAAA,EAAcqV,WAAWD,MAChCE,OAAQtV,GAAAA,YAAAA,EAAcqV,WAAWC,MAAAA,EAIjC,GAACtzC,EAAAA,IAAA2yC,GAAA,CAAA,CAAM,KAEL3yC,MAACmyC,GAAO,CAAA,CAAA,EAAA,GACP,CAAChU,GAAgBn+B,EAAA,IAAC8yC,IAAW,CAAA,EAAA,CAKxC,EAOMS,GAAkB36C,GAEnBoH,EAAA,IAAA0uB,GAAA,CAAoB,OAAQD,GAC3B,eAACiP,GAAmB9kC,CAAAA,GAAAA,EAClB,SAAAoH,EAAA,IAACmzC,GAAQ,CAAA,UAAWv6C,EAAM+oC,SAAa,CAAA,EACzC,CACF,CAAA","x_google_ignoreList":[0,1,2,3,4,5,6,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,74,75,76,77,78,79,80,81,83,84,85,86,87]} \ No newline at end of file diff --git a/package.json b/package.json index 11a36b2..f4f806c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dialogue-chatbox", "private": false, - "version": "1.0.38", + "version": "1.0.39", "type": "module", "main": "./dist-components/index.umd.js", "module": "./dist-components/index.es.js",