import { jsxs as K, jsx as b } from "react/jsx-runtime"; import * as B from "react"; import { useState as F, useRef as te, useEffect as D, useCallback as q, createContext as He, useMemo as fe, useContext as Je, forwardRef as Yr } from "react"; import { HStack as W, IconButton as H, Button as Te, Input as _e, Text as L, extendTheme as Vr, withDefaultColorScheme as jr, ChakraProvider as qr, Spinner as Ur, Box as Gr, VStack as Xe, Image as Qe } from "@chakra-ui/react"; import { IoChevronForwardOutline as Re, IoChevronBackOutline as $e } from "react-icons/io5"; import Hr from "keycloak-js"; import { useQuery as Jr, QueryClient as Xr, QueryClientProvider as Qr } from "@tanstack/react-query"; import Zr from "axios"; const kn = (e) => new Intl.NumberFormat("fa-IR").format(Number(e)), R = (e) => String(e).replace(/\d/g, (r) => "۰۱۲۳۴۵۶۷۸۹"[Number(r)]), U = (e) => String(e).replace(/[۰-۹]/g, (t) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(t))), In = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { const [i, o] = F(R(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 ); D(() => { if (u !== null) { e === u && (c(null), a(!1), o(R(e))); return; } s || o(R(e)); }, [e, s, u]), D(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; const y = setTimeout(() => { var v; const h = Math.min(Math.max(f, 1), r); h !== e ? (c(h), o(R(h)), n(h)) : (a(!1), o(R(e))), (v = d.current) == null || v.blur(); }, 1e3); return () => clearTimeout(y); }, [ i, s, u, r, e, n ]); const S = () => { var h, v; const f = parseInt(U(i), 10); if (isNaN(f)) { o(R(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } const y = Math.min(Math.max(f, 1), r); y !== e ? (c(y), o(R(y)), n(y)) : (o(R(e)), a(!1), c(null)), (v = d.current) == null || v.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ K( W, { justifyContent: "space-around", backgroundColor: "white", py: "10px", px: "16px", rounded: "lg", border: "1px", borderColor: "blue.200", w: "100%", children: [ /* @__PURE__ */ K(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ b( H, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e - 1), isDisabled: e === 1, icon: /* @__PURE__ */ b(Re, {}), "aria-label": "صفحه قبلی" } ), m.map((f) => /* @__PURE__ */ b( Te, { size: "md", px: 2, bg: e === f ? "#4B49AC" : "#e6e6f1", color: e === f ? "#e6e6f1" : "#4B49AC", _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", children: R(f) }, f )), /* @__PURE__ */ b( H, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e + 1), isDisabled: e === r, icon: /* @__PURE__ */ b($e, {}), "aria-label": "صفحه بعدی" } ), /* @__PURE__ */ b( _e, { ref: d, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "56px", value: i, onFocus: () => { a(!0), c(null), o(""); }, onChange: (f) => { const y = f.target.value, h = U(y).replace(/\D/g, ""); o(R(h)); }, onBlur: () => { i || (o(R(e)), a(!1), c(null)); }, onKeyDown: (f) => { f.key === "Enter" && S(); }, textAlign: "center", color: "#1D2939", px: 1, minW: 0, dir: "ltr" } ) ] }), /* @__PURE__ */ K(W, { spacing: 2, children: [ /* @__PURE__ */ b(L, { w: "auto", fontWeight: "bold", whiteSpace: "nowrap", children: "تعداد کل:" }), /* @__PURE__ */ b(L, { children: R(t) }) ] }) ] } ); }, Mn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { const [i, o] = F(R(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, y) => f - y); D(() => { if (u !== null) { e === u && (c(null), a(!1), o(R(e))); return; } s || o(R(e)); }, [e, s, u]), D(() => { if (!s || !i || u !== null) return; const f = parseInt(U(i), 10); if (isNaN(f)) return; const y = setTimeout(() => { var v; const h = Math.min(Math.max(f, 1), r); h !== e ? (c(h), o(R(h)), n(h)) : (a(!1), o(R(e))), (v = d.current) == null || v.blur(); }, 1e3); return () => clearTimeout(y); }, [ i, s, u, r, e, n ]); const S = () => { var h, v; const f = parseInt(U(i), 10); if (isNaN(f)) { o(R(e)), a(!1), c(null), (h = d.current) == null || h.blur(); return; } const y = Math.min(Math.max(f, 1), r); y !== e ? (c(y), o(R(y)), n(y)) : (o(R(e)), a(!1), c(null)), (v = d.current) == null || v.blur(); }; return r === 0 || !t ? null : /* @__PURE__ */ K( W, { justifyContent: "space-around", backgroundColor: "white", py: "10px", px: "16px", rounded: "lg", border: "1px", borderColor: "blue.200", w: "100%", children: [ /* @__PURE__ */ K(W, { spacing: 2, whiteSpace: "nowrap", children: [ /* @__PURE__ */ b(L, { fontWeight: "bold", children: "صفحه" }), /* @__PURE__ */ b(L, { children: R(e) }), /* @__PURE__ */ b(L, { fontWeight: "bold", children: "از" }), /* @__PURE__ */ b(L, { children: R(r) }) ] }), /* @__PURE__ */ K(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ b( H, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e - 1), isDisabled: e === 1, icon: /* @__PURE__ */ b(Re, {}), "aria-label": "صفحه قبلی" } ), m.map((f) => /* @__PURE__ */ b( Te, { size: "md", bg: e === f ? "#4B49AC" : "#e6e6f1", color: e === f ? "#e6e6f1" : "#4B49AC", _hover: { bg: e === f ? "#4B49AC" : "#cbcbe8" }, onClick: () => n(f), variant: "soft", children: R(f) }, f )), /* @__PURE__ */ b( H, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => n(e + 1), isDisabled: e === r, icon: /* @__PURE__ */ b($e, {}), "aria-label": "صفحه بعدی" } ), /* @__PURE__ */ b( _e, { ref: d, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "100px", value: i, onFocus: () => { a(!0), c(null), o(""); }, onChange: (f) => { const y = f.target.value, h = U(y).replace(/\D/g, ""); o(R(h)); }, onBlur: () => { i || (o(R(e)), a(!1), c(null)); }, onKeyDown: (f) => { f.key === "Enter" && S(); }, textAlign: "center", color: "#1D2939", px: 1, minW: 0, dir: "ltr" } ) ] }), /* @__PURE__ */ K(W, { spacing: 2, whiteSpace: "nowrap", children: [ /* @__PURE__ */ b(L, { fontWeight: "bold", children: "تعداد کل:" }), /* @__PURE__ */ b(L, { children: R(t) }) ] }) ] } ); }, Nn = ({ currentPage: e, totalPages: r, totalCount: t, onPageChange: n }) => { const [i, o] = F(""), [s, a] = F(!1), [u, c] = F(null), d = te(null), m = u ?? e, S = q( (w) => { const x = Math.min(Math.max(w, 1), r); a(!1), o(""), c(null), x !== e && n(x); }, [e, r, n] ), f = q(() => { if (!i) { a(!1), o(""), c(null); return; } const w = parseInt(U(i), 10); if (isNaN(w)) { a(!1), o(""), c(null); return; } const x = Math.min(Math.max(w, 1), r); a(!1), o(""), x !== e ? (c(x), n(x)) : c(null); }, [i, e, r, n]); D(() => { var w; s && ((w = d.current) == null || w.focus()); }, [s]), D(() => { u !== null && e === u && c(null); }, [e, u]), D(() => { if (!s || !i) return; const w = setTimeout(() => { f(); }, 1e3); return () => clearTimeout(w); }, [i, s, f]); const y = () => { c(null), o(""), a(!0); }, h = (w, x = !1) => /* @__PURE__ */ b( Te, { size: "md", bg: x ? "#4B49AC" : "#e6e6f1", color: x ? "#e6e6f1" : "#4B49AC", _hover: { bg: x ? "#4B49AC" : "#cbcbe8" }, onClick: x ? y : () => S(w), variant: "soft", children: R(w) }, w ); if (r === 0 || !t) return null; const v = r > 1 && m !== 1, _ = r > 1 && m !== r; return /* @__PURE__ */ b( W, { justifyContent: "center", backgroundColor: "white", py: "10px", px: "16px", rounded: "lg", border: "1px", borderColor: "blue.200", w: "100%", children: /* @__PURE__ */ K(W, { spacing: 2, alignItems: "center", justifyContent: "center", children: [ /* @__PURE__ */ b( H, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => S(m - 1), isDisabled: m === 1, icon: /* @__PURE__ */ b(Re, {}), "aria-label": "صفحه قبلی" } ), v && h(1), s ? /* @__PURE__ */ b( _e, { ref: d, type: "text", inputMode: "numeric", placeholder: "صفحه", w: "48px", value: i, onChange: (w) => { const x = w.target.value, k = U(x).replace(/\D/g, ""); o(R(k)); }, onBlur: () => { i ? f() : (o(""), a(!1), c(null)); }, onKeyDown: (w) => { w.key === "Enter" && f(), w.key === "Escape" && (o(""), a(!1), c(null)); }, textAlign: "center", color: "#1D2939", px: 1, minW: 0, dir: "ltr" } ) : h(m, !0), _ && h(r), /* @__PURE__ */ b( H, { size: "md", bg: "#e6e6f1", color: "#4B49AC", _hover: { bg: "#cbcbe8" }, onClick: () => S(m + 1), isDisabled: m === r, icon: /* @__PURE__ */ b($e, {}), "aria-label": "صفحه بعدی" } ) ] }) } ); }; let we = null, C = null, ve = null, Se = !1; const et = He(null), rt = ({ url: e, realm: r, clientId: t }) => (C || (C = new Hr({ url: e, realm: r, clientId: t })), C), tt = (e) => (we = e, we), nt = () => Se, Ze = () => !!(C != null && C.authenticated), se = () => (C == null ? void 0 : C.token) ?? null, De = async (e = 30) => C ? C.updateToken(e) : !1, er = (e) => C == null ? void 0 : C.logout(e), On = (e) => C == null ? void 0 : C.login(e), rr = ({ config: e, initOptions: r = {} } = {}) => { const t = e ?? we; if (!(t != null && t.url) || !(t != null && t.realm) || !(t != null && t.clientId)) throw new Error("Keycloak config is required."); tt(t); const n = rt(t); return ve || (ve = n.init({ onLoad: "login-required", checkLoginIframe: !1, flow: "implicit", ...r }).then((i) => (Se = !0, i)).catch((i) => { throw Se = !0, i; })), ve; }, it = ({ children: e, config: r, initOptions: t, loading: n = null }) => { const [i, o] = F(!1), [s, a] = F(!1), [u, c] = F(null), d = te(!1), m = q(() => { C && (a(!!C.authenticated), c(C.token ?? null)); }, []); D(() => (d.current = !0, rr({ config: r, initOptions: t }).then((v) => { d.current && (a(!!v), c((C == null ? void 0 : C.token) ?? null), o(!0)); }).catch(() => { d.current && (a(!1), c(null), o(!0)); }), () => { d.current = !1; }), [r, t]); const S = q(() => C == null ? void 0 : C.login(), []), f = q((v) => C == null ? void 0 : C.logout(v), []), y = q( async (v = 30) => { if (!C) return !1; const _ = await C.updateToken(v); return m(), _; }, [m] ), h = fe( () => ({ initialized: i, authenticated: s, token: u, login: S, logout: f, updateToken: y }), [i, s, u, S, f, y] ); return i ? /* @__PURE__ */ b(et.Provider, { value: h, children: e }) : n; }, tr = He(null), he = "permissions", ot = (e) => (e == null ? void 0 : e.storageKey) || he, st = ({ user: e = null, children: r, config: t, loading: n = /* @__PURE__ */ b("div", { children: "Loading permissions..." }), errorFallback: i = /* @__PURE__ */ b("div", { children: "Error loading permissions" }) }) => { const o = ot(t), [s, a] = F( () => at(o) ), { data: u, isLoading: c, error: d } = dt(t), m = u ?? s; D(() => { u && (ct(o, u), a(u)); }, [u, o]); const S = fe( () => ut(m), [m] ), f = q( (v = "") => ft(S, v), [S] ), y = q((v = "") => !f(v), [f]), h = fe( () => ({ user: e, can: f, cannot: y, permissions: m, isLoading: c, error: d }), [e, f, y, m, c, d] ); return d && !m ? i : c && !m ? n : /* @__PURE__ */ b(tr.Provider, { value: h, children: r }); }, at = (e = he) => { if (!(typeof window > "u")) try { const r = localStorage.getItem(e); return r ? JSON.parse(r) : void 0; } catch { return; } }, ct = (e = he, r) => { if (!(typeof window > "u")) try { localStorage.setItem(e, JSON.stringify(r)); } catch { } }, Fn = (e = he) => { if (!(typeof window > "u")) try { localStorage.removeItem(e); } catch { } }, ut = (e) => e ? new Set(e.map((r) => r.name)) : /* @__PURE__ */ new Set(), ft = (e, r = "") => { if (!r) return !1; if (e.has(r) || [...e].some((n) => n.startsWith(r))) return !0; let t = r; for (; t.includes(":"); ) if (t = t.slice(0, t.lastIndexOf(":")), e.has(`${t}:*`)) return !0; return !1; }, nr = { all: ["permissions"], list: (e) => [...nr.all, e] }, lt = async (e) => { if (!(e != null && e.url) || !(e != null && e.clientId)) throw new Error("Permission config requires url and clientId."); const r = se(), t = new URL(e.url); t.searchParams.set("client_id", e.clientId); const n = await fetch(t.toString(), { method: "GET", headers: { ...r ? { Authorization: `Bearer ${r}` } : {} } }); if (!n.ok) throw new Error("Failed to load permissions"); return n.json(); }, ke = () => { const e = Je(tr); if (!e) throw new Error("usePermission must be used within PermissionProvider"); return e; }, dt = (e) => Jr({ queryKey: nr.list(e == null ? void 0 : e.clientId), queryFn: () => lt(e), enabled: !!(e != null && e.url) && !!(e != null && e.clientId) && Ze(), staleTime: 1 / 0, refetchOnWindowFocus: !1, refetchOnReconnect: !1 }), Bn = ({ perm: e, children: r, fallback: t = /* @__PURE__ */ b("div", { children: "You are not allowed to do this" }) }) => { const { can: n } = ke(); return n(e) ? r : t; }, Pn = ({ children: e }) => { const { can: r, permissions: t } = ke(); return t && r("admin") ? e : null; }, Dn = ({ children: e }) => { const { can: r, isLoading: t } = ke(); return D(() => { t || r("panel_access") || er(); }, [t, r]), e; }; let le = null; const ht = (e) => { const { api: r } = e, t = Zr.create({ baseURL: r.baseUrl }), n = async () => { (!nt() || !Ze()) && await rr(); }, i = async (s) => { await n(); let a = se(); if (a) { try { await De(5), a = se(); } catch { } s.headers = { ...s.headers, Authorization: `Bearer ${a}` }; } return s; }, o = async (s) => { var u; const a = s.config; if (((u = s == null ? void 0 : s.response) == null ? void 0 : u.status) === 401 && !(a != null && a._retry)) { a._retry = !0; try { await De(30); const c = se(); return a.headers = { ...a.headers, Authorization: `Bearer ${c}` }, t(a); } catch { er({ redirectUri: window.location.origin }); } } return Promise.reject(s); }; return t.interceptors.request.use(i), t.interceptors.response.use( (s) => s, o ), { api: t }; }, pt = (e) => (le = ht(e), le), mt = () => { if (!le) throw new Error("api is not configured. Call configureApi(config) first."); return le.api; }, zn = new Proxy( {}, { get(e, r) { return mt()[r]; } } ); function yt() { const [e, r] = F(!1), t = te(null); return D(() => { if (process.env.NODE_ENV !== "production") return; let n; const i = async () => { const s = await fetch(`/version.json?t=${Date.now()}`, { cache: "no-store" }); if (!s.ok) throw new Error(`Failed to fetch version: ${s.status}`); const a = await s.json(); return String(a.version); }; return (async () => { try { t.current = await i(), n = setInterval(async () => { try { const s = await i(); t.current && s !== t.current && (r(!0), clearInterval(n)); } catch (s) { console.error("Update check failed:", s); } }, 3e4); } catch (s) { console.error("Initial version fetch failed:", s); } })(), () => { n && clearInterval(n); }; }, []), e ? /* @__PURE__ */ b( "div", { style: { position: "fixed", bottom: "16px", right: "16px", background: "#111", color: "#fff", padding: "12px 16px", borderRadius: "8px", zIndex: 9999, cursor: "pointer" }, onClick: () => window.location.reload(), children: "نسخه جدید سامانه در دسترس است" } ) : null; } const bt = new Xr({ defaultOptions: { queries: { retry: 1, refetchOnWindowFocus: !1 } } }); function vt(e) { if (e.sheet) return e.sheet; for (var r = 0; r < document.styleSheets.length; r++) if (document.styleSheets[r].ownerNode === e) return document.styleSheets[r]; } function xt(e) { var r = document.createElement("style"); return r.setAttribute("data-emotion", e.key), e.nonce !== void 0 && r.setAttribute("nonce", e.nonce), r.appendChild(document.createTextNode("")), r.setAttribute("data-s", ""), r; } var wt = /* @__PURE__ */ function() { function e(t) { var n = this; this._insertTag = function(i) { var o; n.tags.length === 0 ? n.insertionPoint ? o = n.insertionPoint.nextSibling : n.prepend ? o = n.container.firstChild : o = n.before : o = n.tags[n.tags.length - 1].nextSibling, n.container.insertBefore(i, o), n.tags.push(i); }, this.isSpeedy = t.speedy === void 0 ? !0 : t.speedy, this.tags = [], this.ctr = 0, this.nonce = t.nonce, this.key = t.key, this.container = t.container, this.prepend = t.prepend, this.insertionPoint = t.insertionPoint, this.before = null; } var r = e.prototype; return r.hydrate = function(n) { n.forEach(this._insertTag); }, r.insert = function(n) { this.ctr % (this.isSpeedy ? 65e3 : 1) === 0 && this._insertTag(xt(this)); var i = this.tags[this.tags.length - 1]; if (this.isSpeedy) { var o = vt(i); try { o.insertRule(n, o.cssRules.length); } catch { } } else i.appendChild(document.createTextNode(n)); this.ctr++; }, r.flush = function() { this.tags.forEach(function(n) { var i; return (i = n.parentNode) == null ? void 0 : i.removeChild(n); }), this.tags = [], this.ctr = 0; }, e; }(), O = "-ms-", de = "-moz-", g = "-webkit-", ir = "comm", Ie = "rule", Me = "decl", St = "@import", or = "@keyframes", gt = "@layer", Et = Math.abs, pe = String.fromCharCode, Ct = Object.assign; function At(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; } function sr(e) { return e.trim(); } function Tt(e, r) { return (e = r.exec(e)) ? e[0] : e; } function E(e, r, t) { return e.replace(r, t); } function ge(e, r) { return e.indexOf(r); } function M(e, r) { return e.charCodeAt(r) | 0; } function Z(e, r, t) { return e.slice(r, t); } function Y(e) { return e.length; } function Ne(e) { return e.length; } function oe(e, r) { return r.push(e), e; } function _t(e, r) { return e.map(r).join(""); } var me = 1, J = 1, ar = 0, P = 0, I = 0, X = ""; function ye(e, r, t, n, i, o, s) { return { value: e, root: r, parent: t, type: n, props: i, children: o, line: me, column: J, length: s, return: "" }; } function Q(e, r) { return Ct(ye("", null, null, "", null, null, 0), e, { length: -e.length }, r); } function Rt() { return I; } function $t() { return I = P > 0 ? M(X, --P) : 0, J--, I === 10 && (J = 1, me--), I; } function z() { return I = P < ar ? M(X, P++) : 0, J++, I === 10 && (J = 1, me++), I; } function j() { return M(X, P); } function ae() { return P; } function ne(e, r) { return Z(X, e, r); } function ee(e) { switch (e) { case 0: case 9: case 10: case 13: case 32: return 5; case 33: case 43: case 44: case 47: case 62: case 64: case 126: case 59: case 123: case 125: return 4; case 58: return 3; case 34: case 39: case 40: case 91: return 2; case 41: case 93: return 1; } return 0; } function cr(e) { return me = J = 1, ar = Y(X = e), P = 0, []; } function ur(e) { return X = "", e; } function ce(e) { return sr(ne(P - 1, Ee(e === 91 ? e + 2 : e === 40 ? e + 1 : e))); } function kt(e) { for (; (I = j()) && I < 33; ) z(); return ee(e) > 2 || ee(I) > 3 ? "" : " "; } function It(e, r) { for (; --r && z() && !(I < 48 || I > 102 || I > 57 && I < 65 || I > 70 && I < 97); ) ; return ne(e, ae() + (r < 6 && j() == 32 && z() == 32)); } function Ee(e) { for (; z(); ) switch (I) { case e: return P; case 34: case 39: e !== 34 && e !== 39 && Ee(I); break; case 40: e === 41 && Ee(e); break; case 92: z(); break; } return P; } function Mt(e, r) { for (; z() && e + I !== 57; ) if (e + I === 84 && j() === 47) break; return "/*" + ne(r, P - 1) + "*" + pe(e === 47 ? e : z()); } function Nt(e) { for (; !ee(j()); ) z(); return ne(e, P); } function Ot(e) { return ur(ue("", null, null, null, [""], e = cr(e), 0, [0], e)); } function ue(e, r, t, n, i, o, s, a, u) { for (var c = 0, d = 0, m = s, S = 0, f = 0, y = 0, h = 1, v = 1, _ = 1, w = 0, x = "", k = i, l = o, N = n, $ = x; v; ) switch (y = w, w = z()) { case 40: if (y != 108 && M($, m - 1) == 58) { ge($ += E(ce(w), "&", "&\f"), "&\f") != -1 && (_ = -1); break; } case 34: case 39: case 91: $ += ce(w); break; case 9: case 10: case 13: case 32: $ += kt(y); break; case 92: $ += It(ae() - 1, 7); continue; case 47: switch (j()) { case 42: case 47: oe(Ft(Mt(z(), ae()), r, t), u); break; default: $ += "/"; } break; case 123 * h: a[c++] = Y($) * _; case 125 * h: case 59: case 0: switch (w) { case 0: case 125: v = 0; case 59 + d: _ == -1 && ($ = E($, /\f/g, "")), f > 0 && Y($) - m && oe(f > 32 ? Le($ + ";", n, t, m - 1) : Le(E($, " ", "") + ";", n, t, m - 2), u); break; case 59: $ += ";"; default: if (oe(N = ze($, r, t, c, d, i, a, x, k = [], l = [], m), o), w === 123) if (d === 0) ue($, r, N, N, k, o, m, a, l); else switch (S === 99 && M($, 3) === 110 ? 100 : S) { case 100: case 108: case 109: case 115: ue(e, N, N, n && oe(ze(e, N, N, 0, 0, i, a, x, i, k = [], m), l), i, l, m, a, n ? k : l); break; default: ue($, N, N, N, [""], l, 0, a, l); } } c = d = f = 0, h = _ = 1, x = $ = "", m = s; break; case 58: m = 1 + Y($), f = y; default: if (h < 1) { if (w == 123) --h; else if (w == 125 && h++ == 0 && $t() == 125) continue; } switch ($ += pe(w), w * h) { case 38: _ = d > 0 ? 1 : ($ += "\f", -1); break; case 44: a[c++] = (Y($) - 1) * _, _ = 1; break; case 64: j() === 45 && ($ += ce(z())), S = j(), d = m = Y(x = $ += Nt(ae())), w++; break; case 45: y === 45 && Y($) == 2 && (h = 0); } } return o; } function ze(e, r, t, n, i, o, s, a, u, c, d) { for (var m = i - 1, S = i === 0 ? o : [""], f = Ne(S), y = 0, h = 0, v = 0; y < n; ++y) for (var _ = 0, w = Z(e, m + 1, m = Et(h = s[y])), x = e; _ < f; ++_) (x = sr(h > 0 ? S[_] + " " + w : E(w, /&\f/g, S[_]))) && (u[v++] = x); return ye(e, r, t, i === 0 ? Ie : a, u, c, d); } function Ft(e, r, t) { return ye(e, r, t, ir, pe(Rt()), Z(e, 2, -2), 0); } function Le(e, r, t, n) { return ye(e, r, t, Me, Z(e, 0, n), Z(e, n + 1, -1), n); } function G(e, r) { for (var t = "", n = Ne(e), i = 0; i < n; i++) t += r(e[i], i, e, r) || ""; return t; } function Bt(e, r, t, n) { switch (e.type) { case gt: if (e.children.length) break; case St: case Me: return e.return = e.return || e.value; case ir: return ""; case or: return e.return = e.value + "{" + G(e.children, n) + "}"; case Ie: e.value = e.props.join(","); } return Y(t = G(e.children, n)) ? e.return = e.value + "{" + t + "}" : ""; } function Pt(e) { var r = Ne(e); return function(t, n, i, o) { for (var s = "", a = 0; a < r; a++) s += e[a](t, n, i, o) || ""; return s; }; } function Dt(e) { return function(r) { r.root || (r = r.return) && e(r); }; } function zt(e) { var r = /* @__PURE__ */ Object.create(null); return function(t) { return r[t] === void 0 && (r[t] = e(t)), r[t]; }; } var Lt = function(r, t, n) { for (var i = 0, o = 0; i = o, o = j(), i === 38 && o === 12 && (t[n] = 1), !ee(o); ) z(); return ne(r, P); }, Kt = function(r, t) { var n = -1, i = 44; do switch (ee(i)) { case 0: i === 38 && j() === 12 && (t[n] = 1), r[n] += Lt(P - 1, t, n); break; case 2: r[n] += ce(i); break; case 4: if (i === 44) { r[++n] = j() === 58 ? "&\f" : "", t[n] = r[n].length; break; } default: r[n] += pe(i); } while (i = z()); return r; }, Wt = function(r, t) { return ur(Kt(cr(r), t)); }, Ke = /* @__PURE__ */ new WeakMap(), Yt = function(r) { if (!(r.type !== "rule" || !r.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed r.length < 1)) { for (var t = r.value, n = r.parent, i = r.column === n.column && r.line === n.line; n.type !== "rule"; ) if (n = n.parent, !n) return; if (!(r.props.length === 1 && t.charCodeAt(0) !== 58 && !Ke.get(n)) && !i) { Ke.set(r, !0); for (var o = [], s = Wt(t, o), a = n.props, u = 0, c = 0; u < s.length; u++) for (var d = 0; d < a.length; d++, c++) r.props[c] = o[u] ? s[u].replace(/&\f/g, a[d]) : a[d] + " " + s[u]; } } }, Vt = function(r) { if (r.type === "decl") { var t = r.value; // charcode for l t.charCodeAt(0) === 108 && // charcode for b t.charCodeAt(2) === 98 && (r.return = "", r.value = ""); } }; function fr(e, r) { switch (At(e, r)) { case 5103: return g + "print-" + e + e; case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return g + e + e; case 5349: case 4246: case 4810: case 6968: case 2756: return g + e + de + e + O + e + e; case 6828: case 4268: return g + e + O + e + e; case 6165: return g + e + O + "flex-" + e + e; case 5187: return g + e + E(e, /(\w+).+(:[^]+)/, g + "box-$1$2" + O + "flex-$1$2") + e; case 5443: return g + e + O + "flex-item-" + E(e, /flex-|-self/, "") + e; case 4675: return g + e + O + "flex-line-pack" + E(e, /align-content|flex-|-self/, "") + e; case 5548: return g + e + O + E(e, "shrink", "negative") + e; case 5292: return g + e + O + E(e, "basis", "preferred-size") + e; case 6060: return g + "box-" + E(e, "-grow", "") + g + e + O + E(e, "grow", "positive") + e; case 4554: return g + E(e, /([^-])(transform)/g, "$1" + g + "$2") + e; case 6187: return E(E(E(e, /(zoom-|grab)/, g + "$1"), /(image-set)/, g + "$1"), e, "") + e; case 5495: case 3959: return E(e, /(image-set\([^]*)/, g + "$1$`$1"); case 4968: return E(E(e, /(.+:)(flex-)?(.*)/, g + "box-pack:$3" + O + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + g + e + e; case 4095: case 3583: case 4068: case 2532: return E(e, /(.+)-inline(.+)/, g + "$1$2") + e; case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: if (Y(e) - 1 - r > 6) switch (M(e, r + 1)) { case 109: if (M(e, r + 4) !== 45) break; case 102: return E(e, /(.+:)(.+)-([^]+)/, "$1" + g + "$2-$3$1" + de + (M(e, r + 3) == 108 ? "$3" : "$2-$3")) + e; case 115: return ~ge(e, "stretch") ? fr(E(e, "stretch", "fill-available"), r) + e : e; } break; case 4949: if (M(e, r + 1) !== 115) break; case 6444: switch (M(e, Y(e) - 3 - (~ge(e, "!important") && 10))) { case 107: return E(e, ":", ":" + g) + e; case 101: return E(e, /(.+:)([^;!]+)(;|!.+)?/, "$1" + g + (M(e, 14) === 45 ? "inline-" : "") + "box$3$1" + g + "$2$3$1" + O + "$2box$3") + e; } break; case 5936: switch (M(e, r + 11)) { case 114: return g + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb") + e; case 108: return g + e + O + E(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e; case 45: return g + e + O + E(e, /[svh]\w+-[tblr]{2}/, "lr") + e; } return g + e + O + e + e; } return e; } var jt = function(r, t, n, i) { if (r.length > -1 && !r.return) switch (r.type) { case Me: r.return = fr(r.value, r.length); break; case or: return G([Q(r, { value: E(r.value, "@", "@" + g) })], i); case Ie: if (r.length) return _t(r.props, function(o) { switch (Tt(o, /(::plac\w+|:read-\w+)/)) { case ":read-only": case ":read-write": return G([Q(r, { props: [E(o, /:(read-\w+)/, ":" + de + "$1")] })], i); case "::placeholder": return G([Q(r, { props: [E(o, /:(plac\w+)/, ":" + g + "input-$1")] }), Q(r, { props: [E(o, /:(plac\w+)/, ":" + de + "$1")] }), Q(r, { props: [E(o, /:(plac\w+)/, O + "input-$1")] })], i); } return ""; }); } }, qt = [jt], Ut = function(r) { var t = r.key; if (t === "css") { var n = document.querySelectorAll("style[data-emotion]:not([data-s])"); Array.prototype.forEach.call(n, function(h) { var v = h.getAttribute("data-emotion"); v.indexOf(" ") !== -1 && (document.head.appendChild(h), h.setAttribute("data-s", "")); }); } var i = r.stylisPlugins || qt, o = {}, s, a = []; s = r.container || document.head, Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // 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 v = h.getAttribute("data-emotion").split(" "), _ = 1; _ < v.length; _++) o[v[_]] = !0; a.push(h); } ); var u, c = [Yt, Vt]; { var d, m = [Bt, Dt(function(h) { d.insert(h); })], S = Pt(c.concat(i, m)), f = function(v) { return G(Ot(v), S); }; u = function(v, _, w, x) { d = w, f(v ? v + "{" + _.styles + "}" : _.styles), x && (y.inserted[_.name] = !0); }; } var y = { key: t, sheet: new wt({ key: t, container: s, nonce: r.nonce, speedy: r.speedy, prepend: r.prepend, insertionPoint: r.insertionPoint }), nonce: r.nonce, inserted: o, registered: {}, insert: u }; return y.sheet.hydrate(a), y; }, Ce = { exports: {} }, A = {}; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var We; function Gt() { if (We) return A; We = 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, 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, v = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; function x(l) { if (typeof l == "object" && l !== null) { var N = l.$$typeof; switch (N) { case r: switch (l = l.type, l) { case u: case c: case n: case o: case i: case m: return l; default: switch (l = l && l.$$typeof, l) { case a: case d: case y: case f: case s: return l; default: return N; } } case t: return N; } } } function k(l) { return x(l) === c; } 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) || x(l) === u; }, A.isConcurrentMode = k, A.isContextConsumer = function(l) { return x(l) === a; }, A.isContextProvider = function(l) { return x(l) === s; }, A.isElement = function(l) { return typeof l == "object" && l !== null && l.$$typeof === r; }, A.isForwardRef = function(l) { return x(l) === d; }, A.isFragment = function(l) { return x(l) === n; }, A.isLazy = function(l) { return x(l) === y; }, A.isMemo = function(l) { return x(l) === f; }, A.isPortal = function(l) { return x(l) === t; }, A.isProfiler = function(l) { return x(l) === o; }, A.isStrictMode = function(l) { return x(l) === i; }, A.isSuspense = function(l) { return x(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 === v || l.$$typeof === _ || l.$$typeof === w || l.$$typeof === h); }, A.typeOf = x, A; } var T = {}; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var Ye; function Ht() { return Ye || (Ye = 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, 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, v = e ? Symbol.for("react.fundamental") : 60117, _ = e ? Symbol.for("react.responder") : 60118, w = e ? Symbol.for("react.scope") : 60119; function x(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 === 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 === v || p.$$typeof === _ || p.$$typeof === w || p.$$typeof === h); } function k(p) { if (typeof p == "object" && p !== null) { var be = p.$$typeof; switch (be) { case r: var ie = p.type; switch (ie) { case u: case c: case n: case o: case i: case m: return ie; default: var Pe = ie && ie.$$typeof; switch (Pe) { case a: case d: case y: case f: case s: return Pe; default: return be; } } case t: return be; } } } var l = u, N = c, $ = a, Sr = s, gr = r, Er = d, Cr = n, Ar = y, Tr = f, _r = t, Rr = o, $r = i, kr = m, Fe = !1; function Ir(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.")), Be(p) || k(p) === u; } function Be(p) { return k(p) === c; } function Mr(p) { return k(p) === a; } function Nr(p) { return k(p) === s; } function Or(p) { return typeof p == "object" && p !== null && p.$$typeof === r; } function Fr(p) { return k(p) === d; } function Br(p) { return k(p) === n; } function Pr(p) { return k(p) === y; } function Dr(p) { return k(p) === f; } function zr(p) { return k(p) === t; } function Lr(p) { return k(p) === o; } function Kr(p) { return k(p) === i; } function Wr(p) { return k(p) === m; } T.AsyncMode = l, T.ConcurrentMode = N, T.ContextConsumer = $, T.ContextProvider = Sr, T.Element = gr, T.ForwardRef = Er, T.Fragment = Cr, T.Lazy = Ar, T.Memo = Tr, T.Portal = _r, T.Profiler = Rr, T.StrictMode = $r, T.Suspense = kr, T.isAsyncMode = Ir, T.isConcurrentMode = Be, T.isContextConsumer = Mr, T.isContextProvider = Nr, T.isElement = Or, T.isForwardRef = Fr, T.isFragment = Br, T.isLazy = Pr, T.isMemo = Dr, T.isPortal = zr, T.isProfiler = Lr, T.isStrictMode = Kr, T.isSuspense = Wr, T.isValidElementType = x, T.typeOf = k; }()), T; } process.env.NODE_ENV === "production" ? Ce.exports = Gt() : Ce.exports = Ht(); var Jt = Ce.exports, lr = Jt, Xt = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, Qt = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, dr = {}; dr[lr.ForwardRef] = Xt; dr[lr.Memo] = Qt; var Zt = !0; function en(e, r, t) { var n = ""; return t.split(" ").forEach(function(i) { e[i] !== void 0 ? r.push(e[i] + ";") : i && (n += i + " "); }), n; } var hr = function(r, t, n) { var i = r.key + "-" + t.name; // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (n === !1 || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser Zt === !1) && r.registered[i] === void 0 && (r.registered[i] = t.styles); }, pr = function(r, t, n) { hr(r, t, n); var i = r.key + "-" + t.name; if (r.inserted[t.name] === void 0) { var o = t; do r.insert(t === o ? "." + i : "", o, r.sheet, !0), o = o.next; while (o !== void 0); } }; function rn(e) { for (var r = 0, t, n = 0, i = e.length; i >= 4; ++n, i -= 4) t = e.charCodeAt(n) & 255 | (e.charCodeAt(++n) & 255) << 8 | (e.charCodeAt(++n) & 255) << 16 | (e.charCodeAt(++n) & 255) << 24, t = /* Math.imul(k, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16), t ^= /* k >>> r: */ t >>> 24, r = /* Math.imul(k, m): */ (t & 65535) * 1540483477 + ((t >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); switch (i) { case 3: r ^= (e.charCodeAt(n + 2) & 255) << 16; case 2: r ^= (e.charCodeAt(n + 1) & 255) << 8; case 1: r ^= e.charCodeAt(n) & 255, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16); } return r ^= r >>> 13, r = /* Math.imul(h, m): */ (r & 65535) * 1540483477 + ((r >>> 16) * 59797 << 16), ((r ^ r >>> 15) >>> 0).toString(36); } var tn = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, scale: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }, nn = /[A-Z]|^ms/g, on = /_EMO_([^_]+?)_([^]*?)_EMO_/g, mr = function(r) { return r.charCodeAt(1) === 45; }, Ve = function(r) { return r != null && typeof r != "boolean"; }, xe = /* @__PURE__ */ zt(function(e) { return mr(e) ? e : e.replace(nn, "-$&").toLowerCase(); }), je = function(r, t) { switch (r) { case "animation": case "animationName": if (typeof t == "string") return t.replace(on, function(n, i, o) { return V = { name: i, styles: o, next: V }, i; }); } return tn[r] !== 1 && !mr(r) && typeof t == "number" && t !== 0 ? t + "px" : t; }; function re(e, r, t) { if (t == null) return ""; var n = t; if (n.__emotion_styles !== void 0) return n; switch (typeof t) { case "boolean": return ""; case "object": { var i = t; if (i.anim === 1) return V = { name: i.name, styles: i.styles, next: V }, i.name; var o = t; if (o.styles !== void 0) { var s = o.next; if (s !== void 0) for (; s !== void 0; ) V = { name: s.name, styles: s.styles, next: V }, s = s.next; var a = o.styles + ";"; return a; } return sn(e, r, t); } case "function": { if (e !== void 0) { var u = V, c = t(e); return V = u, re(e, r, c); } break; } } var d = t; return d; } function sn(e, r, t) { var n = ""; if (Array.isArray(t)) for (var i = 0; i < t.length; i++) n += re(e, r, t[i]) + ";"; else for (var o in t) { var s = t[o]; if (typeof s != "object") { var a = s; Ve(a) && (n += xe(o) + ":" + je(o, a) + ";"); } else if (Array.isArray(s) && typeof s[0] == "string" && r == null) for (var u = 0; u < s.length; u++) Ve(s[u]) && (n += xe(o) + ":" + je(o, s[u]) + ";"); else { var c = re(e, r, s); switch (o) { case "animation": case "animationName": { n += xe(o) + ":" + c + ";"; break; } default: n += o + "{" + c + "}"; } } } return n; } var qe = /label:\s*([^\s;{]+)\s*(;|$)/g, V; function yr(e, r, t) { if (e.length === 1 && typeof e[0] == "object" && e[0] !== null && e[0].styles !== void 0) return e[0]; var n = !0, i = ""; V = void 0; var o = e[0]; if (o == null || o.raw === void 0) n = !1, i += re(t, r, o); else { var s = o; i += s[0]; } for (var a = 1; a < e.length; a++) if (i += re(t, r, e[a]), n) { var u = o; i += u[a]; } qe.lastIndex = 0; for (var c = "", d; (d = qe.exec(i)) !== null; ) c += "-" + d[1]; var m = rn(i) + c; return { name: m, styles: i, next: V }; } var an = function(r) { return r(); }, br = B.useInsertionEffect ? B.useInsertionEffect : !1, cn = br || an, Ue = br || B.useLayoutEffect, vr = /* @__PURE__ */ B.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 // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement < "u" ? /* @__PURE__ */ Ut({ key: "css" }) : null ); vr.Provider; var xr = function(r) { return /* @__PURE__ */ Yr(function(t, n) { var i = Je(vr); return r(t, i, n); }); }, wr = /* @__PURE__ */ B.createContext({}), Oe = {}.hasOwnProperty, Ae = "__EMOTION_TYPE_PLEASE_DO_NOT_USE__", un = function(r, t) { var n = {}; for (var i in t) Oe.call(t, i) && (n[i] = t[i]); return n[Ae] = r, n; }, fn = function(r) { var t = r.cache, n = r.serialized, i = r.isStringTag; return hr(t, n, i), cn(function() { return pr(t, n, i); }), null; }, ln = /* @__PURE__ */ xr(function(e, r, t) { var n = e.css; typeof n == "string" && r.registered[n] !== void 0 && (n = r.registered[n]); var i = e[Ae], o = [n], s = ""; typeof e.className == "string" ? s = en(r.registered, o, e.className) : e.className != null && (s = e.className + " "); var a = yr(o, void 0, B.useContext(wr)); 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__ */ B.createElement(B.Fragment, null, /* @__PURE__ */ B.createElement(fn, { cache: r, serialized: a, isStringTag: typeof i == "string" }), /* @__PURE__ */ B.createElement(i, u)); }), dn = ln, Ge = function(r, t) { var n = arguments; if (t == null || !Oe.call(t, "css")) return B.createElement.apply(void 0, n); var i = n.length, o = new Array(i); o[0] = dn, o[1] = un(r, t); for (var s = 2; s < i; s++) o[s] = n[s]; return B.createElement.apply(null, o); }; (function(e) { var r; r || (r = e.JSX || (e.JSX = {})); })(Ge || (Ge = {})); var hn = /* @__PURE__ */ xr(function(e, r) { var t = e.styles, n = yr([t], void 0, B.useContext(wr)), i = B.useRef(); return Ue(function() { var o = r.key + "-global", s = new r.sheet.constructor({ key: o, nonce: r.sheet.nonce, container: r.sheet.container, speedy: r.sheet.isSpeedy }), a = !1, u = document.querySelector('style[data-emotion="' + o + " " + n.name + '"]'); return r.sheet.tags.length && (s.before = r.sheet.tags[0]), u !== null && (a = !0, u.setAttribute("data-emotion", o), s.hydrate([u])), i.current = [s, a], function() { s.flush(); }; }, [r]), Ue(function() { var o = i.current, s = o[0], a = o[1]; if (a) { o[1] = !1; return; } if (n.next !== void 0 && pr(r, n.next, !0), s.tags.length) { var u = s.tags[s.tags.length - 1].nextElementSibling; s.before = u, s.flush(); } r.insert("", n, s, !1); }, [r, n.name]), null; }); const pn = Vr( { direction: "rtl", styles: { global: { html: { fontSize: "14px" }, body: { bg: "white" } } }, fonts: { heading: "Estedad", body: "Estedad" } }, jr({ colorScheme: "facebook" }) ), mn = () => /* @__PURE__ */ b( hn, { styles: ` @font-face { font-family: Estedad; src: url('/fonts/estedad.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; } ` } ); function Ln({ children: e, apiBaseUrl: r, keycloakClientId: t, permissionClientId: n, loading: i = /* @__PURE__ */ b(Ur, {}), updateChecker: o = !0, updateCheckerProps: s, keycloakUrl: a = "https://auth.ibagher.ir", keycloakRealm: u = "bi", permissionUrl: c = "https://api.d.aiengines.ir/user_api/v1/permissions/list" }) { const [d, m] = F(!1), S = fe( () => ({ api: { baseUrl: r }, keycloak: { url: a, realm: u, clientId: t }, permission: { url: c, clientId: n } }), [ r, t, n, a, u, c ] ); return D(() => { m(!0); }, []), D(() => { d && pt(S); }, [d, S]), d ? /* @__PURE__ */ b(qr, { theme: pn, children: /* @__PURE__ */ K(Qr, { client: bt, children: [ o && /* @__PURE__ */ b(yt, { ...s }), /* @__PURE__ */ b(it, { config: S.keycloak, loading: i, children: /* @__PURE__ */ K(st, { config: S.permission, loading: i, children: [ /* @__PURE__ */ b(mn, {}), e ] }) }) ] }) }) : null; } function yn({ children: e, ...r }) { return /* @__PURE__ */ b( Gr, { as: "header", w: "100%", h: "110px", borderBottom: "1px", borderColor: "gray.200", bg: "blue.400", px: "20px", zIndex: 10, position: "fixed", color: "white", ...r, children: /* @__PURE__ */ b(W, { h: "100%", alignItems: "center", justifyContent: "space-between", children: e }) } ); } function bn({ children: e, ...r }) { return /* @__PURE__ */ b(W, { alignItems: "center", h: "100%", py: "10px", ...r, children: e }); } function vn(e) { return /* @__PURE__ */ b(Qe, { loading: "lazy", alt: "logo", maxW: "80px", maxH: "80px", ...e }); } function xn({ children: e, ...r }) { return /* @__PURE__ */ b( Xe, { alignItems: "start", justifyContent: "center", h: "100%", spacing: 1, ...r, children: e } ); } function wn({ children: e, ...r }) { return /* @__PURE__ */ b(L, { fontWeight: "bold", fontSize: "20px", ...r, children: e }); } function Sn({ children: e, ...r }) { return /* @__PURE__ */ b(L, { ...r, children: e }); } function gn({ logoSrc: e = "/logob.png", ...r }) { return /* @__PURE__ */ K( Xe, { w: "fit-content", alignItems: "center", justifyContent: "center", py: "10px", ...r, children: [ /* @__PURE__ */ b(Qe, { src: e, loading: "lazy" }), /* @__PURE__ */ b(L, { fontSize: "xs", fontWeight: "bold", textAlign: "center", children: "مؤسسه تولید سیستم‌های خبره و هوشمند اسلامی باقرالعلوم(ع)" }) ] } ); } const Kn = Object.assign(yn, { BrandSection: bn, Logo: vn, Brand: xn, Title: wn, Description: Sn, Bi: gn }); export { Pn as AdminGuard, Ln as BiProvider, Bn as Can, Kn as Header, it as KeycloakProvider, In as LightPagination, Mn as Pagination, Dn as PanelAccessGuard, st as PermissionProvider, Nn as SimplePagination, zn as api, ft as checkPermission, Fn as clearCachedPermissions, pt as configureApi, ht as createApi, ut as createPermissionSet, mt as getApi, at as getCachedPermissions, se as getKeycloakToken, lt as getPermissions, rr as initKeycloak, Ze as isKeycloakAuthenticated, nt as isKeycloakInitialized, On as loginKeycloak, er as logoutKeycloak, nr as permissionKeys, ct as setCachedPermissions, U as toEnDigits, R as toFaDigits, kn as toFaNumber, De as updateKeycloakToken, ke as usePermission, dt as usePermissionsQuery };