From f1c720c7ce9dcece4eb9c545799b1db1e59b2895 Mon Sep 17 00:00:00 2001 From: Mohamadzadeh <7796733@gmail.com> Date: Sat, 13 Jun 2026 19:44:46 +0330 Subject: [PATCH] update BiProvider --- dist/index.js | 430 ++++++++++++++++++------------------ src/provider/BiProvider.jsx | 18 +- 2 files changed, 231 insertions(+), 217 deletions(-) diff --git a/dist/index.js b/dist/index.js index b7f7389..16f799a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,36 +1,36 @@ import { jsxs as Y, jsx as x } from "react/jsx-runtime"; -import * as F from "react"; -import { useState as P, useRef as te, useEffect as L, useCallback as j, createContext as Je, useMemo as fe, useContext as He, forwardRef as Kr } from "react"; +import * as P from "react"; +import { useState as F, useRef as te, useEffect as B, useCallback as j, createContext as Je, useMemo as fe, useContext as He, forwardRef as Kr } from "react"; import { HStack as W, IconButton as J, Button as Te, Input as _e, Text as q, extendTheme as Yr, withDefaultColorScheme as Vr, ChakraProvider as Wr, Spinner as qr } from "@chakra-ui/react"; import { IoChevronForwardOutline as $e, IoChevronBackOutline as Re } from "react-icons/io5"; import jr from "keycloak-js"; import { useQuery as Ur, QueryClient as Gr, QueryClientProvider as Jr } from "@tanstack/react-query"; import Hr from "axios"; -const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), U = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), Sn = ({ +const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), $ = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), U = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), Sn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { - const [i, o] = P(_(e)), [s, a] = P(!1), [u, c] = P(null), d = te(null), y = [.../* @__PURE__ */ new Set([1, e, r])].filter( + const [i, o] = F($(e)), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = [.../* @__PURE__ */ new Set([1, e, r])].filter( (f) => f >= 1 && f <= r ); - L(() => { + B(() => { if (u !== null) { - e === u && (c(null), a(!1), o(_(e))); + e === u && (c(null), a(!1), o($(e))); return; } - s || o(_(e)); - }, [e, s, u]), L(() => { + s || o($(e)); + }, [e, s, u]), B(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; - const m = setTimeout(() => { + const y = setTimeout(() => { var b; const h = Math.min(Math.max(f, 1), r); - h !== e ? (c(h), o(_(h)), n(h)) : (a(!1), o(_(e))), (b = d.current) == null || b.blur(); + h !== e ? (c(h), o($(h)), n(h)) : (a(!1), o($(e))), (b = d.current) == null || b.blur(); }, 1e3); - return () => clearTimeout(m); + return () => clearTimeout(y); }, [ i, s, @@ -39,15 +39,15 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S e, n ]); - const $ = () => { + const S = () => { var h, b; const f = parseInt(U(i), 10); if (isNaN(f)) { - o(_(e)), a(!1), c(null), (h = d.current) == null || h.blur(); + o($(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } - const m = Math.min(Math.max(f, 1), r); - m !== e ? (c(m), o(_(m)), n(m)) : (o(_(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); + const y = Math.min(Math.max(f, 1), r); + y !== e ? (c(y), o($(y)), n(y)) : (o($(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ Y( W, @@ -75,7 +75,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S "aria-label": "صفحه قبلی" } ), - y.map((f) => /* @__PURE__ */ x( + m.map((f) => /* @__PURE__ */ x( Te, { size: "md", @@ -85,7 +85,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", - children: _(f) + children: $(f) }, f )), @@ -115,14 +115,14 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S a(!0), c(null), o(""); }, onChange: (f) => { - const m = f.target.value, h = U(m).replace(/\D/g, ""); - o(_(h)); + const y = f.target.value, h = U(y).replace(/\D/g, ""); + o($(h)); }, onBlur: () => { - i || (o(_(e)), a(!1), c(null)); + i || (o($(e)), a(!1), c(null)); }, onKeyDown: (f) => { - f.key === "Enter" && $(); + f.key === "Enter" && S(); }, textAlign: "center", color: "#1D2939", @@ -134,7 +134,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S ] }), /* @__PURE__ */ Y(W, { spacing: 2, children: [ /* @__PURE__ */ x(q, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }), - /* @__PURE__ */ x(q, { children: _(t) }) + /* @__PURE__ */ x(q, { children: $(t) }) ] }) ] } @@ -145,25 +145,25 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S totalCount: t, onPageChange: n }) => { - const [i, o] = P(_(e)), [s, a] = P(!1), [u, c] = P(null), d = te(null), y = Array.from( + const [i, o] = F($(e)), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = Array.from( /* @__PURE__ */ new Set([1, e, e + 1, r]) - ).filter((f) => f >= 1 && f <= r).sort((f, m) => f - m); - L(() => { + ).filter((f) => f >= 1 && f <= r).sort((f, y) => f - y); + B(() => { if (u !== null) { - e === u && (c(null), a(!1), o(_(e))); + e === u && (c(null), a(!1), o($(e))); return; } - s || o(_(e)); - }, [e, s, u]), L(() => { + s || o($(e)); + }, [e, s, u]), B(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; - const m = setTimeout(() => { + const y = setTimeout(() => { var b; const h = Math.min(Math.max(f, 1), r); - h !== e ? (c(h), o(_(h)), n(h)) : (a(!1), o(_(e))), (b = d.current) == null || b.blur(); + h !== e ? (c(h), o($(h)), n(h)) : (a(!1), o($(e))), (b = d.current) == null || b.blur(); }, 1e3); - return () => clearTimeout(m); + return () => clearTimeout(y); }, [ i, s, @@ -172,15 +172,15 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S e, n ]); - const $ = () => { + const S = () => { var h, b; const f = parseInt(U(i), 10); if (isNaN(f)) { - o(_(e)), a(!1), c(null), (h = d.current) == null || h.blur(); + o($(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } - const m = Math.min(Math.max(f, 1), r); - m !== e ? (c(m), o(_(m)), n(m)) : (o(_(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); + const y = Math.min(Math.max(f, 1), r); + y !== e ? (c(y), o($(y)), n(y)) : (o($(e)), a(!1), c(null)), (b = d.current) == null || b.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ Y( W, @@ -196,9 +196,9 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S children: [ /* @__PURE__ */ Y(W, { spacing: 2, whiteSpace: "nowrap", children: [ /* @__PURE__ */ x(q, { fontWeight: "bold", children: "صفحه" }), - /* @__PURE__ */ x(q, { children: _(e) }), + /* @__PURE__ */ x(q, { children: $(e) }), /* @__PURE__ */ x(q, { fontWeight: "bold", children: "از" }), - /* @__PURE__ */ x(q, { children: _(r) }) + /* @__PURE__ */ x(q, { children: $(r) }) ] }), /* @__PURE__ */ Y(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ x( @@ -214,7 +214,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S "aria-label": "صفحه قبلی" } ), - y.map((f) => /* @__PURE__ */ x( + m.map((f) => /* @__PURE__ */ x( Te, { size: "md", @@ -223,7 +223,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", - children: _(f) + children: $(f) }, f )), @@ -253,14 +253,14 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S a(!0), c(null), o(""); }, onChange: (f) => { - const m = f.target.value, h = U(m).replace(/\D/g, ""); - o(_(h)); + const y = f.target.value, h = U(y).replace(/\D/g, ""); + o($(h)); }, onBlur: () => { - i || (o(_(e)), a(!1), c(null)); + i || (o($(e)), a(!1), c(null)); }, onKeyDown: (f) => { - f.key === "Enter" && $(); + f.key === "Enter" && S(); }, textAlign: "center", color: "#1D2939", @@ -272,7 +272,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S ] }), /* @__PURE__ */ Y(W, { spacing: 2, whiteSpace: "nowrap", children: [ /* @__PURE__ */ x(q, { fontWeight: "bold", children: "تعداد کل:" }), - /* @__PURE__ */ x(q, { children: _(t) }) + /* @__PURE__ */ x(q, { children: $(t) }) ] }) ] } @@ -283,7 +283,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S totalCount: t, onPageChange: n }) => { - const [i, o] = P(""), [s, a] = P(!1), [u, c] = P(null), d = te(null), y = u ?? e, $ = j( + const [i, o] = F(""), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = u ?? e, S = j( (w) => { const v = Math.min(Math.max(w, 1), r); a(!1), o(""), c(null), v !== e && n(v); @@ -302,19 +302,19 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S const v = Math.min(Math.max(w, 1), r); a(!1), o(""), v !== e ? (c(v), n(v)) : c(null); }, [i, e, r, n]); - L(() => { + B(() => { var w; s && ((w = d.current) == null || w.focus()); - }, [s]), L(() => { + }, [s]), B(() => { u !== null && e === u && c(null); - }, [e, u]), L(() => { + }, [e, u]), B(() => { if (!s || !i) return; const w = setTimeout(() => { f(); }, 1e3); return () => clearTimeout(w); }, [i, s, f]); - const m = () => { + const y = () => { c(null), o(""), a(!0); }, h = (w, v = !1) => /* @__PURE__ */ x( Te, @@ -323,14 +323,14 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S bg: v ? "#4B49AC" : "#e6e6f1", color: v ? "#e6e6f1" : "#4B49AC", _hover: { bg: v ? "#4B49AC" : "#cbcbe8" }, - onClick: v ? m : () => $(w), + onClick: v ? y : () => S(w), variant: "soft", - children: _(w) + children: $(w) }, w ); if (r === 0 || !t) return null; - const b = r > 1 && y !== 1, T = r > 1 && y !== r; + const b = r > 1 && m !== 1, _ = r > 1 && m !== r; return /* @__PURE__ */ x( W, { @@ -350,8 +350,8 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, - onClick: () => $(y - 1), - isDisabled: y === 1, + onClick: () => S(m - 1), + isDisabled: m === 1, icon: /* @__PURE__ */ x($e, {}), "aria-label": "صفحه قبلی" } @@ -368,7 +368,7 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S value: i, onChange: (w) => { const v = w.target.value, k = U(v).replace(/\D/g, ""); - o(_(k)); + o($(k)); }, onBlur: () => { i ? f() : (o(""), a(!1), c(null)); @@ -382,8 +382,8 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S minW: 0, dir: "ltr" } - ) : h(y, !0), - T && h(r), + ) : h(m, !0), + _ && h(r), /* @__PURE__ */ x( J, { @@ -391,8 +391,8 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, - onClick: () => $(y + 1), - isDisabled: y === r, + onClick: () => S(m + 1), + isDisabled: m === r, icon: /* @__PURE__ */ x(Re, {}), "aria-label": "صفحه بعدی" } @@ -401,12 +401,12 @@ const xn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), _ = (e) => S } ); }; -let xe = null, C = null, ve = null, Se = !1; -const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (C || (C = new jr({ +let xe = null, g = null, ve = null, Se = !1; +const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (g || (g = new jr({ url: e, realm: r, clientId: t -})), C), Zr = (e) => (xe = e, xe), et = () => Se, Xe = () => !!(C != null && C.authenticated), se = () => (C == null ? void 0 : C.token) ?? null, Be = async (e = 30) => C ? C.updateToken(e) : !1, Qe = (e) => C == null ? void 0 : C.logout(e), gn = (e) => C == null ? void 0 : C.login(e), Ze = ({ config: e, initOptions: r = {} } = {}) => { +})), g), Zr = (e) => (xe = e, xe), et = () => Se, Xe = () => !!(g != null && g.authenticated), se = () => (g == null ? void 0 : g.token) ?? null, Be = async (e = 30) => g ? g.updateToken(e) : !1, Qe = (e) => g == null ? void 0 : g.logout(e), gn = (e) => g == null ? void 0 : g.login(e), Ze = ({ config: e, initOptions: r = {} } = {}) => { const t = e ?? xe; if (!(t != null && t.url) || !(t != null && t.realm) || !(t != null && t.clientId)) throw new Error("Keycloak config is required."); @@ -426,33 +426,33 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (C || (C = new initOptions: t, loading: n = null }) => { - const [i, o] = P(!1), [s, a] = P(!1), [u, c] = P(null), d = te(!1), y = j(() => { - C && (a(!!C.authenticated), c(C.token ?? null)); + const [i, o] = F(!1), [s, a] = F(!1), [u, c] = F(null), d = te(!1), m = j(() => { + g && (a(!!g.authenticated), c(g.token ?? null)); }, []); - L(() => (d.current = !0, Ze({ config: r, initOptions: t }).then((b) => { - d.current && (a(!!b), c((C == null ? void 0 : C.token) ?? null), o(!0)); + B(() => (d.current = !0, Ze({ config: r, initOptions: t }).then((b) => { + d.current && (a(!!b), c((g == null ? void 0 : g.token) ?? null), o(!0)); }).catch(() => { d.current && (a(!1), c(null), o(!0)); }), () => { d.current = !1; }), [r, t]); - const $ = j(() => C == null ? void 0 : C.login(), []), f = j((b) => C == null ? void 0 : C.logout(b), []), m = j( + const S = j(() => g == null ? void 0 : g.login(), []), f = j((b) => g == null ? void 0 : g.logout(b), []), y = j( async (b = 30) => { - if (!C) return !1; - const T = await C.updateToken(b); - return y(), T; + if (!g) return !1; + const _ = await g.updateToken(b); + return m(), _; }, - [y] + [m] ), h = fe( () => ({ initialized: i, authenticated: s, token: u, - login: $, + login: S, logout: f, - updateToken: m + updateToken: y }), - [i, s, u, $, f, m] + [i, s, u, S, f, y] ); return i ? /* @__PURE__ */ x(Xr.Provider, { value: h, children: e }) : n; }, er = Je(null), he = "permissions", tt = (e) => (e == null ? void 0 : e.storageKey) || he, nt = ({ @@ -462,30 +462,30 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (C || (C = new loading: n = /* @__PURE__ */ x("div", { children: "Loading permissions..." }), errorFallback: i = /* @__PURE__ */ x("div", { children: "Error loading permissions" }) }) => { - const o = tt(t), [s, a] = P( + const o = tt(t), [s, a] = F( () => it(o) - ), { data: u, isLoading: c, error: d } = ut(t), y = u ?? s; - L(() => { + ), { data: u, isLoading: c, error: d } = ut(t), m = u ?? s; + B(() => { u && (ot(o, u), a(u)); }, [u, o]); - const $ = fe( - () => st(y), - [y] + const S = fe( + () => st(m), + [m] ), f = j( - (b = "") => at($, b), - [$] - ), m = j((b = "") => !f(b), [f]), h = fe( + (b = "") => at(S, b), + [S] + ), y = j((b = "") => !f(b), [f]), h = fe( () => ({ user: e, can: f, - cannot: m, - permissions: y, + cannot: y, + permissions: m, isLoading: c, error: d }), - [e, f, m, y, c, d] + [e, f, y, m, c, d] ); - return d && !y ? i : c && !y ? n : /* @__PURE__ */ x(er.Provider, { value: h, children: r }); + return d && !m ? i : c && !m ? n : /* @__PURE__ */ x(er.Provider, { value: h, children: r }); }, it = (e = he) => { if (!(typeof window > "u")) try { @@ -554,7 +554,7 @@ const Xr = Je(null), Qr = ({ url: e, realm: r, clientId: t }) => (C || (C = new return t && r("admin") ? e : null; }, $n = ({ children: e }) => { const { can: r, isLoading: t } = ke(); - return L(() => { + return B(() => { t || r("panel_access") || Qe(); }, [t, r]), e; }; @@ -615,8 +615,8 @@ const ft = (e) => { } ); function ht() { - const [e, r] = P(!1), t = te(null); - return L(() => { + const [e, r] = F(!1), t = te(null); + return B(() => { if (process.env.NODE_ENV !== "production") return; let n; const i = async () => { @@ -711,7 +711,7 @@ var bt = /* @__PURE__ */ function() { return (i = n.parentNode) == null ? void 0 : i.removeChild(n); }), this.tags = [], this.ctr = 0; }, e; -}(), O = "-ms-", de = "-moz-", S = "-webkit-", tr = "comm", Ie = "rule", Me = "decl", vt = "@import", nr = "@keyframes", wt = "@layer", xt = Math.abs, pe = String.fromCharCode, St = Object.assign; +}(), O = "-ms-", de = "-moz-", E = "-webkit-", tr = "comm", Ie = "rule", Me = "decl", vt = "@import", nr = "@keyframes", wt = "@layer", xt = Math.abs, pe = String.fromCharCode, St = Object.assign; function Et(e, r) { return M(e, 0) ^ 45 ? (((r << 2 ^ M(e, 0)) << 2 ^ M(e, 1)) << 2 ^ M(e, 2)) << 2 ^ M(e, 3) : 0; } @@ -721,7 +721,7 @@ function ir(e) { function Ct(e, r) { return (e = r.exec(e)) ? e[0] : e; } -function E(e, r, t) { +function C(e, r, t) { return e.replace(r, t); } function Ee(e, r) { @@ -758,7 +758,7 @@ function At() { function Tt() { return I = D > 0 ? M(X, --D) : 0, H--, I === 10 && (H = 1, me--), I; } -function B() { +function L() { return I = D < or ? M(X, D++) : 0, H++, I === 10 && (H = 1, me++), I; } function V() { @@ -813,16 +813,16 @@ function ce(e) { } function _t(e) { for (; (I = V()) && I < 33; ) - B(); + L(); return ee(e) > 2 || ee(I) > 3 ? "" : " "; } function $t(e, r) { - for (; --r && B() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97); ) + for (; --r && L() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97); ) ; - return ne(e, ae() + (r < 6 && V() == 32 && B() == 32)); + return ne(e, ae() + (r < 6 && V() == 32 && L() == 32)); } function Ce(e) { - for (; B(); ) + for (; L(); ) switch (I) { case e: return D; @@ -834,31 +834,31 @@ function Ce(e) { e === 41 && Ce(e); break; case 92: - B(); + L(); break; } return D; } function Rt(e, r) { - for (; B() && e + I !== 57; ) + for (; L() && e + I !== 57; ) if (e + I === 84 && V() === 47) break; - return "/*" + ne(r, D - 1) + "*" + pe(e === 47 ? e : B()); + return "/*" + ne(r, D - 1) + "*" + pe(e === 47 ? e : L()); } function kt(e) { for (; !ee(V()); ) - B(); + L(); return ne(e, D); } function It(e) { return ar(ue("", null, null, null, [""], e = sr(e), 0, [0], e)); } function ue(e, r, t, n, i, o, s, a, u) { - for (var c = 0, d = 0, y = s, $ = 0, f = 0, m = 0, h = 1, b = 1, T = 1, w = 0, v = "", k = i, l = o, N = n, R = v; b; ) - switch (m = w, w = B()) { + for (var c = 0, d = 0, m = s, S = 0, f = 0, y = 0, h = 1, b = 1, _ = 1, w = 0, v = "", k = i, l = o, N = n, R = v; b; ) + switch (y = w, w = L()) { case 40: - if (m != 108 && M(R, y - 1) == 58) { - Ee(R += E(ce(w), "&", "&\f"), "&\f") != -1 && (T = -1); + if (y != 108 && M(R, m - 1) == 58) { + Ee(R += C(ce(w), "&", "&\f"), "&\f") != -1 && (_ = -1); break; } case 34: @@ -870,7 +870,7 @@ function ue(e, r, t, n, i, o, s, a, u) { case 10: case 13: case 32: - R += _t(m); + R += _t(y); break; case 92: R += $t(ae() - 1, 7); @@ -879,14 +879,14 @@ function ue(e, r, t, n, i, o, s, a, u) { switch (V()) { case 42: case 47: - oe(Mt(Rt(B(), ae()), r, t), u); + oe(Mt(Rt(L(), ae()), r, t), u); break; default: R += "/"; } break; case 123 * h: - a[c++] = z(R) * T; + a[c++] = z(R) * _; case 125 * h: case 59: case 0: @@ -895,30 +895,30 @@ function ue(e, r, t, n, i, o, s, a, u) { case 125: b = 0; case 59 + d: - T == -1 && (R = E(R, /\f/g, "")), f > 0 && z(R) - y && oe(f > 32 ? ze(R + ";", n, t, y - 1) : ze(E(R, " ", "") + ";", n, t, y - 2), u); + _ == -1 && (R = C(R, /\f/g, "")), f > 0 && z(R) - m && oe(f > 32 ? ze(R + ";", n, t, m - 1) : ze(C(R, " ", "") + ";", n, t, m - 2), u); break; case 59: R += ";"; default: - if (oe(N = Le(R, r, t, c, d, i, a, v, k = [], l = [], y), o), w === 123) + if (oe(N = Le(R, r, t, c, d, i, a, v, k = [], l = [], m), o), w === 123) if (d === 0) - ue(R, r, N, N, k, o, y, a, l); + ue(R, r, N, N, k, o, m, a, l); else - switch ($ === 99 && M(R, 3) === 110 ? 100 : $) { + switch (S === 99 && M(R, 3) === 110 ? 100 : S) { case 100: case 108: case 109: case 115: - ue(e, N, N, n && oe(Le(e, N, N, 0, 0, i, a, v, i, k = [], y), l), i, l, y, a, n ? k : l); + ue(e, N, N, n && oe(Le(e, N, N, 0, 0, i, a, v, i, k = [], m), l), i, l, m, a, n ? k : l); break; default: ue(R, N, N, N, [""], l, 0, a, l); } } - c = d = f = 0, h = T = 1, v = R = "", y = s; + c = d = f = 0, h = _ = 1, v = R = "", m = s; break; case 58: - y = 1 + z(R), f = m; + m = 1 + z(R), f = y; default: if (h < 1) { if (w == 123) @@ -928,24 +928,24 @@ function ue(e, r, t, n, i, o, s, a, u) { } switch (R += pe(w), w * h) { case 38: - T = d > 0 ? 1 : (R += "\f", -1); + _ = d > 0 ? 1 : (R += "\f", -1); break; case 44: - a[c++] = (z(R) - 1) * T, T = 1; + a[c++] = (z(R) - 1) * _, _ = 1; break; case 64: - V() === 45 && (R += ce(B())), $ = V(), d = y = z(v = R += kt(ae())), w++; + V() === 45 && (R += ce(L())), S = V(), d = m = z(v = R += kt(ae())), w++; break; case 45: - m === 45 && z(R) == 2 && (h = 0); + y === 45 && z(R) == 2 && (h = 0); } } return o; } function Le(e, r, t, n, i, o, s, a, u, c, d) { - for (var y = i - 1, $ = i === 0 ? o : [""], f = Ne($), m = 0, h = 0, b = 0; m < n; ++m) - for (var T = 0, w = Z(e, y + 1, y = xt(h = s[m])), v = e; T < f; ++T) - (v = ir(h > 0 ? $[T] + " " + w : E(w, /&\f/g, $[T]))) && (u[b++] = v); + for (var m = i - 1, S = i === 0 ? o : [""], f = Ne(S), y = 0, h = 0, b = 0; y < n; ++y) + for (var _ = 0, w = Z(e, m + 1, m = xt(h = s[y])), v = e; _ < f; ++_) + (v = ir(h > 0 ? S[_] + " " + w : C(w, /&\f/g, S[_]))) && (u[b++] = v); return ye(e, r, t, i === 0 ? Ie : a, u, c, d); } function Mt(e, r, t) { @@ -996,7 +996,7 @@ function Pt(e) { } var Dt = function(r, t, n) { for (var i = 0, o = 0; i = o, o = V(), i === 38 && o === 12 && (t[n] = 1), !ee(o); ) - B(); + L(); return ne(r, D); }, Bt = function(r, t) { var n = -1, i = 44; @@ -1016,7 +1016,7 @@ var Dt = function(r, t, n) { default: r[n] += pe(i); } - while (i = B()); + while (i = L()); return r; }, Lt = function(r, t) { return ar(Bt(sr(r), t)); @@ -1044,7 +1044,7 @@ var Dt = function(r, t, n) { function cr(e, r) { switch (Et(e, r)) { case 5103: - return S + "print-" + e + e; + return E + "print-" + e + e; case 5737: case 4201: case 3177: @@ -1070,44 +1070,44 @@ function cr(e, r) { case 5365: case 5621: case 3829: - return S + e + e; + return E + e + e; case 5349: case 4246: case 4810: case 6968: case 2756: - return S + e + de + e + O + e + e; + return E + e + de + e + O + e + e; case 6828: case 4268: - return S + e + O + e + e; + return E + e + O + e + e; case 6165: - return S + e + O + "flex-" + e + e; + return E + e + O + "flex-" + e + e; case 5187: - return S + e + E(e, /(\w+).+(:[^]+)/, S + "box-$1$2" + O + "flex-$1$2") + e; + return E + e + C(e, /(\w+).+(:[^]+)/, E + "box-$1$2" + O + "flex-$1$2") + e; case 5443: - return S + e + O + "flex-item-" + E(e, /flex-|-self/, "") + e; + return E + e + O + "flex-item-" + C(e, /flex-|-self/, "") + e; case 4675: - return S + e + O + "flex-line-pack" + E(e, /align-content|flex-|-self/, "") + e; + return E + e + O + "flex-line-pack" + C(e, /align-content|flex-|-self/, "") + e; case 5548: - return S + e + O + E(e, "shrink", "negative") + e; + return E + e + O + C(e, "shrink", "negative") + e; case 5292: - return S + e + O + E(e, "basis", "preferred-size") + e; + return E + e + O + C(e, "basis", "preferred-size") + e; case 6060: - return S + "box-" + E(e, "-grow", "") + S + e + O + E(e, "grow", "positive") + e; + return E + "box-" + C(e, "-grow", "") + E + e + O + C(e, "grow", "positive") + e; case 4554: - return S + E(e, /([^-])(transform)/g, "$1" + S + "$2") + e; + return E + C(e, /([^-])(transform)/g, "$1" + E + "$2") + e; case 6187: - return E(E(E(e, /(zoom-|grab)/, S + "$1"), /(image-set)/, S + "$1"), e, "") + e; + return C(C(C(e, /(zoom-|grab)/, E + "$1"), /(image-set)/, E + "$1"), e, "") + e; case 5495: case 3959: - return E(e, /(image-set\([^]*)/, S + "$1$`$1"); + return C(e, /(image-set\([^]*)/, E + "$1$`$1"); case 4968: - return E(E(e, /(.+:)(flex-)?(.*)/, S + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + S + e + e; + return C(C(e, /(.+:)(flex-)?(.*)/, E + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + E + e + e; case 4095: case 3583: case 4068: case 2532: - return E(e, /(.+)-inline(.+)/, S + "$1$2") + e; + return C(e, /(.+)-inline(.+)/, E + "$1$2") + e; case 8116: case 7059: case 5753: @@ -1124,9 +1124,9 @@ function cr(e, r) { case 109: if (M(e, r + 4) !== 45) break; case 102: - return E(e, /(.+:)(.+)-([^]+)/, "$1" + S + "$2-$3$1" + de + (M(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; + return C(e, /(.+:)(.+)-([^]+)/, "$1" + E + "$2-$3$1" + de + (M(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; case 115: - return ~Ee(e, "stretch") ? cr(E(e, "stretch", "fill-available"), r) + e : e; + return ~Ee(e, "stretch") ? cr(C(e, "stretch", "fill-available"), r) + e : e; } break; case 4949: @@ -1134,21 +1134,21 @@ function cr(e, r) { case 6444: switch (M(e, z(e) - 3 - (~Ee(e, "!important") && 10))) { case 107: - return E(e, ":", ":" + S) + e; + return C(e, ":", ":" + E) + e; case 101: - return E(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + S + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + S + "$2$3$1" + O + "$2box$3") + e; + return C(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + E + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + E + "$2$3$1" + O + "$2box$3") + e; } break; case 5936: switch (M(e, r + 11)) { case 114: - return S + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb") + e; + return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "tb") + e; case 108: - return S + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; + return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; case 45: - return S + e + O + E(e, /[svh]\w+-[tblr]{2}/, "lr") + e; + return E + e + O + C(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } - return S + e + O + e + e; + return E + e + O + e + e; } return e; } @@ -1159,7 +1159,7 @@ var Yt = function(r, t, n, i) { break; case nr: return G([Q(r, { - value: E(r.value, "@", "@" + S) + value: C(r.value, "@", "@" + E) })], i); case Ie: if (r.length) return gt(r.props, function(o) { @@ -1167,15 +1167,15 @@ var Yt = function(r, t, n, i) { case ":read-only": case ":read-write": return G([Q(r, { - props: [E(o, /:(read-\w+)/, ":" + de + "$1")] + props: [C(o, /:(read-\w+)/, ":" + de + "$1")] })], i); case "::placeholder": return G([Q(r, { - props: [E(o, /:(plac\w+)/, ":" + S + "input-$1")] + props: [C(o, /:(plac\w+)/, ":" + E + "input-$1")] }), Q(r, { - props: [E(o, /:(plac\w+)/, ":" + de + "$1")] + props: [C(o, /:(plac\w+)/, ":" + de + "$1")] }), Q(r, { - props: [E(o, /:(plac\w+)/, O + "input-$1")] + props: [C(o, /:(plac\w+)/, O + "input-$1")] })], i); } return ""; @@ -1196,23 +1196,23 @@ var Yt = function(r, t, n, i) { // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll('style[data-emotion^="' + t + ' "]'), function(h) { - for (var b = h.getAttribute("data-emotion").split(" "), T = 1; T < b.length; T++) - o[b[T]] = !0; + for (var b = h.getAttribute("data-emotion").split(" "), _ = 1; _ < b.length; _++) + o[b[_]] = !0; a.push(h); } ); var u, c = [zt, Kt]; { - var d, y = [Nt, Ft(function(h) { + var d, m = [Nt, Ft(function(h) { d.insert(h); - })], $ = Ot(c.concat(i, y)), f = function(b) { - return G(It(b), $); + })], S = Ot(c.concat(i, m)), f = function(b) { + return G(It(b), S); }; - u = function(b, T, w, v) { - d = w, f(b ? b + "{" + T.styles + "}" : T.styles), v && (m.inserted[T.name] = !0); + u = function(b, _, w, v) { + d = w, f(b ? b + "{" + _.styles + "}" : _.styles), v && (y.inserted[_.name] = !0); }; } - var m = { + var y = { key: t, sheet: new bt({ key: t, @@ -1227,8 +1227,8 @@ var Yt = function(r, t, n, i) { registered: {}, insert: u }; - return m.sheet.hydrate(a), m; -}, ge = { exports: {} }, g = {}; + return y.sheet.hydrate(a), y; +}, ge = { exports: {} }, A = {}; /** @license React v16.13.1 * react-is.production.min.js * @@ -1239,9 +1239,9 @@ var Yt = function(r, t, n, i) { */ var Ye; function qt() { - if (Ye) return g; + if (Ye) return A; Ye = 1; - var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, y = e ? Symbol.for("react.suspense") : 60113, $ = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, m = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, T = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; + var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; function v(l) { if (typeof l == "object" && l !== null) { var N = l.$$typeof; @@ -1253,13 +1253,13 @@ function qt() { case n: case o: case i: - case y: + case m: return l; default: switch (l = l && l.$$typeof, l) { case a: case d: - case m: + case y: case f: case s: return l; @@ -1275,35 +1275,35 @@ function qt() { function k(l) { return v(l) === c; } - return g.AsyncMode = u, g.ConcurrentMode = c, g.ContextConsumer = a, g.ContextProvider = s, g.Element = r, g.ForwardRef = d, g.Fragment = n, g.Lazy = m, g.Memo = f, g.Portal = t, g.Profiler = o, g.StrictMode = i, g.Suspense = y, g.isAsyncMode = function(l) { + return A.AsyncMode = u, A.ConcurrentMode = c, A.ContextConsumer = a, A.ContextProvider = s, A.Element = r, A.ForwardRef = d, A.Fragment = n, A.Lazy = y, A.Memo = f, A.Portal = t, A.Profiler = o, A.StrictMode = i, A.Suspense = m, A.isAsyncMode = function(l) { return k(l) || v(l) === u; - }, g.isConcurrentMode = k, g.isContextConsumer = function(l) { + }, A.isConcurrentMode = k, A.isContextConsumer = function(l) { return v(l) === a; - }, g.isContextProvider = function(l) { + }, A.isContextProvider = function(l) { return v(l) === s; - }, g.isElement = function(l) { + }, A.isElement = function(l) { return typeof l == "object" && l !== null && l.$$typeof === r; - }, g.isForwardRef = function(l) { + }, A.isForwardRef = function(l) { return v(l) === d; - }, g.isFragment = function(l) { + }, A.isFragment = function(l) { return v(l) === n; - }, g.isLazy = function(l) { - return v(l) === m; - }, g.isMemo = function(l) { - return v(l) === f; - }, g.isPortal = function(l) { - return v(l) === t; - }, g.isProfiler = function(l) { - return v(l) === o; - }, g.isStrictMode = function(l) { - return v(l) === i; - }, g.isSuspense = function(l) { + }, A.isLazy = function(l) { return v(l) === y; - }, g.isValidElementType = function(l) { - return typeof l == "string" || typeof l == "function" || l === n || l === c || l === o || l === i || l === y || l === $ || typeof l == "object" && l !== null && (l.$$typeof === m || l.$$typeof === f || l.$$typeof === s || l.$$typeof === a || l.$$typeof === d || l.$$typeof === b || l.$$typeof === T || l.$$typeof === w || l.$$typeof === h); - }, g.typeOf = v, g; + }, A.isMemo = function(l) { + return v(l) === f; + }, A.isPortal = function(l) { + return v(l) === t; + }, A.isProfiler = function(l) { + return v(l) === o; + }, A.isStrictMode = function(l) { + return v(l) === i; + }, A.isSuspense = function(l) { + return v(l) === m; + }, A.isValidElementType = function(l) { + return typeof l == "string" || typeof l == "function" || l === n || l === c || l === o || l === i || l === m || l === S || typeof l == "object" && l !== null && (l.$$typeof === y || l.$$typeof === f || l.$$typeof === s || l.$$typeof === a || l.$$typeof === d || l.$$typeof === b || l.$$typeof === _ || l.$$typeof === w || l.$$typeof === h); + }, A.typeOf = v, A; } -var A = {}; +var T = {}; /** @license React v16.13.1 * react-is.development.js * @@ -1315,10 +1315,10 @@ var A = {}; var Ve; function jt() { return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() { - var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, y = e ? Symbol.for("react.suspense") : 60113, $ = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, m = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, T = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; + var e = typeof Symbol == "function" && Symbol.for, r = e ? Symbol.for("react.element") : 60103, t = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, i = e ? Symbol.for("react.strict_mode") : 60108, o = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, u = e ? Symbol.for("react.async_mode") : 60111, c = e ? Symbol.for("react.concurrent_mode") : 60111, d = e ? Symbol.for("react.forward_ref") : 60112, m = e ? Symbol.for("react.suspense") : 60113, S = e ? Symbol.for("react.suspense_list") : 60120, f = e ? Symbol.for("react.memo") : 60115, y = e ? Symbol.for("react.lazy") : 60116, h = e ? Symbol.for("react.block") : 60121, b = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; function v(p) { return typeof p == "string" || typeof p == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. - p === n || p === c || p === o || p === i || p === y || p === $ || typeof p == "object" && p !== null && (p.$$typeof === m || p.$$typeof === f || p.$$typeof === s || p.$$typeof === a || p.$$typeof === d || p.$$typeof === b || p.$$typeof === T || p.$$typeof === w || p.$$typeof === h); + p === n || p === c || p === o || p === i || p === m || p === S || typeof p == "object" && p !== null && (p.$$typeof === y || p.$$typeof === f || p.$$typeof === s || p.$$typeof === a || p.$$typeof === d || p.$$typeof === b || p.$$typeof === _ || p.$$typeof === w || p.$$typeof === h); } function k(p) { if (typeof p == "object" && p !== null) { @@ -1332,14 +1332,14 @@ function jt() { case n: case o: case i: - case y: + case m: return ie; default: var De = ie && ie.$$typeof; switch (De) { case a: case d: - case m: + case y: case f: case s: return De; @@ -1352,7 +1352,7 @@ function jt() { } } } - var l = u, N = c, R = a, wr = s, xr = r, Sr = d, Er = n, Cr = m, gr = f, Ar = t, Tr = o, _r = i, $r = y, Fe = !1; + var l = u, N = c, R = a, wr = s, xr = r, Sr = d, Er = n, Cr = y, gr = f, Ar = t, Tr = o, _r = i, $r = m, Fe = !1; function Rr(p) { return Fe || (Fe = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), Pe(p) || k(p) === u; } @@ -1375,7 +1375,7 @@ function jt() { return k(p) === n; } function Fr(p) { - return k(p) === m; + return k(p) === y; } function Pr(p) { return k(p) === f; @@ -1390,10 +1390,10 @@ function jt() { return k(p) === i; } function zr(p) { - return k(p) === y; + return k(p) === m; } - A.AsyncMode = l, A.ConcurrentMode = N, A.ContextConsumer = R, A.ContextProvider = wr, A.Element = xr, A.ForwardRef = Sr, A.Fragment = Er, A.Lazy = Cr, A.Memo = gr, A.Portal = Ar, A.Profiler = Tr, A.StrictMode = _r, A.Suspense = $r, A.isAsyncMode = Rr, A.isConcurrentMode = Pe, A.isContextConsumer = kr, A.isContextProvider = Ir, A.isElement = Mr, A.isForwardRef = Nr, A.isFragment = Or, A.isLazy = Fr, A.isMemo = Pr, A.isPortal = Dr, A.isProfiler = Br, A.isStrictMode = Lr, A.isSuspense = zr, A.isValidElementType = v, A.typeOf = k; - }()), A; + T.AsyncMode = l, T.ConcurrentMode = N, T.ContextConsumer = R, T.ContextProvider = wr, T.Element = xr, T.ForwardRef = Sr, T.Fragment = Er, T.Lazy = Cr, T.Memo = gr, T.Portal = Ar, T.Profiler = Tr, T.StrictMode = _r, T.Suspense = $r, T.isAsyncMode = Rr, T.isConcurrentMode = Pe, T.isContextConsumer = kr, T.isContextProvider = Ir, T.isElement = Mr, T.isForwardRef = Nr, T.isFragment = Or, T.isLazy = Fr, T.isMemo = Pr, T.isPortal = Dr, T.isProfiler = Br, T.isStrictMode = Lr, T.isSuspense = zr, T.isValidElementType = v, T.typeOf = k; + }()), T; } process.env.NODE_ENV === "production" ? ge.exports = qt() : ge.exports = jt(); var Ut = ge.exports, ur = Ut, Gt = { @@ -1623,16 +1623,16 @@ function pr(e, r, t) { je.lastIndex = 0; for (var c = "", d; (d = je.exec(i)) !== null; ) c += "-" + d[1]; - var y = Qt(i) + c; + var m = Qt(i) + c; return { - name: y, + name: m, styles: i, next: K }; } var nn = function(r) { return r(); -}, mr = F.useInsertionEffect ? F.useInsertionEffect : !1, on = mr || nn, Ue = mr || F.useLayoutEffect, yr = /* @__PURE__ */ F.createContext( +}, mr = P.useInsertionEffect ? P.useInsertionEffect : !1, on = mr || nn, Ue = mr || P.useLayoutEffect, yr = /* @__PURE__ */ P.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes @@ -1649,7 +1649,7 @@ var br = function(r) { var i = He(yr); return r(t, i, n); }); -}, vr = /* @__PURE__ */ F.createContext({}), Oe = {}.hasOwnProperty, Ae = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", sn = function(r, t) { +}, vr = /* @__PURE__ */ P.createContext({}), Oe = {}.hasOwnProperty, Ae = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", sn = function(r, t) { var n = {}; for (var i in t) Oe.call(t, i) && (n[i] = t[i]); @@ -1664,32 +1664,32 @@ var br = function(r) { typeof n == "string" && r.registered[n] !== void 0 && (n = r.registered[n]); var i = e[Ae], o = [n], s = ""; typeof e.className == "string" ? s = Xt(r.registered, o, e.className) : e.className != null && (s = e.className + " "); - var a = pr(o, void 0, F.useContext(vr)); + var a = pr(o, void 0, P.useContext(vr)); s += r.key + "-" + a.name; var u = {}; for (var c in e) Oe.call(e, c) && c !== "css" && c !== Ae && (u[c] = e[c]); - return u.className = s, t && (u.ref = t), /* @__PURE__ */ F.createElement(F.Fragment, null, /* @__PURE__ */ F.createElement(an, { + return u.className = s, t && (u.ref = t), /* @__PURE__ */ P.createElement(P.Fragment, null, /* @__PURE__ */ P.createElement(an, { cache: r, serialized: a, isStringTag: typeof i == "string" - }), /* @__PURE__ */ F.createElement(i, u)); + }), /* @__PURE__ */ P.createElement(i, u)); }), un = cn, Ge = function(r, t) { var n = arguments; if (t == null || !Oe.call(t, "css")) - return F.createElement.apply(void 0, n); + return P.createElement.apply(void 0, n); var i = n.length, o = new Array(i); o[0] = un, o[1] = sn(r, t); for (var s = 2; s < i; s++) o[s] = n[s]; - return F.createElement.apply(null, o); + return P.createElement.apply(null, o); }; (function(e) { var r; r || (r = e.JSX || (e.JSX = {})); })(Ge || (Ge = {})); var fn = /* @__PURE__ */ br(function(e, r) { - var t = e.styles, n = pr([t], void 0, F.useContext(vr)), i = F.useRef(); + var t = e.styles, n = pr([t], void 0, P.useContext(vr)), i = P.useRef(); return Ue(function() { var o = r.key + "-global", s = new r.sheet.constructor({ key: o, @@ -1758,7 +1758,7 @@ function kn({ keycloakRealm: u = "bi", permissionUrl: c = "https://api.d.aiengines.ir/user_api/v1/permissions/list" }) { - const d = fe( + const [d, m] = F(!1), S = fe( () => ({ api: { baseUrl: r @@ -1782,15 +1782,17 @@ function kn({ c ] ); - return L(() => { - lt(d); - }, [d]), /* @__PURE__ */ x(Wr, { theme: ln, children: /* @__PURE__ */ Y(Jr, { client: pt, children: [ + return B(() => { + m(!0); + }, []), B(() => { + d && lt(S); + }, [d, S]), d ? /* @__PURE__ */ x(Wr, { theme: ln, children: /* @__PURE__ */ Y(Jr, { client: pt, children: [ o && /* @__PURE__ */ x(ht, { ...s }), - /* @__PURE__ */ x(rt, { config: d.keycloak, loading: i, children: /* @__PURE__ */ Y(nt, { config: d.permission, loading: i, children: [ + /* @__PURE__ */ x(rt, { config: S.keycloak, loading: i, children: /* @__PURE__ */ Y(nt, { config: S.permission, loading: i, children: [ /* @__PURE__ */ x(dn, {}), e ] }) }) - ] }) }); + ] }) }) : null; } export { _n as AdminGuard, @@ -1820,7 +1822,7 @@ export { rr as permissionKeys, ot as setCachedPermissions, U as toEnDigits, - _ as toFaDigits, + $ as toFaDigits, xn as toFaNumber, Be as updateKeycloakToken, ke as usePermission, diff --git a/src/provider/BiProvider.jsx b/src/provider/BiProvider.jsx index 67f1bf4..d8e1028 100644 --- a/src/provider/BiProvider.jsx +++ b/src/provider/BiProvider.jsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo } from "react"; +import { useEffect, useMemo, useState } from "react"; import { ChakraProvider, Spinner } from "@chakra-ui/react"; import { QueryClientProvider } from "@tanstack/react-query"; import { KeycloakProvider } from "../core/keycloak.jsx"; @@ -20,6 +20,8 @@ export function BiProvider({ keycloakRealm = "bi", permissionUrl = "https://api.d.aiengines.ir/user_api/v1/permissions/list", }) { + const [mounted, setMounted] = useState(false); + const config = useMemo( () => ({ api: { @@ -46,8 +48,18 @@ export function BiProvider({ ); useEffect(() => { - configureApi(config); - }, [config]); + setMounted(true); + }, []); + + useEffect(() => { + if (mounted) { + configureApi(config); + } + }, [mounted, config]); + + if (!mounted) { + return null; + } return (