From 4730057b3f6ebd46b1980b63342b80a21b4facf0 Mon Sep 17 00:00:00 2001 From: Mohamadzadeh <7796733@gmail.com> Date: Mon, 26 Oct 2026 14:49:25 +0330 Subject: [PATCH] uikit-v1.2.5-chakra-default-loading --- LOADING_DEFAULT_1.2.5.md | 7 + PROVIDER_INSTALL.md | 4 + README.md | 14 ++ dist/api.js | 4 +- dist/chakra.js | 61 ++++---- ...XIrDzf.js => provider-runtime-CxEpkUq5.js} | 15 +- dist/keycloak.d.ts | 1 + dist/keycloak.js | 62 ++++---- dist/permission.d.ts | 1 + dist/permission.js | 132 +++++++++--------- ...cI8Bja.js => AppHeaderPreview-DOKJC5wC.js} | 8 +- .../{index-DNhZDl2y.js => index-GAwfVE8_.js} | 2 +- dist/remote/index.html | 2 +- package.json | 2 +- src/chakra/index.jsx | 9 +- src/dev/AppHeaderPreview.jsx | 6 + src/internal/provider-runtime.jsx | 3 + src/keycloak/index.d.ts | 1 + src/keycloak/index.jsx | 10 +- src/permission/index.d.ts | 1 + src/permission/index.jsx | 12 +- 21 files changed, 205 insertions(+), 152 deletions(-) create mode 100644 LOADING_DEFAULT_1.2.5.md rename dist/chunks/{provider-runtime-B6XIrDzf.js => provider-runtime-CxEpkUq5.js} (59%) rename dist/remote/demo-assets/{AppHeaderPreview-BtcI8Bja.js => AppHeaderPreview-DOKJC5wC.js} (97%) rename dist/remote/demo-assets/{index-DNhZDl2y.js => index-GAwfVE8_.js} (99%) diff --git a/LOADING_DEFAULT_1.2.5.md b/LOADING_DEFAULT_1.2.5.md new file mode 100644 index 0000000..1a60b45 --- /dev/null +++ b/LOADING_DEFAULT_1.2.5.md @@ -0,0 +1,7 @@ +# UI Kit v1.2.5: Default loading UI + +- With `` in the same ``, `` and `` use a Chakra `` when `loading` is omitted. +- Explicit `loading` overrides the default, including `loading={null}`. +- Without `` there is no Chakra dependency: Keycloak keeps its previous `null` loader and Permission its previous `Loading permissions...` text. +- React-only `ChakraLoadingContext` shares the optional default across all modules; no behavior changes to API, Query, or authentication. +- Changes to `src/dev/AppHeaderPreview.jsx` are documentation source only; remote demo bundle was not rebuilt without npm dependencies. diff --git a/PROVIDER_INSTALL.md b/PROVIDER_INSTALL.md index 9bc5964..335e427 100644 --- a/PROVIDER_INSTALL.md +++ b/PROVIDER_INSTALL.md @@ -53,3 +53,7 @@ yarn build خروجی‌های قدیمی `core` را دست‌نخورده نگه می‌دارد. مسیرهای `uikit/provider/` هنوز به‌عنوان alias همان خروجی‌های جدید کار می‌کنند. برای راهنمای کامل جدول `MIGRATION_1.2.0.md` را ببینید. + +### Loading پیش‌فرض Keycloak و Permission (v1.2.5) + +با تعریف `` در ``، دو کامپوننت `` و `` هنگام انتظار خودکار `` نشان می‌دهند. پراپ `loading` سفارشی، حتی `loading={null}`، اولویت دارد. بدون ``، مقدار پیش‌فرض قدیمی حفظ می‌شود؛ نیاز به افزودن دستی Spinner در مقصد نیست. diff --git a/README.md b/README.md index 2ab6f12..4eaaa98 100644 --- a/README.md +++ b/README.md @@ -495,6 +495,20 @@ export function SearchFilter() { ### uikit/keycloak +**پیش‌فرض Loading در نسخه 1.2.5:** اگر `` در `BiProvider` وجود داشته باشد، `Keycloak` و `Permission` بدون نیاز به تنظیم `loading` یک `` از Chakra نمایش می‌دهند. اگر مقدار `loading` صریحاً ارسال شود (حتی `null`)، همان مقدار اولویت دارد. بدون ``، رفتار قبلی حفظ می‌شود: `Keycloak` مقدار `null` و `Permission` متن `Loading permissions...` را نمایش می‌دهد. این دو ماژول همچنان مستقل از Chakra هستند. + +```jsx + + + + + + + +// نمونه سفارشی: } /> +// غیرفعال‌کردن نمایش: +``` + **`Keycloak`**: `clientId` الزامی و `url`، `realm`، `initOptions`، `loading`، `errorFallback`، `allowUnauthenticated` و `onError` اختیاری هستند. **`useKeycloak()`** مقدارهای `instance`، `initialized`، `authenticated`، `token`، `error` و متدهای `login(options?)`، `logout(options?)`، `updateToken(minValidity?)` را برمی‌گرداند. پیش‌فرض `onLoad: "login-required"` و `flow: "implicit"` است؛ `updateToken()` نتیجه boolean برمی‌گرداند. ```jsx diff --git a/dist/api.js b/dist/api.js index b25a53e..75e8f2f 100644 --- a/dist/api.js +++ b/dist/api.js @@ -3,8 +3,8 @@ import { jsx as b } from "react/jsx-runtime"; import { useRef as f, useMemo as j } from "react"; import z from "axios"; import { d as B } from "./chunks/feature-registry-B2iuEiEx.js"; -import { u as L, A as P } from "./chunks/provider-runtime-B6XIrDzf.js"; -import { a as U } from "./chunks/provider-runtime-B6XIrDzf.js"; +import { u as L, A as P } from "./chunks/provider-runtime-CxEpkUq5.js"; +import { a as U } from "./chunks/provider-runtime-CxEpkUq5.js"; function _({ children: u, baseUrl: i = "", diff --git a/dist/chakra.js b/dist/chakra.js index 60da139..d99a4a9 100644 --- a/dist/chakra.js +++ b/dist/chakra.js @@ -1,12 +1,13 @@ "use client"; -import { jsxs as c, jsx as f } from "react/jsx-runtime"; -import s, { useEffect as u } from "react"; -import { extendTheme as l, withDefaultColorScheme as m, Text as p, Input as h, IconButton as B, HStack as E, Button as k, Badge as _, ChakraProvider as a } from "@chakra-ui/react"; -import { Global as w } from "@emotion/react"; -import { createRoot as x } from "react-dom/client"; +import { jsx as e, jsxs as f } from "react/jsx-runtime"; +import s, { useEffect as l } from "react"; +import { extendTheme as u, withDefaultColorScheme as m, Text as p, Input as h, IconButton as B, HStack as E, Button as k, Badge as _, ChakraProvider as n, Spinner as w } from "@chakra-ui/react"; +import { Global as x } from "@emotion/react"; +import { createRoot as C } from "react-dom/client"; import { e as I } from "./chunks/estedad-B1AoGIKy.js"; -import { d as b } from "./chunks/feature-registry-B2iuEiEx.js"; -const y = l({ +import { d as S } from "./chunks/feature-registry-B2iuEiEx.js"; +import { C as b } from "./chunks/provider-runtime-CxEpkUq5.js"; +const g = u({ direction: "rtl", styles: { global: { @@ -31,31 +32,31 @@ const y = l({ } } }, m({ colorScheme: "facebook" })); -function S({ children: n, theme: o = y, fonts: i = !0, remoteUiEnabled: e = !0, remoteUiChakraProviderProps: r, ...d }) { - return u(() => { - if (!e || typeof window > "u") return; - const t = window.__UIKIT_REMOTE_DEPS__ || {}; +function y({ children: i, theme: t = g, fonts: d = !0, remoteUiEnabled: r = !0, remoteUiChakraProviderProps: a, ...c }) { + return l(() => { + if (!r || typeof window > "u") return; + const o = window.__UIKIT_REMOTE_DEPS__ || {}; window.__UIKIT_REMOTE_DEPS__ = { - ...t, - React: t.React || s, - createRoot: t.createRoot || x, - ChakraProvider: t.ChakraProvider || a, - Badge: t.Badge || _, - Button: t.Button || k, - HStack: t.HStack || E, - IconButton: t.IconButton || B, - Input: t.Input || h, - Text: t.Text || p, - theme: o, - chakraProviderProps: { ...t.chakraProviderProps, ...r } + ...o, + React: o.React || s, + createRoot: o.createRoot || C, + ChakraProvider: o.ChakraProvider || n, + Badge: o.Badge || _, + Button: o.Button || k, + HStack: o.HStack || E, + IconButton: o.IconButton || B, + Input: o.Input || h, + Text: o.Text || p, + theme: t, + chakraProviderProps: { ...o.chakraProviderProps, ...a } }; - }, [e, o, r]), /* @__PURE__ */ c(a, { theme: o, ...d, children: [ - i && /* @__PURE__ */ f(w, { styles: `@font-face { font-family: Estedad; src: url("${I}") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }` }), - n - ] }); + }, [r, t, a]), /* @__PURE__ */ e(n, { theme: t, ...c, children: /* @__PURE__ */ f(b.Provider, { value: /* @__PURE__ */ e(w, {}), children: [ + d && /* @__PURE__ */ e(x, { styles: `@font-face { font-family: Estedad; src: url("${I}") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }` }), + i + ] }) }); } -const F = b("Chakra", 10, S); +const z = S("Chakra", 10, y); export { - F as Chakra, - y as defaultBiTheme + z as Chakra, + g as defaultBiTheme }; diff --git a/dist/chunks/provider-runtime-B6XIrDzf.js b/dist/chunks/provider-runtime-CxEpkUq5.js similarity index 59% rename from dist/chunks/provider-runtime-B6XIrDzf.js rename to dist/chunks/provider-runtime-CxEpkUq5.js index 6a0c4cd..ac87be5 100644 --- a/dist/chunks/provider-runtime-B6XIrDzf.js +++ b/dist/chunks/provider-runtime-CxEpkUq5.js @@ -1,22 +1,23 @@ -import { createContext as o, useContext as r } from "react"; -const n = o(null), t = o(null); +import { createContext as o, useContext as n } from "react"; +const r = o(null), t = o(null), a = o(void 0); function i() { - return r(n); + return n(r); } function u() { const e = i(); if (!e) throw new Error("useKeycloak requires inside ."); return e; } -function a() { - const e = r(t); +function c() { + const e = n(t); if (!e) throw new Error("useApi requires inside ."); return e; } export { t as A, - n as K, - a, + a as C, + r as K, + c as a, u as b, i as u }; diff --git a/dist/keycloak.d.ts b/dist/keycloak.d.ts index 0d00c9b..258723d 100644 --- a/dist/keycloak.d.ts +++ b/dist/keycloak.d.ts @@ -5,6 +5,7 @@ export interface KeycloakProps { url?: string; realm?: string; initOptions?: Record; + /** Defaults to Chakra Spinner when is present; otherwise null. Explicit null disables it. */ loading?: ReactNode; errorFallback?: ReactNode; allowUnauthenticated?: boolean; diff --git a/dist/keycloak.js b/dist/keycloak.js index ca55d9d..af47d90 100644 --- a/dist/keycloak.js +++ b/dist/keycloak.js @@ -1,65 +1,65 @@ "use client"; -import { jsx as L } from "react/jsx-runtime"; -import { useMemo as K, useRef as b, useState as x, useCallback as s, useEffect as R } from "react"; -import q from "keycloak-js"; -import { d as C } from "./chunks/feature-registry-B2iuEiEx.js"; -import { K as M } from "./chunks/provider-runtime-B6XIrDzf.js"; -import { b as I } from "./chunks/provider-runtime-B6XIrDzf.js"; -import { setKeycloakLogoutHandler as v } from "./core-runtime.js"; -function P({ - children: S, +import { jsx as A } from "react/jsx-runtime"; +import { useContext as b, useMemo as v, useRef as R, useState as q, useCallback as s, useEffect as M } from "react"; +import P from "keycloak-js"; +import { d as T } from "./chunks/feature-registry-B2iuEiEx.js"; +import { C as j, K as B } from "./chunks/provider-runtime-CxEpkUq5.js"; +import { b as U } from "./chunks/provider-runtime-CxEpkUq5.js"; +import { setKeycloakLogoutHandler as L } from "./core-runtime.js"; +function F({ + children: C, clientId: c, url: f = "https://auth.ibagher.ir", realm: d = "bi", initOptions: h, - loading: w = null, - errorFallback: z = null, - allowUnauthenticated: A = !1, + loading: k, + errorFallback: S = null, + allowUnauthenticated: w = !1, onError: i }) { if (!c) throw new Error(" requires clientId."); - const e = K( - () => new q({ url: f, realm: d, clientId: c }), + const x = b(j), z = k !== void 0 ? k : x ?? null, e = v( + () => new P({ url: f, realm: d, clientId: c }), [f, d, c] - ), k = b(/* @__PURE__ */ new WeakMap()), [t, m] = x({ client: e, initialized: !1, authenticated: !1, token: null, error: null }), a = s(() => { - m({ client: e, initialized: !0, authenticated: !!e.authenticated, token: e.token ?? null, error: null }); + ), m = R(/* @__PURE__ */ new WeakMap()), [t, g] = q({ client: e, initialized: !1, authenticated: !1, token: null, error: null }), a = s(() => { + g({ client: e, initialized: !0, authenticated: !!e.authenticated, token: e.token ?? null, error: null }); }, [e]); - R(() => { + M(() => { let n = !0; const o = () => { n && a(); }; - e.onAuthSuccess = o, e.onAuthRefreshSuccess = o, e.onAuthLogout = o, v((r) => e.logout(r)); - let u = k.current.get(e); + e.onAuthSuccess = o, e.onAuthRefreshSuccess = o, e.onAuthLogout = o, L((r) => e.logout(r)); + let u = m.current.get(e); return u || (u = Promise.resolve().then(() => e.init({ onLoad: "login-required", checkLoginIframe: !1, flow: "implicit", // Matches the existing core/BiProvider behavior. ...h - })), k.current.set(e, u)), u.then(o, (r) => { - n && (m({ client: e, initialized: !0, authenticated: !1, token: null, error: r }), i == null || i(r)); + })), m.current.set(e, u)), u.then(o, (r) => { + n && (g({ client: e, initialized: !0, authenticated: !1, token: null, error: r }), i == null || i(r)); }), () => { - n = !1, e.onAuthSuccess = void 0, e.onAuthRefreshSuccess = void 0, e.onAuthLogout = void 0, v(null); + n = !1, e.onAuthSuccess = void 0, e.onAuthRefreshSuccess = void 0, e.onAuthLogout = void 0, L(null); }; }, [e, h, i, a]); - const p = s((n) => e.login(n), [e]), g = s((n) => e.logout(n), [e]), y = s(async (n = 30) => { + const p = s((n) => e.login(n), [e]), y = s((n) => e.logout(n), [e]), K = s(async (n = 30) => { const o = await e.updateToken(n); return a(), o; - }, [e, a]), l = K(() => ({ + }, [e, a]), l = v(() => ({ instance: e, initialized: t.client === e && t.initialized, authenticated: t.client === e && t.authenticated, token: t.client === e ? t.token : null, error: t.client === e ? t.error : null, login: p, - logout: g, - updateToken: y - }), [e, t, p, g, y]); - return l.initialized ? l.error ? z : !l.authenticated && !A ? null : /* @__PURE__ */ L(M.Provider, { value: l, children: S }) : w; + logout: y, + updateToken: K + }), [e, t, p, y, K]); + return l.initialized ? l.error ? S : !l.authenticated && !w ? null : /* @__PURE__ */ A(B.Provider, { value: l, children: C }) : z; } -const $ = C("Keycloak", 40, P); +const J = T("Keycloak", 40, F); export { - $ as Keycloak, - I as useKeycloak + J as Keycloak, + U as useKeycloak }; diff --git a/dist/permission.d.ts b/dist/permission.d.ts index d7dd706..8084c7f 100644 --- a/dist/permission.d.ts +++ b/dist/permission.d.ts @@ -7,6 +7,7 @@ export interface PermissionProps { /** Used only when Keycloak has no token. Otherwise the permission request is unauthenticated. */ getToken?: () => string | null | Promise; storageKey?: string; + /** Defaults to Chakra Spinner when is present; otherwise legacy text. Explicit null disables it. */ loading?: ReactNode; errorFallback?: ReactNode; enabled?: boolean; diff --git a/dist/permission.js b/dist/permission.js index a9d47f8..6f419bf 100644 --- a/dist/permission.js +++ b/dist/permission.js @@ -1,13 +1,13 @@ "use client"; -import { jsx as L } from "react/jsx-runtime"; -import { useState as U, useRef as B, useEffect as F, useCallback as y, useMemo as z } from "react"; -import { d as K } from "./chunks/feature-registry-B2iuEiEx.js"; -import { u as H } from "./chunks/provider-runtime-B6XIrDzf.js"; -import { PermissionContext as N, usePermission as $ } from "./core-runtime.js"; -function Q(r) { +import { jsx as y } from "react/jsx-runtime"; +import { useContext as Q, useState as U, useRef as B, useEffect as F, useCallback as L, useMemo as z } from "react"; +import { d as V } from "./chunks/feature-registry-B2iuEiEx.js"; +import { C as X, u as H } from "./chunks/provider-runtime-CxEpkUq5.js"; +import { PermissionContext as Z, usePermission as E } from "./core-runtime.js"; +function k(r) { return new Set((Array.isArray(r) ? r : []).map((n) => n.name)); } -function V(r, n = "") { +function nn(r, n = "") { if (!n) return !1; if (r.has(n) || [...r].some((s) => s.startsWith(n))) return !0; let e = n; @@ -15,7 +15,7 @@ function V(r, n = "") { if (e = e.slice(0, e.lastIndexOf(":")), r.has(`${e}:*`)) return !0; return !1; } -function X(r = "permissions") { +function rn(r = "permissions") { if (!(typeof window > "u")) try { const n = window.localStorage.getItem(r), e = n ? JSON.parse(n) : void 0; @@ -24,113 +24,113 @@ function X(r = "permissions") { return; } } -function Z(r = "permissions", n) { +function en(r = "permissions", n) { if (!(typeof window > "u")) try { window.localStorage.setItem(r, JSON.stringify(n)); } catch { } } -function k(r = "permissions") { +function tn(r = "permissions") { if (!(typeof window > "u")) try { window.localStorage.removeItem(r); } catch { } } -function nn({ +function sn({ children: r, clientId: n, url: e = "https://api.d.aiengines.ir/user_api/v1/permissions/list", user: s = null, - getToken: u, - storageKey: d, - loading: l = /* @__PURE__ */ L("div", { children: "Loading permissions..." }), - errorFallback: f = /* @__PURE__ */ L("div", { children: "Error loading permissions" }), - enabled: x = !0 + getToken: d, + storageKey: l, + loading: c, + errorFallback: f = /* @__PURE__ */ y("div", { children: "Error loading permissions" }), + enabled: $ = !0 }) { var I, J; if (!n) throw new Error(" requires clientId."); - const t = H(), M = ((J = (I = t == null ? void 0 : t.instance) == null ? void 0 : I.tokenParsed) == null ? void 0 : J.sub) ?? (s == null ? void 0 : s.id) ?? "anonymous", i = d ?? `permissions:${n}:${M}`, [W, Y] = U(0), [G, p] = U({ key: null, permissions: null, isLoading: !0, error: null }), v = B(u); - v.current = u; - const O = t == null ? void 0 : t.token, w = t == null ? void 0 : t.instance, R = t == null ? void 0 : t.authenticated, h = t == null ? void 0 : t.updateToken; + const M = Q(X), W = c !== void 0 ? c : M ?? /* @__PURE__ */ y("div", { children: "Loading permissions..." }), t = H(), Y = ((J = (I = t == null ? void 0 : t.instance) == null ? void 0 : I.tokenParsed) == null ? void 0 : J.sub) ?? (s == null ? void 0 : s.id) ?? "anonymous", i = l ?? `permissions:${n}:${Y}`, [D, K] = U(0), [G, h] = U({ key: null, permissions: null, isLoading: !0, error: null }), v = B(d); + v.current = d; + const O = t == null ? void 0 : t.token, p = t == null ? void 0 : t.instance, R = t == null ? void 0 : t.authenticated, w = t == null ? void 0 : t.updateToken; F(() => { - const o = X(i) ?? null; - if (!x) { - p({ key: i, permissions: [], isLoading: !1, error: null }); + const o = rn(i) ?? null; + if (!$) { + h({ key: i, permissions: [], isLoading: !1, error: null }); return; } - let A = !0; - const b = new AbortController(); - return p({ key: i, permissions: o, isLoading: !o, error: null }), (async () => { + let C = !0; + const A = new AbortController(); + return h({ key: i, permissions: o, isLoading: !o, error: null }), (async () => { try { - const S = typeof window > "u" ? "http://localhost" : window.location.origin, T = new URL(e, S); + const b = typeof window > "u" ? "http://localhost" : window.location.origin, T = new URL(e, b); T.searchParams.set("client_id", n); let m = null; if (R) { try { - await (h == null ? void 0 : h(5)); + await (w == null ? void 0 : w(5)); } catch { } - m = (w == null ? void 0 : w.token) || O || null; + m = (p == null ? void 0 : p.token) || O || null; } !m && v.current && (m = await v.current() || null); - const C = await fetch(T, { - signal: b.signal, + const S = await fetch(T, { + signal: A.signal, headers: m ? { Authorization: `Bearer ${m}` } : {} }); - if (!C.ok) throw new Error(`Permission HTTP ${C.status}`); - const E = await C.json(); - if (!Array.isArray(E)) throw new Error("Permission response must be an array."); - if (!A) return; - Z(i, E), p({ key: i, permissions: E, isLoading: !1, error: null }); - } catch (S) { - A && !b.signal.aborted && p({ key: i, permissions: o, isLoading: !1, error: S }); + if (!S.ok) throw new Error(`Permission HTTP ${S.status}`); + const x = await S.json(); + if (!Array.isArray(x)) throw new Error("Permission response must be an array."); + if (!C) return; + en(i, x), h({ key: i, permissions: x, isLoading: !1, error: null }); + } catch (b) { + C && !A.signal.aborted && h({ key: i, permissions: o, isLoading: !1, error: b }); } })(), () => { - A = !1, b.abort(); + C = !1, A.abort(); }; - }, [e, n, i, O, w, x, R, h, W]); - const g = y(() => Y((o) => o + 1), []), _ = y(() => { - k(i), g(); - }, [i, g]), a = G.key === i ? G : { permissions: null, isLoading: !0, error: null }, c = a.permissions, j = z(() => Q(c), [c]), P = y((o) => V(j, o), [j]), q = y((o) => !P(o), [P]), D = z(() => ({ + }, [e, n, i, O, p, $, R, w, D]); + const g = L(() => K((o) => o + 1), []), _ = L(() => { + tn(i), g(); + }, [i, g]), a = G.key === i ? G : { permissions: null, isLoading: !0, error: null }, u = a.permissions, j = z(() => k(u), [u]), P = L((o) => nn(j, o), [j]), q = L((o) => !P(o), [P]), N = z(() => ({ user: s, - permissions: c, + permissions: u, can: P, cannot: q, isLoading: a.isLoading, error: a.error, refresh: g, clear: _ - }), [s, c, P, q, a.isLoading, a.error, g, _]); - return a.isLoading && !c ? l : a.error && !c ? f : /* @__PURE__ */ L(N.Provider, { value: D, children: r }); + }), [s, u, P, q, a.isLoading, a.error, g, _]); + return a.isLoading && !u ? W : a.error && !u ? f : /* @__PURE__ */ y(Z.Provider, { value: N, children: r }); } -const an = K("Permission", 60, nn); -function cn({ perm: r, children: n, fallback: e = /* @__PURE__ */ L("div", { children: "You are not allowed to do this" }) }) { - const { can: s } = $(); +const ln = V("Permission", 60, sn); +function fn({ perm: r, children: n, fallback: e = /* @__PURE__ */ y("div", { children: "You are not allowed to do this" }) }) { + const { can: s } = E(); return s(r) ? n : e; } -function un({ children: r }) { - const { permissions: n, can: e } = $(); +function mn({ children: r }) { + const { permissions: n, can: e } = E(); return n && e("admin") ? r : null; } -function dn({ children: r, forceNoAccess: n = !1, onNoAccess: e }) { - const { can: s, isLoading: u } = $(), d = H(), l = B(e); - l.current = e; - const f = d == null ? void 0 : d.logout; +function hn({ children: r, forceNoAccess: n = !1, onNoAccess: e }) { + const { can: s, isLoading: d } = E(), l = H(), c = B(e); + c.current = e; + const f = l == null ? void 0 : l.logout; return F(() => { - u || !n && s("panel_access") || (l.current ? l.current() : f && f()); - }, [u, n, s, f]), r; + d || !n && s("panel_access") || (c.current ? c.current() : f && f()); + }, [d, n, s, f]), r; } export { - un as AdminGuard, - cn as Can, - dn as PanelAccessGuard, - an as Permission, - V as checkPermission, - k as clearCachedPermissions, - Q as createPermissionSet, - X as getCachedPermissions, - Z as setCachedPermissions, - $ as usePermission + mn as AdminGuard, + fn as Can, + hn as PanelAccessGuard, + ln as Permission, + nn as checkPermission, + tn as clearCachedPermissions, + k as createPermissionSet, + rn as getCachedPermissions, + en as setCachedPermissions, + E as usePermission }; diff --git a/dist/remote/demo-assets/AppHeaderPreview-BtcI8Bja.js b/dist/remote/demo-assets/AppHeaderPreview-DOKJC5wC.js similarity index 97% rename from dist/remote/demo-assets/AppHeaderPreview-BtcI8Bja.js rename to dist/remote/demo-assets/AppHeaderPreview-DOKJC5wC.js index c8d1a1a..d574e99 100644 --- a/dist/remote/demo-assets/AppHeaderPreview-BtcI8Bja.js +++ b/dist/remote/demo-assets/AppHeaderPreview-DOKJC5wC.js @@ -1,4 +1,4 @@ -import{r as g,g as wd,c as _r,R as bl,j as u,a as kd,b as Cd,d as se,e as ts,D as Bo,f as xl}from"./index-DNhZDl2y.js";function Op(){return!!globalThis?.document}function Np(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}const Je=e=>e?"":void 0,bi=e=>e?!0:void 0;function Wp(e){return Array.isArray(e)}function Fe(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Wp(e)}function Hp(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Up(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function ns(e){if(e==null)return e;const{unitless:t}=Up(e);return t||typeof e=="number"?`${e}px`:e}const Pd=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Us=e=>Object.fromEntries(Object.entries(e).sort(Pd));function vl(e){const t=Us(e);return Object.assign(Object.values(t),t)}function Gp(e){const t=Object.keys(Us(e));return new Set(t)}function Sl(e){if(!e)return e;e=ns(e)??e;const t=-.02;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function Dn(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${ns(e)})`),t&&n.push("and",`(max-width: ${ns(t)})`),n.join(" ")}function Kp(e){if(!e)return null;e.base=e.base??"0px";const t=vl(e),n=Object.entries(e).sort(Pd).map(([i,s],a,l)=>{let[,c]=l[a+1]??[];return c=parseFloat(c)>0?Sl(c):void 0,{_minW:Sl(s),breakpoint:i,minW:s,maxW:c,maxWQuery:Dn(null,c),minWQuery:Dn(s),minMaxQuery:Dn(s,c)}}),r=Gp(e),o=Array.from(r.values());return{keys:r,normalized:t,isResponsive(i){const s=Object.keys(i);return s.length>0&&s.every(a=>r.has(a))},asObject:Us(e),asArray:vl(e),details:n,get(i){return n.find(s=>s.breakpoint===i)},media:[null,...t.map(i=>Dn(i)).slice(1)],toArrayValue(i){if(!Fe(i))throw new Error("toArrayValue: value must be an object");const s=o.map(a=>i[a]??null);for(;Hp(s)===null;)s.pop();return s},toObjectValue(i){if(!Array.isArray(i))throw new Error("toObjectValue: value must be an array");return i.reduce((s,a,l)=>{const c=o[l];return c!=null&&a!=null&&(s[c]=a),s},{})}}}function wl(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function qp(e){return g.Children.toArray(e).filter(t=>g.isValidElement(t))}function Td(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Xp(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function kt(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,a=g.createContext(s);a.displayName=t;function l(){const c=g.useContext(a);if(!c&&n){const d=new Error(i??Xp(r,o));throw d.name="ContextError",Error.captureStackTrace?.(d,l),d}return c}return[a.Provider,l,a]}const ge=(...e)=>e.filter(Boolean).join(" ");function Yp(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},Ad=Zp(Yp),Qp=e=>e.default||e;function Jp(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function em(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Gs(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Fe(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}const tm=e=>typeof e=="function";function st(e,...t){return tm(e)?e(...t):e}function nm(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),o=s=>{const a={};for(let l=0;lo(Array.isArray(s)?s:r.filter(s));return t.map(i).concat(o(r))}function kl(e,t,n={}){const{stop:r,getKey:o}=n;function i(s,a=[]){if(Fe(s)||Array.isArray(s)){const l={};for(const[c,d]of Object.entries(s)){const f=o?.(c)??c,p=[...a,f];if(r?.(s,p))return t(s,a);l[f]=i(d,p)}return l}return t(s,a)}return i(e)}var yo={exports:{}};yo.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",p="[object Error]",m="[object Function]",b="[object GeneratorFunction]",y="[object Map]",S="[object Number]",w="[object Null]",C="[object Object]",T="[object Proxy]",A="[object RegExp]",$="[object Set]",E="[object String]",R="[object Undefined]",_="[object WeakMap]",V="[object ArrayBuffer]",z="[object DataView]",N="[object Float32Array]",ue="[object Float64Array]",Oe="[object Int8Array]",Be="[object Int16Array]",Ne="[object Int32Array]",ze="[object Uint8Array]",qa="[object Uint8ClampedArray]",fe="[object Uint16Array]",Te="[object Uint32Array]",ft=/[\\^$.*+?()[\]{}|]/g,Pt=/^\[object .+?Constructor\]$/,ii=/^(?:0|[1-9]\d*)$/,te={};te[N]=te[ue]=te[Oe]=te[Be]=te[Ne]=te[ze]=te[qa]=te[fe]=te[Te]=!0,te[a]=te[l]=te[V]=te[d]=te[z]=te[f]=te[p]=te[m]=te[y]=te[S]=te[C]=te[A]=te[$]=te[E]=te[_]=!1;var Xa=typeof _r=="object"&&_r&&_r.Object===Object&&_r,Ah=typeof self=="object"&&self&&self.Object===Object&&self,Tn=Xa||Ah||Function("return this")(),Ya=t&&!t.nodeType&&t,An=Ya&&!0&&e&&!e.nodeType&&e,Za=An&&An.exports===Ya,si=Za&&Xa.process,Qa=function(){try{var h=An&&An.require&&An.require("util").types;return h||si&&si.binding&&si.binding("util")}catch{}}(),Ja=Qa&&Qa.isTypedArray;function Rh(h,v,k){switch(k.length){case 0:return h.call(v);case 1:return h.call(v,k[0]);case 2:return h.call(v,k[0],k[1]);case 3:return h.call(v,k[0],k[1],k[2])}return h.apply(v,k)}function _h(h,v){for(var k=-1,M=Array(h);++k-1}function Zh(h,v){var k=this.__data__,M=Pr(k,h);return M<0?(++this.size,k.push([h,v])):k[M][1]=v,this}ht.prototype.clear=Kh,ht.prototype.delete=qh,ht.prototype.get=Xh,ht.prototype.has=Yh,ht.prototype.set=Zh;function Zt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v1?k[O-1]:void 0,re=O>2?k[2]:void 0;for(Z=h.length>3&&typeof Z=="function"?(O--,Z):void 0,re&&Tp(k[0],k[1],re)&&(Z=O<3?void 0:Z,O=1),v=Object(v);++M-1&&h%1==0&&h0){if(++v>=o)return arguments[0]}else v=0;return h.apply(void 0,arguments)}}function Bp(h){if(h!=null){try{return wr.call(h)}catch{}try{return h+""}catch{}}return""}function Rr(h,v){return h===v||h!==h&&v!==v}var fi=ll(function(){return arguments}())?ll:function(h){return _n(h)&&Tt.call(h,"callee")&&!Dh.call(h,"callee")},hi=Array.isArray;function pi(h){return h!=null&&hl(h.length)&&!mi(h)}function zp(h){return _n(h)&&pi(h)}var fl=Fh||Lp;function mi(h){if(!Dt(h))return!1;var v=Tr(h);return v==m||v==b||v==c||v==T}function hl(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=s}function Dt(h){var v=typeof h;return h!=null&&(v=="object"||v=="function")}function _n(h){return h!=null&&typeof h=="object"}function Ip(h){if(!_n(h)||Tr(h)!=C)return!1;var v=ol(h);if(v===null)return!0;var k=Tt.call(v,"constructor")&&v.constructor;return typeof k=="function"&&k instanceof k&&wr.call(k)==zh}var pl=Ja?Eh(Ja):fp;function Dp(h){return Sp(h,ml(h))}function ml(h){return pi(h)?lp(h):hp(h)}var Vp=wp(function(h,v,k,M){cl(h,v,k,M)});function Fp(h){return function(){return h}}function gl(h){return h}function Lp(){return!1}e.exports=Vp})(yo,yo.exports);var rm=yo.exports;const at=wd(rm);function om(e,t=[]){const n=g.useRef(e);return g.useEffect(()=>{n.current=e}),g.useCallback((...r)=>n.current?.(...r),t)}const rs=globalThis?.document?g.useLayoutEffect:g.useEffect,Cl=(e,t)=>{const n=g.useRef(!1),r=g.useRef(!1);g.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),g.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function im(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function os(...e){return t=>{e.forEach(n=>{im(n,t)})}}function sm(...e){return g.useMemo(()=>os(...e),e)}function am(e,t){const n=om(e);g.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}const he={open:(e,t)=>`${e}[data-open], ${e}[open], ${e}[data-state=open] ${t}`,closed:(e,t)=>`${e}[data-closed], ${e}[data-state=closed] ${t}`,hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Ze=e=>Rd(t=>e(t,"&"),"[role=group]","[data-group]",".group"),pt=e=>Rd(t=>e(t,"~ &"),"[data-peer]",".peer"),Rd=(e,...t)=>t.map(e).join(", "),zo={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Ze(he.open),_groupClosed:Ze(he.closed),_groupHover:Ze(he.hover),_peerHover:pt(he.hover),_groupFocus:Ze(he.focus),_peerFocus:pt(he.focus),_groupFocusVisible:Ze(he.focusVisible),_peerFocusVisible:pt(he.focusVisible),_groupActive:Ze(he.active),_peerActive:pt(he.active),_groupDisabled:Ze(he.disabled),_peerDisabled:pt(he.disabled),_groupInvalid:Ze(he.invalid),_peerInvalid:pt(he.invalid),_groupChecked:Ze(he.checked),_peerChecked:pt(he.checked),_groupFocusWithin:Ze(he.focusWithin),_peerFocusWithin:pt(he.focusWithin),_peerPlaceholderShown:pt(he.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"},_d=Object.keys(zo),lm=e=>/!(important)?$/.test(e),Pl=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,cm=(e,t)=>n=>{const r=String(t),o=lm(r),i=Pl(r),s=e?`${e}.${i}`:i;let a=Fe(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=Pl(a),o?`${a} !important`:a};function Ks(e){const{scale:t,transform:n,compose:r}=e;return(i,s)=>{const a=cm(t,i)(s);let l=n?.(a,s)??a;return r&&(l=r(l,s)),l}}const Er=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ie(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ks({scale:e,transform:t}),r}}const dm=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function um(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:dm(t),transform:n?Ks({scale:n,compose:r}):r}}const Ed=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function fm(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Ed].join(" ")}function hm(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Ed].join(" ")}const pm={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},mm={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function gm(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const ym={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},is={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},bm=new Set(Object.values(is)),ss=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),xm=e=>e.trim();function vm(e,t){if(e==null||ss.has(e))return e;if(!(as(e)||ss.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o?.[1],s=o?.[2];if(!i||!s)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[l,...c]=s.split(",").map(xm).filter(Boolean);if(c?.length===0)return e;const d=l in is?is[l]:l;c.unshift(d);const f=c.map(p=>{if(bm.has(p))return p;const m=p.indexOf(" "),[b,y]=m!==-1?[p.substr(0,m),p.substr(m+1)]:[p],S=as(y)?y:y&&y.split(" "),w=`colors.${b}`,C=w in t.__cssMap?t.__cssMap[w].varRef:b;return S?[C,...Array.isArray(S)?S:[S]].join(" "):C});return`${a}(${f.join(", ")})`}const as=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Sm=(e,t)=>vm(e,t??{});function wm(e){return/^var\(--.+\)$/.test(e)}const km=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Qe=e=>t=>`${e}(${t})`,L={filter(e){return e!=="auto"?e:pm},backdropFilter(e){return e!=="auto"?e:mm},ring(e){return gm(L.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?fm():e==="auto-gpu"?hm():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=km(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(wm(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Sm,blur:Qe("blur"),opacity:Qe("opacity"),brightness:Qe("brightness"),contrast:Qe("contrast"),dropShadow:Qe("drop-shadow"),grayscale:Qe("grayscale"),hueRotate:e=>Qe("hue-rotate")(L.degree(e)),invert:Qe("invert"),saturate:Qe("saturate"),sepia:Qe("sepia"),bgImage(e){return e==null||as(e)||ss.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ym[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},x={borderWidths:Ie("borderWidths"),borderStyles:Ie("borderStyles"),colors:Ie("colors"),borders:Ie("borders"),gradients:Ie("gradients",L.gradient),radii:Ie("radii",L.px),space:Ie("space",Er(L.vh,L.px)),spaceT:Ie("space",Er(L.vh,L.px)),degreeT(e){return{property:e,transform:L.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Ks({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ie("sizes",Er(L.vh,L.px)),sizesT:Ie("sizes",Er(L.vh,L.fraction)),shadows:Ie("shadows"),logical:um,blur:Ie("blur",L.blur)},qr={background:x.colors("background"),backgroundColor:x.colors("backgroundColor"),backgroundImage:x.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:L.bgClip},bgSize:x.prop("backgroundSize"),bgPosition:x.prop("backgroundPosition"),bg:x.colors("background"),bgColor:x.colors("backgroundColor"),bgPos:x.prop("backgroundPosition"),bgRepeat:x.prop("backgroundRepeat"),bgAttachment:x.prop("backgroundAttachment"),bgGradient:x.gradients("backgroundImage"),bgClip:{transform:L.bgClip}};Object.assign(qr,{bgImage:qr.backgroundImage,bgImg:qr.backgroundImage});const H={border:x.borders("border"),borderWidth:x.borderWidths("borderWidth"),borderStyle:x.borderStyles("borderStyle"),borderColor:x.colors("borderColor"),borderRadius:x.radii("borderRadius"),borderTop:x.borders("borderTop"),borderBlockStart:x.borders("borderBlockStart"),borderTopLeftRadius:x.radii("borderTopLeftRadius"),borderStartStartRadius:x.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:x.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:x.radii("borderTopRightRadius"),borderStartEndRadius:x.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:x.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:x.borders("borderRight"),borderInlineEnd:x.borders("borderInlineEnd"),borderBottom:x.borders("borderBottom"),borderBlockEnd:x.borders("borderBlockEnd"),borderBottomLeftRadius:x.radii("borderBottomLeftRadius"),borderBottomRightRadius:x.radii("borderBottomRightRadius"),borderLeft:x.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:x.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:x.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:x.borders(["borderLeft","borderRight"]),borderInline:x.borders("borderInline"),borderY:x.borders(["borderTop","borderBottom"]),borderBlock:x.borders("borderBlock"),borderTopWidth:x.borderWidths("borderTopWidth"),borderBlockStartWidth:x.borderWidths("borderBlockStartWidth"),borderTopColor:x.colors("borderTopColor"),borderBlockStartColor:x.colors("borderBlockStartColor"),borderTopStyle:x.borderStyles("borderTopStyle"),borderBlockStartStyle:x.borderStyles("borderBlockStartStyle"),borderBottomWidth:x.borderWidths("borderBottomWidth"),borderBlockEndWidth:x.borderWidths("borderBlockEndWidth"),borderBottomColor:x.colors("borderBottomColor"),borderBlockEndColor:x.colors("borderBlockEndColor"),borderBottomStyle:x.borderStyles("borderBottomStyle"),borderBlockEndStyle:x.borderStyles("borderBlockEndStyle"),borderLeftWidth:x.borderWidths("borderLeftWidth"),borderInlineStartWidth:x.borderWidths("borderInlineStartWidth"),borderLeftColor:x.colors("borderLeftColor"),borderInlineStartColor:x.colors("borderInlineStartColor"),borderLeftStyle:x.borderStyles("borderLeftStyle"),borderInlineStartStyle:x.borderStyles("borderInlineStartStyle"),borderRightWidth:x.borderWidths("borderRightWidth"),borderInlineEndWidth:x.borderWidths("borderInlineEndWidth"),borderRightColor:x.colors("borderRightColor"),borderInlineEndColor:x.colors("borderInlineEndColor"),borderRightStyle:x.borderStyles("borderRightStyle"),borderInlineEndStyle:x.borderStyles("borderInlineEndStyle"),borderTopRadius:x.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:x.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:x.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:x.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(H,{rounded:H.borderRadius,roundedTop:H.borderTopRadius,roundedTopLeft:H.borderTopLeftRadius,roundedTopRight:H.borderTopRightRadius,roundedTopStart:H.borderStartStartRadius,roundedTopEnd:H.borderStartEndRadius,roundedBottom:H.borderBottomRadius,roundedBottomLeft:H.borderBottomLeftRadius,roundedBottomRight:H.borderBottomRightRadius,roundedBottomStart:H.borderEndStartRadius,roundedBottomEnd:H.borderEndEndRadius,roundedLeft:H.borderLeftRadius,roundedRight:H.borderRightRadius,roundedStart:H.borderInlineStartRadius,roundedEnd:H.borderInlineEndRadius,borderStart:H.borderInlineStart,borderEnd:H.borderInlineEnd,borderTopStartRadius:H.borderStartStartRadius,borderTopEndRadius:H.borderStartEndRadius,borderBottomStartRadius:H.borderEndStartRadius,borderBottomEndRadius:H.borderEndEndRadius,borderStartRadius:H.borderInlineStartRadius,borderEndRadius:H.borderInlineEndRadius,borderStartWidth:H.borderInlineStartWidth,borderEndWidth:H.borderInlineEndWidth,borderStartColor:H.borderInlineStartColor,borderEndColor:H.borderInlineEndColor,borderStartStyle:H.borderInlineStartStyle,borderEndStyle:H.borderInlineEndStyle});const Cm={color:x.colors("color"),textColor:x.colors("color"),fill:x.colors("fill"),stroke:x.colors("stroke"),accentColor:x.colors("accentColor"),textFillColor:x.colors("textFillColor")},bo={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:L.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:x.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:x.space("gap"),rowGap:x.space("rowGap"),columnGap:x.space("columnGap")};Object.assign(bo,{flexDir:bo.flexDirection});const De={width:x.sizesT("width"),inlineSize:x.sizesT("inlineSize"),height:x.sizes("height"),blockSize:x.sizes("blockSize"),boxSize:x.sizes(["width","height"]),minWidth:x.sizes("minWidth"),minInlineSize:x.sizes("minInlineSize"),minHeight:x.sizes("minHeight"),minBlockSize:x.sizes("minBlockSize"),maxWidth:x.sizes("maxWidth"),maxInlineSize:x.sizes("maxInlineSize"),maxHeight:x.sizes("maxHeight"),maxBlockSize:x.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>({[`@media screen and (min-width: ${t.__breakpoints?.get(e)?.minW??e})`]:{display:"none"}})},hideBelow:{scale:"breakpoints",transform:(e,t)=>({[`@media screen and (max-width: ${t.__breakpoints?.get(e)?._minW??e})`]:{display:"none"}})},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:x.propT("float",L.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(De,{w:De.width,h:De.height,minW:De.minWidth,maxW:De.maxWidth,minH:De.minHeight,maxH:De.maxHeight,overscroll:De.overscrollBehavior,overscrollX:De.overscrollBehaviorX,overscrollY:De.overscrollBehaviorY});const Pm={filter:{transform:L.filter},blur:x.blur("--chakra-blur"),brightness:x.propT("--chakra-brightness",L.brightness),contrast:x.propT("--chakra-contrast",L.contrast),hueRotate:x.propT("--chakra-hue-rotate",L.hueRotate),invert:x.propT("--chakra-invert",L.invert),saturate:x.propT("--chakra-saturate",L.saturate),dropShadow:x.propT("--chakra-drop-shadow",L.dropShadow),backdropFilter:{transform:L.backdropFilter},backdropBlur:x.blur("--chakra-backdrop-blur"),backdropBrightness:x.propT("--chakra-backdrop-brightness",L.brightness),backdropContrast:x.propT("--chakra-backdrop-contrast",L.contrast),backdropHueRotate:x.propT("--chakra-backdrop-hue-rotate",L.hueRotate),backdropInvert:x.propT("--chakra-backdrop-invert",L.invert),backdropSaturate:x.propT("--chakra-backdrop-saturate",L.saturate)},Tm={ring:{transform:L.ring},ringColor:x.colors("--chakra-ring-color"),ringOffset:x.prop("--chakra-ring-offset-width"),ringOffsetColor:x.colors("--chakra-ring-offset-color"),ringInset:x.prop("--chakra-ring-inset")},Am={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:L.outline},outlineOffset:!0,outlineColor:x.colors("outlineColor")},$d={gridGap:x.space("gridGap"),gridColumnGap:x.space("gridColumnGap"),gridRowGap:x.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function Rm(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},Em=_m(Rm),$m={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},jm={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},xi=(e,t,n)=>{const r={},o=Em(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},Mm={srOnly:{transform(e){return e===!0?$m:e==="focusable"?jm:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>xi(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>xi(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>xi(t,e,n)}},Hn={position:!0,pos:x.prop("position"),zIndex:x.prop("zIndex","zIndices"),inset:x.spaceT("inset"),insetX:x.spaceT(["left","right"]),insetInline:x.spaceT("insetInline"),insetY:x.spaceT(["top","bottom"]),insetBlock:x.spaceT("insetBlock"),top:x.spaceT("top"),insetBlockStart:x.spaceT("insetBlockStart"),bottom:x.spaceT("bottom"),insetBlockEnd:x.spaceT("insetBlockEnd"),left:x.spaceT("left"),insetInlineStart:x.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:x.spaceT("right"),insetInlineEnd:x.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Hn,{insetStart:Hn.insetInlineStart,insetEnd:Hn.insetInlineEnd});const ls={boxShadow:x.shadows("boxShadow"),mixBlendMode:!0,blendMode:x.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:x.prop("backgroundBlendMode"),opacity:!0};Object.assign(ls,{shadow:ls.boxShadow});const ne={margin:x.spaceT("margin"),marginTop:x.spaceT("marginTop"),marginBlockStart:x.spaceT("marginBlockStart"),marginRight:x.spaceT("marginRight"),marginInlineEnd:x.spaceT("marginInlineEnd"),marginBottom:x.spaceT("marginBottom"),marginBlockEnd:x.spaceT("marginBlockEnd"),marginLeft:x.spaceT("marginLeft"),marginInlineStart:x.spaceT("marginInlineStart"),marginX:x.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:x.spaceT("marginInline"),marginY:x.spaceT(["marginTop","marginBottom"]),marginBlock:x.spaceT("marginBlock"),padding:x.space("padding"),paddingTop:x.space("paddingTop"),paddingBlockStart:x.space("paddingBlockStart"),paddingRight:x.space("paddingRight"),paddingBottom:x.space("paddingBottom"),paddingBlockEnd:x.space("paddingBlockEnd"),paddingLeft:x.space("paddingLeft"),paddingInlineStart:x.space("paddingInlineStart"),paddingInlineEnd:x.space("paddingInlineEnd"),paddingX:x.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:x.space("paddingInline"),paddingY:x.space(["paddingTop","paddingBottom"]),paddingBlock:x.space("paddingBlock")};Object.assign(ne,{m:ne.margin,mt:ne.marginTop,mr:ne.marginRight,me:ne.marginInlineEnd,marginEnd:ne.marginInlineEnd,mb:ne.marginBottom,ml:ne.marginLeft,ms:ne.marginInlineStart,marginStart:ne.marginInlineStart,mx:ne.marginX,my:ne.marginY,p:ne.padding,pt:ne.paddingTop,py:ne.paddingY,px:ne.paddingX,pb:ne.paddingBottom,pl:ne.paddingLeft,ps:ne.paddingInlineStart,paddingStart:ne.paddingInlineStart,pr:ne.paddingRight,pe:ne.paddingInlineEnd,paddingEnd:ne.paddingInlineEnd});const Bm={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:x.spaceT("scrollMargin"),scrollMarginTop:x.spaceT("scrollMarginTop"),scrollMarginBottom:x.spaceT("scrollMarginBottom"),scrollMarginLeft:x.spaceT("scrollMarginLeft"),scrollMarginRight:x.spaceT("scrollMarginRight"),scrollMarginX:x.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:x.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:x.spaceT("scrollPadding"),scrollPaddingTop:x.spaceT("scrollPaddingTop"),scrollPaddingBottom:x.spaceT("scrollPaddingBottom"),scrollPaddingLeft:x.spaceT("scrollPaddingLeft"),scrollPaddingRight:x.spaceT("scrollPaddingRight"),scrollPaddingX:x.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:x.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},zm={fontFamily:x.prop("fontFamily","fonts"),fontSize:x.prop("fontSize","fontSizes",L.px),fontWeight:x.prop("fontWeight","fontWeights"),lineHeight:x.prop("lineHeight","lineHeights"),letterSpacing:x.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Im={textDecorationColor:x.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:x.shadows("textShadow")},Dm={clipPath:!0,transform:x.propT("transform",L.transform),transformOrigin:!0,translateX:x.spaceT("--chakra-translate-x"),translateY:x.spaceT("--chakra-translate-y"),skewX:x.degreeT("--chakra-skew-x"),skewY:x.degreeT("--chakra-skew-y"),scaleX:x.prop("--chakra-scale-x"),scaleY:x.prop("--chakra-scale-y"),scale:x.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:x.degreeT("--chakra-rotate")},Vm={listStyleType:!0,listStylePosition:!0,listStylePos:x.prop("listStylePosition"),listStyleImage:!0,listStyleImg:x.prop("listStyleImage")},Fm={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:x.prop("transitionDuration","transition.duration"),transitionProperty:x.prop("transitionProperty","transition.property"),transitionTimingFunction:x.prop("transitionTimingFunction","transition.easing")},qs=at({},qr,H,Cm,bo,De,Pm,Tm,Am,$d,Mm,Hn,ls,ne,Bm,zm,Im,Dm,Vm,Fm);Object.assign({},ne,De,bo,$d,Hn);const Lm=[...Object.keys(qs),..._d],Om={...qs,...zo},Nm=e=>e in Om,Wm=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const s in e){let a=st(e[s],t);if(a==null)continue;if(a=Fe(a)&&n(a)?r(a):a,!Array.isArray(a)){i[s]=a;continue}const l=a.slice(0,o.length).length;for(let c=0;ce.startsWith("--")&&typeof t=="string"&&!Um(t),Km=(e,t)=>{if(t==null)return t;const n=s=>e.__cssMap?.[s]?.varRef,r=s=>n(s)??s,[o,i]=Hm(t);return t=n(o)??r(i)??r(t),t};function qm(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,s=!1)=>{const a=st(i,r),l=Wm(a)(r);let c={};for(let d in l){const f=l[d];let p=st(f,r);d in n&&(d=n[d]),Gm(d,p)&&(p=Km(r,p));let m=t[d];if(m===!0&&(m={property:d}),Fe(p)){c[d]=c[d]??{},c[d]=at({},c[d],o(p,!0));continue}let b=m?.transform?.(p,r,a)??p;b=m?.processResult?o(b,!0):b;const y=st(m?.property,r);if(!s&&m?.static){const S=st(m.static,r);c=at({},c,S)}if(y&&Array.isArray(y)){for(const S of y)c[S]=b;continue}if(y){y==="&"&&Fe(b)?c=at({},c,b):c[y]=b;continue}if(Fe(b)){c=at({},c,b);continue}c[d]=b}return c};return o}const jd=e=>t=>qm({theme:t,pseudos:zo,configs:qs})(e);function ee(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Xm(e,t){if(Array.isArray(e))return e;if(Fe(e))return t(e);if(e!=null)return[e]}function Ym(e,t){for(let n=t+1;n{at(a,{[w]:d?S[w]:{[y]:S[w]}})});continue}if(!f){d?at(a,S):a[y]=S;continue}a[y]=S}}return a}}function Qm(e){return t=>{const{variant:n,size:r,theme:o}=t,i=Zm(o);return at({},st(e.baseStyle??{},t),i(e,"sizes",r,t),i(e,"variants",n,t))}}function Ye(e){return Jp(e,["styleConfig","size","variant","colorScheme"])}function Md(e){return Fe(e)&&e.reference?e.reference:String(e)}const Io=(e,...t)=>t.map(Md).join(` ${e} `).replace(/calc/g,""),Tl=(...e)=>`calc(${Io("+",...e)})`,Al=(...e)=>`calc(${Io("-",...e)})`,cs=(...e)=>`calc(${Io("*",...e)})`,Rl=(...e)=>`calc(${Io("/",...e)})`,_l=e=>{const t=Md(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:cs(t,-1)},gt=Object.assign(e=>({add:(...t)=>gt(Tl(e,...t)),subtract:(...t)=>gt(Al(e,...t)),multiply:(...t)=>gt(cs(e,...t)),divide:(...t)=>gt(Rl(e,...t)),negate:()=>gt(_l(e)),toString:()=>e.toString()}),{add:Tl,subtract:Al,multiply:cs,divide:Rl,negate:_l});function Jm(e,t="-"){return e.replace(/\s+/g,t)}function eg(e){const t=Jm(e.toString());return ng(tg(t))}function tg(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function ng(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function rg(e,t=""){return[t,e].filter(Boolean).join("-")}function og(e,t){return`var(${e}${t?`, ${t}`:""})`}function ig(e,t=""){return eg(`--${rg(e,t)}`)}function D(e,t,n){const r=ig(e,n);return{variable:r,reference:og(r,t)}}function sg(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=D(`${e}-${o}`,i);continue}n[r]=D(`${e}-${r}`)}return n}const ag=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function lg(e){return em(e,ag)}function cg(e){return e.semanticTokens}function dg(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}function ug(e){const t=lg(e),n=cg(e),r=i=>_d.includes(i)||i==="default",o={};return kl(t,(i,s)=>{i!=null&&(o[s.join(".")]={isSemantic:!1,value:i})}),kl(n,(i,s)=>{i!=null&&(o[s.join(".")]={isSemantic:!0,value:i})},{stop:i=>Object.keys(i).every(r)}),o}function El(e,t){return D(String(e).replace(/\./g,"-"),void 0,t)}function fg(e){const t=ug(e),n=e.config?.cssVarPrefix;let r={};const o={};function i(s,a){const c=[String(s).split(".")[0],a].join(".");if(!t[c])return a;const{reference:f}=El(c,n);return f}for(const[s,a]of Object.entries(t)){const{isSemantic:l,value:c}=a,{variable:d,reference:f}=El(s,n);if(!l){if(s.startsWith("space")){const m=s.split("."),[b,...y]=m,S=`${b}.-${y.join(".")}`,w=gt.negate(c),C=gt.negate(f);o[S]={value:w,var:d,varRef:C}}r[d]=c,o[s]={value:c,var:d,varRef:f};continue}const p=Fe(c)?c:{default:c};r=at(r,Object.entries(p).reduce((m,[b,y])=>{if(!y)return m;const S=i(s,`${y}`);if(b==="default")return m[d]=S,m;const w=zo?.[b]??b;return m[w]={[d]:S},m},{})),o[s]={value:f,var:d,varRef:f}}return{cssVars:r,cssMap:o}}function hg(e){const t=dg(e),{cssMap:n,cssVars:r}=fg(t);return Object.assign(t,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...r},__cssMap:n,__breakpoints:Kp(t.breakpoints)}),t}function q(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...d){r();for(const f of d)t[f]=l(f);return q(e,t)}function i(...d){for(const f of d)f in t||(t[f]=l(f));return q(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([f,p])=>[f,p.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([f,p])=>[f,p.className]))}function l(d){const m=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:m,selector:`.${m}`,toString:()=>d}}return{parts:o,toPart:l,extend:i,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}const pg=q("accordion").parts("root","container","button","panel","icon"),mg=q("alert").parts("title","description","container","icon","spinner"),gg=q("avatar").parts("label","badge","container","excessLabel","group"),yg=q("breadcrumb").parts("link","item","container","separator");q("button").parts();const bg=q("checkbox").parts("control","icon","container","label");q("progress").parts("track","filledTrack","label");const xg=q("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),vg=q("editable").parts("preview","input","textarea"),Sg=q("form").parts("container","requiredIndicator","helperText"),wg=q("formError").parts("text","icon"),kg=q("input").parts("addon","field","element","group"),Cg=q("list").parts("container","item","icon"),Pg=q("menu").parts("button","list","item","groupTitle","icon","command","divider"),Tg=q("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),Ag=q("numberinput").parts("root","field","stepperGroup","stepper");q("pininput").parts("field");const Rg=q("popover").parts("content","header","body","footer","popper","arrow","closeButton"),_g=q("progress").parts("label","filledTrack","track"),Eg=q("radio").parts("container","control","label"),$g=q("select").parts("field","icon"),jg=q("slider").parts("container","track","thumb","filledTrack","mark"),Mg=q("stat").parts("container","label","helpText","number","icon"),Bg=q("switch").parts("container","track","thumb","label"),zg=q("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Ig=q("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Dg=q("tag").parts("container","label","closeButton"),Vg=q("card").parts("container","header","body","footer");q("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");const{definePartsStyle:Fg,defineMultiStyleConfig:Lg}=ee(pg.keys),Og={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Ng={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Wg={pt:"2",px:"4",pb:"5"},Hg={fontSize:"1.25em"},Ug=Fg({container:Og,button:Ng,panel:Wg,icon:Hg}),Gg=Lg({baseStyle:Ug});function Ot(e,t,n){return Math.min(Math.max(e,n),t)}class Kg extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Vn=Kg;function Xs(e){if(typeof e!="string")throw new Vn(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=ty.test(e)?Yg(e):e;const n=Zg.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(rr(a,2),16)),parseInt(rr(s[3]||"f",2),16)/255]}const r=Qg.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=Jg.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=ey.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Ot(0,100,a)!==a)throw new Vn(e);if(Ot(0,100,l)!==l)throw new Vn(e);return[...ny(s,a,l),Number.isNaN(c)?1:c]}throw new Vn(e)}function qg(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const $l=e=>parseInt(e.replace(/_/g,""),36),Xg="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=$l(t.substring(0,3)),r=$l(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function Yg(e){const t=e.toLowerCase().trim(),n=Xg[qg(t)];if(!n)throw new Vn(e);return`#${n}`}const rr=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),Zg=new RegExp(`^#${rr("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Qg=new RegExp(`^#${rr("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Jg=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${rr(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),ey=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,ty=/^[a-z]+$/i,jl=e=>Math.round(e*255),ny=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(jl);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const d=r-i/2,f=a+d,p=l+d,m=c+d;return[f,p,m].map(jl)};function ry(e,t,n,r){return`rgba(${Ot(0,255,e).toFixed()}, ${Ot(0,255,t).toFixed()}, ${Ot(0,255,n).toFixed()}, ${parseFloat(Ot(0,1,r).toFixed(3))})`}function oy(e,t){const[n,r,o,i]=Xs(e);return ry(n,r,o,i-t)}function iy(e){const[t,n,r,o]=Xs(e);let i=s=>{const a=Ot(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}const sy=e=>Object.keys(e).length===0;function ay(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;r{const r=ay(e,`colors.${t}`,t);try{return iy(r),r}catch{return"#000000"}},ly=e=>{const[t,n,r]=Xs(e);return(t*299+n*587+r*114)/1e3},cy=e=>t=>{const n=we(t,e);return ly(n)<128?"dark":"light"},dy=e=>t=>cy(e)(t)==="dark",gn=(e,t)=>n=>{const r=we(n,e);return oy(r,1-t)};function Ml(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( +import{r as g,g as wd,c as _r,R as bl,j as u,a as kd,b as Cd,d as se,e as ts,D as Bo,f as xl}from"./index-GAwfVE8_.js";function Op(){return!!globalThis?.document}function Np(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}const Je=e=>e?"":void 0,bi=e=>e?!0:void 0;function Wp(e){return Array.isArray(e)}function Fe(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Wp(e)}function Hp(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function Up(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function ns(e){if(e==null)return e;const{unitless:t}=Up(e);return t||typeof e=="number"?`${e}px`:e}const Pd=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,Us=e=>Object.fromEntries(Object.entries(e).sort(Pd));function vl(e){const t=Us(e);return Object.assign(Object.values(t),t)}function Gp(e){const t=Object.keys(Us(e));return new Set(t)}function Sl(e){if(!e)return e;e=ns(e)??e;const t=-.02;return typeof e=="number"?`${e+t}`:e.replace(/(\d+\.?\d*)/u,n=>`${parseFloat(n)+t}`)}function Dn(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${ns(e)})`),t&&n.push("and",`(max-width: ${ns(t)})`),n.join(" ")}function Kp(e){if(!e)return null;e.base=e.base??"0px";const t=vl(e),n=Object.entries(e).sort(Pd).map(([i,s],a,l)=>{let[,c]=l[a+1]??[];return c=parseFloat(c)>0?Sl(c):void 0,{_minW:Sl(s),breakpoint:i,minW:s,maxW:c,maxWQuery:Dn(null,c),minWQuery:Dn(s),minMaxQuery:Dn(s,c)}}),r=Gp(e),o=Array.from(r.values());return{keys:r,normalized:t,isResponsive(i){const s=Object.keys(i);return s.length>0&&s.every(a=>r.has(a))},asObject:Us(e),asArray:vl(e),details:n,get(i){return n.find(s=>s.breakpoint===i)},media:[null,...t.map(i=>Dn(i)).slice(1)],toArrayValue(i){if(!Fe(i))throw new Error("toArrayValue: value must be an object");const s=o.map(a=>i[a]??null);for(;Hp(s)===null;)s.pop();return s},toObjectValue(i){if(!Array.isArray(i))throw new Error("toObjectValue: value must be an array");return i.reduce((s,a,l)=>{const c=o[l];return c!=null&&a!=null&&(s[c]=a),s},{})}}}function wl(...e){return function(n){e.some(r=>(r?.(n),n?.defaultPrevented))}}function qp(e){return g.Children.toArray(e).filter(t=>g.isValidElement(t))}function Td(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Xp(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function kt(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,a=g.createContext(s);a.displayName=t;function l(){const c=g.useContext(a);if(!c&&n){const d=new Error(i??Xp(r,o));throw d.name="ContextError",Error.captureStackTrace?.(d,l),d}return c}return[a.Provider,l,a]}const ge=(...e)=>e.filter(Boolean).join(" ");function Yp(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},Ad=Zp(Yp),Qp=e=>e.default||e;function Jp(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function em(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Gs(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):Fe(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}const tm=e=>typeof e=="function";function st(e,...t){return tm(e)?e(...t):e}function nm(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),o=s=>{const a={};for(let l=0;lo(Array.isArray(s)?s:r.filter(s));return t.map(i).concat(o(r))}function kl(e,t,n={}){const{stop:r,getKey:o}=n;function i(s,a=[]){if(Fe(s)||Array.isArray(s)){const l={};for(const[c,d]of Object.entries(s)){const f=o?.(c)??c,p=[...a,f];if(r?.(s,p))return t(s,a);l[f]=i(d,p)}return l}return t(s,a)}return i(e)}var yo={exports:{}};yo.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",d="[object Boolean]",f="[object Date]",p="[object Error]",m="[object Function]",b="[object GeneratorFunction]",y="[object Map]",S="[object Number]",w="[object Null]",C="[object Object]",T="[object Proxy]",A="[object RegExp]",$="[object Set]",E="[object String]",R="[object Undefined]",_="[object WeakMap]",V="[object ArrayBuffer]",z="[object DataView]",N="[object Float32Array]",ue="[object Float64Array]",Oe="[object Int8Array]",Be="[object Int16Array]",Ne="[object Int32Array]",ze="[object Uint8Array]",qa="[object Uint8ClampedArray]",fe="[object Uint16Array]",Te="[object Uint32Array]",ft=/[\\^$.*+?()[\]{}|]/g,Pt=/^\[object .+?Constructor\]$/,ii=/^(?:0|[1-9]\d*)$/,te={};te[N]=te[ue]=te[Oe]=te[Be]=te[Ne]=te[ze]=te[qa]=te[fe]=te[Te]=!0,te[a]=te[l]=te[V]=te[d]=te[z]=te[f]=te[p]=te[m]=te[y]=te[S]=te[C]=te[A]=te[$]=te[E]=te[_]=!1;var Xa=typeof _r=="object"&&_r&&_r.Object===Object&&_r,Ah=typeof self=="object"&&self&&self.Object===Object&&self,Tn=Xa||Ah||Function("return this")(),Ya=t&&!t.nodeType&&t,An=Ya&&!0&&e&&!e.nodeType&&e,Za=An&&An.exports===Ya,si=Za&&Xa.process,Qa=function(){try{var h=An&&An.require&&An.require("util").types;return h||si&&si.binding&&si.binding("util")}catch{}}(),Ja=Qa&&Qa.isTypedArray;function Rh(h,v,k){switch(k.length){case 0:return h.call(v);case 1:return h.call(v,k[0]);case 2:return h.call(v,k[0],k[1]);case 3:return h.call(v,k[0],k[1],k[2])}return h.apply(v,k)}function _h(h,v){for(var k=-1,M=Array(h);++k-1}function Zh(h,v){var k=this.__data__,M=Pr(k,h);return M<0?(++this.size,k.push([h,v])):k[M][1]=v,this}ht.prototype.clear=Kh,ht.prototype.delete=qh,ht.prototype.get=Xh,ht.prototype.has=Yh,ht.prototype.set=Zh;function Zt(h){var v=-1,k=h==null?0:h.length;for(this.clear();++v1?k[O-1]:void 0,re=O>2?k[2]:void 0;for(Z=h.length>3&&typeof Z=="function"?(O--,Z):void 0,re&&Tp(k[0],k[1],re)&&(Z=O<3?void 0:Z,O=1),v=Object(v);++M-1&&h%1==0&&h0){if(++v>=o)return arguments[0]}else v=0;return h.apply(void 0,arguments)}}function Bp(h){if(h!=null){try{return wr.call(h)}catch{}try{return h+""}catch{}}return""}function Rr(h,v){return h===v||h!==h&&v!==v}var fi=ll(function(){return arguments}())?ll:function(h){return _n(h)&&Tt.call(h,"callee")&&!Dh.call(h,"callee")},hi=Array.isArray;function pi(h){return h!=null&&hl(h.length)&&!mi(h)}function zp(h){return _n(h)&&pi(h)}var fl=Fh||Lp;function mi(h){if(!Dt(h))return!1;var v=Tr(h);return v==m||v==b||v==c||v==T}function hl(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=s}function Dt(h){var v=typeof h;return h!=null&&(v=="object"||v=="function")}function _n(h){return h!=null&&typeof h=="object"}function Ip(h){if(!_n(h)||Tr(h)!=C)return!1;var v=ol(h);if(v===null)return!0;var k=Tt.call(v,"constructor")&&v.constructor;return typeof k=="function"&&k instanceof k&&wr.call(k)==zh}var pl=Ja?Eh(Ja):fp;function Dp(h){return Sp(h,ml(h))}function ml(h){return pi(h)?lp(h):hp(h)}var Vp=wp(function(h,v,k,M){cl(h,v,k,M)});function Fp(h){return function(){return h}}function gl(h){return h}function Lp(){return!1}e.exports=Vp})(yo,yo.exports);var rm=yo.exports;const at=wd(rm);function om(e,t=[]){const n=g.useRef(e);return g.useEffect(()=>{n.current=e}),g.useCallback((...r)=>n.current?.(...r),t)}const rs=globalThis?.document?g.useLayoutEffect:g.useEffect,Cl=(e,t)=>{const n=g.useRef(!1),r=g.useRef(!1);g.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),g.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function im(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function os(...e){return t=>{e.forEach(n=>{im(n,t)})}}function sm(...e){return g.useMemo(()=>os(...e),e)}function am(e,t){const n=om(e);g.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}const he={open:(e,t)=>`${e}[data-open], ${e}[open], ${e}[data-state=open] ${t}`,closed:(e,t)=>`${e}[data-closed], ${e}[data-state=closed] ${t}`,hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Ze=e=>Rd(t=>e(t,"&"),"[role=group]","[data-group]",".group"),pt=e=>Rd(t=>e(t,"~ &"),"[data-peer]",".peer"),Rd=(e,...t)=>t.map(e).join(", "),zo={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Ze(he.open),_groupClosed:Ze(he.closed),_groupHover:Ze(he.hover),_peerHover:pt(he.hover),_groupFocus:Ze(he.focus),_peerFocus:pt(he.focus),_groupFocusVisible:Ze(he.focusVisible),_peerFocusVisible:pt(he.focusVisible),_groupActive:Ze(he.active),_peerActive:pt(he.active),_groupDisabled:Ze(he.disabled),_peerDisabled:pt(he.disabled),_groupInvalid:Ze(he.invalid),_peerInvalid:pt(he.invalid),_groupChecked:Ze(he.checked),_peerChecked:pt(he.checked),_groupFocusWithin:Ze(he.focusWithin),_peerFocusWithin:pt(he.focusWithin),_peerPlaceholderShown:pt(he.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"},_d=Object.keys(zo),lm=e=>/!(important)?$/.test(e),Pl=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,cm=(e,t)=>n=>{const r=String(t),o=lm(r),i=Pl(r),s=e?`${e}.${i}`:i;let a=Fe(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return a=Pl(a),o?`${a} !important`:a};function Ks(e){const{scale:t,transform:n,compose:r}=e;return(i,s)=>{const a=cm(t,i)(s);let l=n?.(a,s)??a;return r&&(l=r(l,s)),l}}const Er=(...e)=>t=>e.reduce((n,r)=>r(n),t);function Ie(e,t){return n=>{const r={property:n,scale:e};return r.transform=Ks({scale:e,transform:t}),r}}const dm=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function um(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:dm(t),transform:n?Ks({scale:n,compose:r}):r}}const Ed=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function fm(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Ed].join(" ")}function hm(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Ed].join(" ")}const pm={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},mm={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function gm(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const ym={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},is={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},bm=new Set(Object.values(is)),ss=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),xm=e=>e.trim();function vm(e,t){if(e==null||ss.has(e))return e;if(!(as(e)||ss.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o?.[1],s=o?.[2];if(!i||!s)return e;const a=i.includes("-gradient")?i:`${i}-gradient`,[l,...c]=s.split(",").map(xm).filter(Boolean);if(c?.length===0)return e;const d=l in is?is[l]:l;c.unshift(d);const f=c.map(p=>{if(bm.has(p))return p;const m=p.indexOf(" "),[b,y]=m!==-1?[p.substr(0,m),p.substr(m+1)]:[p],S=as(y)?y:y&&y.split(" "),w=`colors.${b}`,C=w in t.__cssMap?t.__cssMap[w].varRef:b;return S?[C,...Array.isArray(S)?S:[S]].join(" "):C});return`${a}(${f.join(", ")})`}const as=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Sm=(e,t)=>vm(e,t??{});function wm(e){return/^var\(--.+\)$/.test(e)}const km=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Qe=e=>t=>`${e}(${t})`,L={filter(e){return e!=="auto"?e:pm},backdropFilter(e){return e!=="auto"?e:mm},ring(e){return gm(L.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?fm():e==="auto-gpu"?hm():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=km(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(wm(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Sm,blur:Qe("blur"),opacity:Qe("opacity"),brightness:Qe("brightness"),contrast:Qe("contrast"),dropShadow:Qe("drop-shadow"),grayscale:Qe("grayscale"),hueRotate:e=>Qe("hue-rotate")(L.degree(e)),invert:Qe("invert"),saturate:Qe("saturate"),sepia:Qe("sepia"),bgImage(e){return e==null||as(e)||ss.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=ym[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},x={borderWidths:Ie("borderWidths"),borderStyles:Ie("borderStyles"),colors:Ie("colors"),borders:Ie("borders"),gradients:Ie("gradients",L.gradient),radii:Ie("radii",L.px),space:Ie("space",Er(L.vh,L.px)),spaceT:Ie("space",Er(L.vh,L.px)),degreeT(e){return{property:e,transform:L.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Ks({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:Ie("sizes",Er(L.vh,L.px)),sizesT:Ie("sizes",Er(L.vh,L.fraction)),shadows:Ie("shadows"),logical:um,blur:Ie("blur",L.blur)},qr={background:x.colors("background"),backgroundColor:x.colors("backgroundColor"),backgroundImage:x.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:L.bgClip},bgSize:x.prop("backgroundSize"),bgPosition:x.prop("backgroundPosition"),bg:x.colors("background"),bgColor:x.colors("backgroundColor"),bgPos:x.prop("backgroundPosition"),bgRepeat:x.prop("backgroundRepeat"),bgAttachment:x.prop("backgroundAttachment"),bgGradient:x.gradients("backgroundImage"),bgClip:{transform:L.bgClip}};Object.assign(qr,{bgImage:qr.backgroundImage,bgImg:qr.backgroundImage});const H={border:x.borders("border"),borderWidth:x.borderWidths("borderWidth"),borderStyle:x.borderStyles("borderStyle"),borderColor:x.colors("borderColor"),borderRadius:x.radii("borderRadius"),borderTop:x.borders("borderTop"),borderBlockStart:x.borders("borderBlockStart"),borderTopLeftRadius:x.radii("borderTopLeftRadius"),borderStartStartRadius:x.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:x.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:x.radii("borderTopRightRadius"),borderStartEndRadius:x.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:x.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:x.borders("borderRight"),borderInlineEnd:x.borders("borderInlineEnd"),borderBottom:x.borders("borderBottom"),borderBlockEnd:x.borders("borderBlockEnd"),borderBottomLeftRadius:x.radii("borderBottomLeftRadius"),borderBottomRightRadius:x.radii("borderBottomRightRadius"),borderLeft:x.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:x.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:x.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:x.borders(["borderLeft","borderRight"]),borderInline:x.borders("borderInline"),borderY:x.borders(["borderTop","borderBottom"]),borderBlock:x.borders("borderBlock"),borderTopWidth:x.borderWidths("borderTopWidth"),borderBlockStartWidth:x.borderWidths("borderBlockStartWidth"),borderTopColor:x.colors("borderTopColor"),borderBlockStartColor:x.colors("borderBlockStartColor"),borderTopStyle:x.borderStyles("borderTopStyle"),borderBlockStartStyle:x.borderStyles("borderBlockStartStyle"),borderBottomWidth:x.borderWidths("borderBottomWidth"),borderBlockEndWidth:x.borderWidths("borderBlockEndWidth"),borderBottomColor:x.colors("borderBottomColor"),borderBlockEndColor:x.colors("borderBlockEndColor"),borderBottomStyle:x.borderStyles("borderBottomStyle"),borderBlockEndStyle:x.borderStyles("borderBlockEndStyle"),borderLeftWidth:x.borderWidths("borderLeftWidth"),borderInlineStartWidth:x.borderWidths("borderInlineStartWidth"),borderLeftColor:x.colors("borderLeftColor"),borderInlineStartColor:x.colors("borderInlineStartColor"),borderLeftStyle:x.borderStyles("borderLeftStyle"),borderInlineStartStyle:x.borderStyles("borderInlineStartStyle"),borderRightWidth:x.borderWidths("borderRightWidth"),borderInlineEndWidth:x.borderWidths("borderInlineEndWidth"),borderRightColor:x.colors("borderRightColor"),borderInlineEndColor:x.colors("borderInlineEndColor"),borderRightStyle:x.borderStyles("borderRightStyle"),borderInlineEndStyle:x.borderStyles("borderInlineEndStyle"),borderTopRadius:x.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:x.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:x.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:x.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(H,{rounded:H.borderRadius,roundedTop:H.borderTopRadius,roundedTopLeft:H.borderTopLeftRadius,roundedTopRight:H.borderTopRightRadius,roundedTopStart:H.borderStartStartRadius,roundedTopEnd:H.borderStartEndRadius,roundedBottom:H.borderBottomRadius,roundedBottomLeft:H.borderBottomLeftRadius,roundedBottomRight:H.borderBottomRightRadius,roundedBottomStart:H.borderEndStartRadius,roundedBottomEnd:H.borderEndEndRadius,roundedLeft:H.borderLeftRadius,roundedRight:H.borderRightRadius,roundedStart:H.borderInlineStartRadius,roundedEnd:H.borderInlineEndRadius,borderStart:H.borderInlineStart,borderEnd:H.borderInlineEnd,borderTopStartRadius:H.borderStartStartRadius,borderTopEndRadius:H.borderStartEndRadius,borderBottomStartRadius:H.borderEndStartRadius,borderBottomEndRadius:H.borderEndEndRadius,borderStartRadius:H.borderInlineStartRadius,borderEndRadius:H.borderInlineEndRadius,borderStartWidth:H.borderInlineStartWidth,borderEndWidth:H.borderInlineEndWidth,borderStartColor:H.borderInlineStartColor,borderEndColor:H.borderInlineEndColor,borderStartStyle:H.borderInlineStartStyle,borderEndStyle:H.borderInlineEndStyle});const Cm={color:x.colors("color"),textColor:x.colors("color"),fill:x.colors("fill"),stroke:x.colors("stroke"),accentColor:x.colors("accentColor"),textFillColor:x.colors("textFillColor")},bo={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:L.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:x.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:x.space("gap"),rowGap:x.space("rowGap"),columnGap:x.space("columnGap")};Object.assign(bo,{flexDir:bo.flexDirection});const De={width:x.sizesT("width"),inlineSize:x.sizesT("inlineSize"),height:x.sizes("height"),blockSize:x.sizes("blockSize"),boxSize:x.sizes(["width","height"]),minWidth:x.sizes("minWidth"),minInlineSize:x.sizes("minInlineSize"),minHeight:x.sizes("minHeight"),minBlockSize:x.sizes("minBlockSize"),maxWidth:x.sizes("maxWidth"),maxInlineSize:x.sizes("maxInlineSize"),maxHeight:x.sizes("maxHeight"),maxBlockSize:x.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>({[`@media screen and (min-width: ${t.__breakpoints?.get(e)?.minW??e})`]:{display:"none"}})},hideBelow:{scale:"breakpoints",transform:(e,t)=>({[`@media screen and (max-width: ${t.__breakpoints?.get(e)?._minW??e})`]:{display:"none"}})},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:x.propT("float",L.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(De,{w:De.width,h:De.height,minW:De.minWidth,maxW:De.maxWidth,minH:De.minHeight,maxH:De.maxHeight,overscroll:De.overscrollBehavior,overscrollX:De.overscrollBehaviorX,overscrollY:De.overscrollBehaviorY});const Pm={filter:{transform:L.filter},blur:x.blur("--chakra-blur"),brightness:x.propT("--chakra-brightness",L.brightness),contrast:x.propT("--chakra-contrast",L.contrast),hueRotate:x.propT("--chakra-hue-rotate",L.hueRotate),invert:x.propT("--chakra-invert",L.invert),saturate:x.propT("--chakra-saturate",L.saturate),dropShadow:x.propT("--chakra-drop-shadow",L.dropShadow),backdropFilter:{transform:L.backdropFilter},backdropBlur:x.blur("--chakra-backdrop-blur"),backdropBrightness:x.propT("--chakra-backdrop-brightness",L.brightness),backdropContrast:x.propT("--chakra-backdrop-contrast",L.contrast),backdropHueRotate:x.propT("--chakra-backdrop-hue-rotate",L.hueRotate),backdropInvert:x.propT("--chakra-backdrop-invert",L.invert),backdropSaturate:x.propT("--chakra-backdrop-saturate",L.saturate)},Tm={ring:{transform:L.ring},ringColor:x.colors("--chakra-ring-color"),ringOffset:x.prop("--chakra-ring-offset-width"),ringOffsetColor:x.colors("--chakra-ring-offset-color"),ringInset:x.prop("--chakra-ring-inset")},Am={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:L.outline},outlineOffset:!0,outlineColor:x.colors("outlineColor")},$d={gridGap:x.space("gridGap"),gridColumnGap:x.space("gridColumnGap"),gridRowGap:x.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function Rm(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const a=t.get(r);if(a.has(o))return a.get(o);const l=e(r,o,i,s);return a.set(o,l),l}},Em=_m(Rm),$m={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},jm={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},xi=(e,t,n)=>{const r={},o=Em(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},Mm={srOnly:{transform(e){return e===!0?$m:e==="focusable"?jm:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>xi(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>xi(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>xi(t,e,n)}},Hn={position:!0,pos:x.prop("position"),zIndex:x.prop("zIndex","zIndices"),inset:x.spaceT("inset"),insetX:x.spaceT(["left","right"]),insetInline:x.spaceT("insetInline"),insetY:x.spaceT(["top","bottom"]),insetBlock:x.spaceT("insetBlock"),top:x.spaceT("top"),insetBlockStart:x.spaceT("insetBlockStart"),bottom:x.spaceT("bottom"),insetBlockEnd:x.spaceT("insetBlockEnd"),left:x.spaceT("left"),insetInlineStart:x.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:x.spaceT("right"),insetInlineEnd:x.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Hn,{insetStart:Hn.insetInlineStart,insetEnd:Hn.insetInlineEnd});const ls={boxShadow:x.shadows("boxShadow"),mixBlendMode:!0,blendMode:x.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:x.prop("backgroundBlendMode"),opacity:!0};Object.assign(ls,{shadow:ls.boxShadow});const ne={margin:x.spaceT("margin"),marginTop:x.spaceT("marginTop"),marginBlockStart:x.spaceT("marginBlockStart"),marginRight:x.spaceT("marginRight"),marginInlineEnd:x.spaceT("marginInlineEnd"),marginBottom:x.spaceT("marginBottom"),marginBlockEnd:x.spaceT("marginBlockEnd"),marginLeft:x.spaceT("marginLeft"),marginInlineStart:x.spaceT("marginInlineStart"),marginX:x.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:x.spaceT("marginInline"),marginY:x.spaceT(["marginTop","marginBottom"]),marginBlock:x.spaceT("marginBlock"),padding:x.space("padding"),paddingTop:x.space("paddingTop"),paddingBlockStart:x.space("paddingBlockStart"),paddingRight:x.space("paddingRight"),paddingBottom:x.space("paddingBottom"),paddingBlockEnd:x.space("paddingBlockEnd"),paddingLeft:x.space("paddingLeft"),paddingInlineStart:x.space("paddingInlineStart"),paddingInlineEnd:x.space("paddingInlineEnd"),paddingX:x.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:x.space("paddingInline"),paddingY:x.space(["paddingTop","paddingBottom"]),paddingBlock:x.space("paddingBlock")};Object.assign(ne,{m:ne.margin,mt:ne.marginTop,mr:ne.marginRight,me:ne.marginInlineEnd,marginEnd:ne.marginInlineEnd,mb:ne.marginBottom,ml:ne.marginLeft,ms:ne.marginInlineStart,marginStart:ne.marginInlineStart,mx:ne.marginX,my:ne.marginY,p:ne.padding,pt:ne.paddingTop,py:ne.paddingY,px:ne.paddingX,pb:ne.paddingBottom,pl:ne.paddingLeft,ps:ne.paddingInlineStart,paddingStart:ne.paddingInlineStart,pr:ne.paddingRight,pe:ne.paddingInlineEnd,paddingEnd:ne.paddingInlineEnd});const Bm={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:x.spaceT("scrollMargin"),scrollMarginTop:x.spaceT("scrollMarginTop"),scrollMarginBottom:x.spaceT("scrollMarginBottom"),scrollMarginLeft:x.spaceT("scrollMarginLeft"),scrollMarginRight:x.spaceT("scrollMarginRight"),scrollMarginX:x.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:x.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:x.spaceT("scrollPadding"),scrollPaddingTop:x.spaceT("scrollPaddingTop"),scrollPaddingBottom:x.spaceT("scrollPaddingBottom"),scrollPaddingLeft:x.spaceT("scrollPaddingLeft"),scrollPaddingRight:x.spaceT("scrollPaddingRight"),scrollPaddingX:x.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:x.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},zm={fontFamily:x.prop("fontFamily","fonts"),fontSize:x.prop("fontSize","fontSizes",L.px),fontWeight:x.prop("fontWeight","fontWeights"),lineHeight:x.prop("lineHeight","lineHeights"),letterSpacing:x.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Im={textDecorationColor:x.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:x.shadows("textShadow")},Dm={clipPath:!0,transform:x.propT("transform",L.transform),transformOrigin:!0,translateX:x.spaceT("--chakra-translate-x"),translateY:x.spaceT("--chakra-translate-y"),skewX:x.degreeT("--chakra-skew-x"),skewY:x.degreeT("--chakra-skew-y"),scaleX:x.prop("--chakra-scale-x"),scaleY:x.prop("--chakra-scale-y"),scale:x.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:x.degreeT("--chakra-rotate")},Vm={listStyleType:!0,listStylePosition:!0,listStylePos:x.prop("listStylePosition"),listStyleImage:!0,listStyleImg:x.prop("listStyleImage")},Fm={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:x.prop("transitionDuration","transition.duration"),transitionProperty:x.prop("transitionProperty","transition.property"),transitionTimingFunction:x.prop("transitionTimingFunction","transition.easing")},qs=at({},qr,H,Cm,bo,De,Pm,Tm,Am,$d,Mm,Hn,ls,ne,Bm,zm,Im,Dm,Vm,Fm);Object.assign({},ne,De,bo,$d,Hn);const Lm=[...Object.keys(qs),..._d],Om={...qs,...zo},Nm=e=>e in Om,Wm=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const s in e){let a=st(e[s],t);if(a==null)continue;if(a=Fe(a)&&n(a)?r(a):a,!Array.isArray(a)){i[s]=a;continue}const l=a.slice(0,o.length).length;for(let c=0;ce.startsWith("--")&&typeof t=="string"&&!Um(t),Km=(e,t)=>{if(t==null)return t;const n=s=>e.__cssMap?.[s]?.varRef,r=s=>n(s)??s,[o,i]=Hm(t);return t=n(o)??r(i)??r(t),t};function qm(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,s=!1)=>{const a=st(i,r),l=Wm(a)(r);let c={};for(let d in l){const f=l[d];let p=st(f,r);d in n&&(d=n[d]),Gm(d,p)&&(p=Km(r,p));let m=t[d];if(m===!0&&(m={property:d}),Fe(p)){c[d]=c[d]??{},c[d]=at({},c[d],o(p,!0));continue}let b=m?.transform?.(p,r,a)??p;b=m?.processResult?o(b,!0):b;const y=st(m?.property,r);if(!s&&m?.static){const S=st(m.static,r);c=at({},c,S)}if(y&&Array.isArray(y)){for(const S of y)c[S]=b;continue}if(y){y==="&"&&Fe(b)?c=at({},c,b):c[y]=b;continue}if(Fe(b)){c=at({},c,b);continue}c[d]=b}return c};return o}const jd=e=>t=>qm({theme:t,pseudos:zo,configs:qs})(e);function ee(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function Xm(e,t){if(Array.isArray(e))return e;if(Fe(e))return t(e);if(e!=null)return[e]}function Ym(e,t){for(let n=t+1;n{at(a,{[w]:d?S[w]:{[y]:S[w]}})});continue}if(!f){d?at(a,S):a[y]=S;continue}a[y]=S}}return a}}function Qm(e){return t=>{const{variant:n,size:r,theme:o}=t,i=Zm(o);return at({},st(e.baseStyle??{},t),i(e,"sizes",r,t),i(e,"variants",n,t))}}function Ye(e){return Jp(e,["styleConfig","size","variant","colorScheme"])}function Md(e){return Fe(e)&&e.reference?e.reference:String(e)}const Io=(e,...t)=>t.map(Md).join(` ${e} `).replace(/calc/g,""),Tl=(...e)=>`calc(${Io("+",...e)})`,Al=(...e)=>`calc(${Io("-",...e)})`,cs=(...e)=>`calc(${Io("*",...e)})`,Rl=(...e)=>`calc(${Io("/",...e)})`,_l=e=>{const t=Md(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:cs(t,-1)},gt=Object.assign(e=>({add:(...t)=>gt(Tl(e,...t)),subtract:(...t)=>gt(Al(e,...t)),multiply:(...t)=>gt(cs(e,...t)),divide:(...t)=>gt(Rl(e,...t)),negate:()=>gt(_l(e)),toString:()=>e.toString()}),{add:Tl,subtract:Al,multiply:cs,divide:Rl,negate:_l});function Jm(e,t="-"){return e.replace(/\s+/g,t)}function eg(e){const t=Jm(e.toString());return ng(tg(t))}function tg(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function ng(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function rg(e,t=""){return[t,e].filter(Boolean).join("-")}function og(e,t){return`var(${e}${t?`, ${t}`:""})`}function ig(e,t=""){return eg(`--${rg(e,t)}`)}function D(e,t,n){const r=ig(e,n);return{variable:r,reference:og(r,t)}}function sg(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[o,i]=r;n[o]=D(`${e}-${o}`,i);continue}n[r]=D(`${e}-${r}`)}return n}const ag=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function lg(e){return em(e,ag)}function cg(e){return e.semanticTokens}function dg(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...o}=e;return o}function ug(e){const t=lg(e),n=cg(e),r=i=>_d.includes(i)||i==="default",o={};return kl(t,(i,s)=>{i!=null&&(o[s.join(".")]={isSemantic:!1,value:i})}),kl(n,(i,s)=>{i!=null&&(o[s.join(".")]={isSemantic:!0,value:i})},{stop:i=>Object.keys(i).every(r)}),o}function El(e,t){return D(String(e).replace(/\./g,"-"),void 0,t)}function fg(e){const t=ug(e),n=e.config?.cssVarPrefix;let r={};const o={};function i(s,a){const c=[String(s).split(".")[0],a].join(".");if(!t[c])return a;const{reference:f}=El(c,n);return f}for(const[s,a]of Object.entries(t)){const{isSemantic:l,value:c}=a,{variable:d,reference:f}=El(s,n);if(!l){if(s.startsWith("space")){const m=s.split("."),[b,...y]=m,S=`${b}.-${y.join(".")}`,w=gt.negate(c),C=gt.negate(f);o[S]={value:w,var:d,varRef:C}}r[d]=c,o[s]={value:c,var:d,varRef:f};continue}const p=Fe(c)?c:{default:c};r=at(r,Object.entries(p).reduce((m,[b,y])=>{if(!y)return m;const S=i(s,`${y}`);if(b==="default")return m[d]=S,m;const w=zo?.[b]??b;return m[w]={[d]:S},m},{})),o[s]={value:f,var:d,varRef:f}}return{cssVars:r,cssMap:o}}function hg(e){const t=dg(e),{cssMap:n,cssVars:r}=fg(t);return Object.assign(t,{__cssVars:{...{"--chakra-ring-inset":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-ring-offset-width":"0px","--chakra-ring-offset-color":"#fff","--chakra-ring-color":"rgba(66, 153, 225, 0.6)","--chakra-ring-offset-shadow":"0 0 #0000","--chakra-ring-shadow":"0 0 #0000","--chakra-space-x-reverse":"0","--chakra-space-y-reverse":"0"},...r},__cssMap:n,__breakpoints:Kp(t.breakpoints)}),t}function q(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function o(...d){r();for(const f of d)t[f]=l(f);return q(e,t)}function i(...d){for(const f of d)f in t||(t[f]=l(f));return q(e,t)}function s(){return Object.fromEntries(Object.entries(t).map(([f,p])=>[f,p.selector]))}function a(){return Object.fromEntries(Object.entries(t).map(([f,p])=>[f,p.className]))}function l(d){const m=`chakra-${(["container","root"].includes(d??"")?[e]:[e,d]).filter(Boolean).join("__")}`;return{className:m,selector:`.${m}`,toString:()=>d}}return{parts:o,toPart:l,extend:i,selectors:s,classnames:a,get keys(){return Object.keys(t)},__type:{}}}const pg=q("accordion").parts("root","container","button","panel","icon"),mg=q("alert").parts("title","description","container","icon","spinner"),gg=q("avatar").parts("label","badge","container","excessLabel","group"),yg=q("breadcrumb").parts("link","item","container","separator");q("button").parts();const bg=q("checkbox").parts("control","icon","container","label");q("progress").parts("track","filledTrack","label");const xg=q("drawer").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),vg=q("editable").parts("preview","input","textarea"),Sg=q("form").parts("container","requiredIndicator","helperText"),wg=q("formError").parts("text","icon"),kg=q("input").parts("addon","field","element","group"),Cg=q("list").parts("container","item","icon"),Pg=q("menu").parts("button","list","item","groupTitle","icon","command","divider"),Tg=q("modal").parts("overlay","dialogContainer","dialog","header","closeButton","body","footer"),Ag=q("numberinput").parts("root","field","stepperGroup","stepper");q("pininput").parts("field");const Rg=q("popover").parts("content","header","body","footer","popper","arrow","closeButton"),_g=q("progress").parts("label","filledTrack","track"),Eg=q("radio").parts("container","control","label"),$g=q("select").parts("field","icon"),jg=q("slider").parts("container","track","thumb","filledTrack","mark"),Mg=q("stat").parts("container","label","helpText","number","icon"),Bg=q("switch").parts("container","track","thumb","label"),zg=q("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),Ig=q("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),Dg=q("tag").parts("container","label","closeButton"),Vg=q("card").parts("container","header","body","footer");q("stepper").parts("stepper","step","title","description","indicator","separator","icon","number");const{definePartsStyle:Fg,defineMultiStyleConfig:Lg}=ee(pg.keys),Og={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},Ng={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},Wg={pt:"2",px:"4",pb:"5"},Hg={fontSize:"1.25em"},Ug=Fg({container:Og,button:Ng,panel:Wg,icon:Hg}),Gg=Lg({baseStyle:Ug});function Ot(e,t,n){return Math.min(Math.max(e,n),t)}class Kg extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Vn=Kg;function Xs(e){if(typeof e!="string")throw new Vn(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=ty.test(e)?Yg(e):e;const n=Zg.exec(t);if(n){const s=Array.from(n).slice(1);return[...s.slice(0,3).map(a=>parseInt(rr(a,2),16)),parseInt(rr(s[3]||"f",2),16)/255]}const r=Qg.exec(t);if(r){const s=Array.from(r).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,16)),parseInt(s[3]||"ff",16)/255]}const o=Jg.exec(t);if(o){const s=Array.from(o).slice(1);return[...s.slice(0,3).map(a=>parseInt(a,10)),parseFloat(s[3]||"1")]}const i=ey.exec(t);if(i){const[s,a,l,c]=Array.from(i).slice(1).map(parseFloat);if(Ot(0,100,a)!==a)throw new Vn(e);if(Ot(0,100,l)!==l)throw new Vn(e);return[...ny(s,a,l),Number.isNaN(c)?1:c]}throw new Vn(e)}function qg(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const $l=e=>parseInt(e.replace(/_/g,""),36),Xg="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=$l(t.substring(0,3)),r=$l(t.substring(3)).toString(16);let o="";for(let i=0;i<6-r.length;i++)o+="0";return e[n]=`${o}${r}`,e},{});function Yg(e){const t=e.toLowerCase().trim(),n=Xg[qg(t)];if(!n)throw new Vn(e);return`#${n}`}const rr=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),Zg=new RegExp(`^#${rr("([a-f0-9])",3)}([a-f0-9])?$`,"i"),Qg=new RegExp(`^#${rr("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),Jg=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${rr(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),ey=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,ty=/^[a-z]+$/i,jl=e=>Math.round(e*255),ny=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(jl);const o=(e%360+360)%360/60,i=(1-Math.abs(2*r-1))*(t/100),s=i*(1-Math.abs(o%2-1));let a=0,l=0,c=0;o>=0&&o<1?(a=i,l=s):o>=1&&o<2?(a=s,l=i):o>=2&&o<3?(l=i,c=s):o>=3&&o<4?(l=s,c=i):o>=4&&o<5?(a=s,c=i):o>=5&&o<6&&(a=i,c=s);const d=r-i/2,f=a+d,p=l+d,m=c+d;return[f,p,m].map(jl)};function ry(e,t,n,r){return`rgba(${Ot(0,255,e).toFixed()}, ${Ot(0,255,t).toFixed()}, ${Ot(0,255,n).toFixed()}, ${parseFloat(Ot(0,1,r).toFixed(3))})`}function oy(e,t){const[n,r,o,i]=Xs(e);return ry(n,r,o,i-t)}function iy(e){const[t,n,r,o]=Xs(e);let i=s=>{const a=Ot(0,255,s).toString(16);return a.length===1?`0${a}`:a};return`#${i(t)}${i(n)}${i(r)}${o<1?i(Math.round(o*255)):""}`}const sy=e=>Object.keys(e).length===0;function ay(e,t,n,r,o){for(t=t.split?t.split("."):t,r=0;r{const r=ay(e,`colors.${t}`,t);try{return iy(r),r}catch{return"#000000"}},ly=e=>{const[t,n,r]=Xs(e);return(t*299+n*587+r*114)/1e3},cy=e=>t=>{const n=we(t,e);return ly(n)<128?"dark":"light"},dy=e=>t=>cy(e)(t)==="dark",gn=(e,t)=>n=>{const r=we(n,e);return oy(r,1-t)};function Ml(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient( 45deg, ${t} 25%, transparent 25%, @@ -544,6 +544,8 @@ export function Providers({ children }) { // url="https://auth.example.com" // realm="my-realm" // initOptions={{ onLoad: "login-required" }} + // اگر Chakra در همین BiProvider باشد، loading پیش‌فرض Spinner است. + // نمونه سفارشی با اولویت بالاتر: loading={Loading auth...} errorFallback={Auth failed} onError={(error) => console.error(error)} @@ -623,6 +625,8 @@ export function Providers({ children }) { getToken={() => localStorage.getItem("access_token")} // url="https://api.example.com/permissions/list" // storageKey="permissions:permission-client:my-user" + // اگر Chakra در همین BiProvider باشد، loading پیش‌فرض Spinner است. + // نمونه سفارشی با اولویت بالاتر: loading={Loading permissions...} errorFallback={Permission error} /> @@ -679,4 +683,4 @@ setCachedPermissions(storageKey, [{ name: "activity:read" }]); clearCachedPermissions(storageKey); // این توابع جایگزین authorization سمت سرور نیستند. -// در برنامه عادی، refresh() / clear() از usePermission() مناسب‌تر است.`,W2=[{title:"uikit/chakra",exports:"Chakra · defaultBiTheme",description:"کامپوننت تنظیم Chakra و theme پیش‌فرض؛ Hook مستقلی از این مسیر export نمی‌شود.",code:I2},{title:"uikit/query",exports:"Query",description:"تنظیم QueryClientProvider؛ useQuery و useMutation را از @tanstack/react-query بگیرید.",code:D2},{title:"uikit/next-pages-router",exports:"NextPagesRouter",description:"آداپتور use-query-params برای Next.js Pages Router؛ تابع یا Hook دیگری از این مسیر منتشر نشده است.",code:V2},{title:"uikit/keycloak",exports:"Keycloak · useKeycloak",description:"تمام مقادیر state و متدهای login، logout و updateToken در خروجی useKeycloak نمایش داده شده‌اند.",code:F2},{title:"uikit/api",exports:"Api · useApi · fetcher",description:"نمونه درخواست Axios، تزریق instance به service و امضای fetcher(api, url).",code:L2},{title:"uikit/permission",exports:"Permission · usePermission · Can · AdminGuard · PanelAccessGuard",description:"هوک دسترسی، guardهای عمومی، refresh و clear؛ رفتار PanelAccessGuard را با دقت بخوانید.",code:O2},{title:"uikit/permission — توابع کمکی",exports:"createPermissionSet · checkPermission · getCachedPermissions · setCachedPermissions · clearCachedPermissions",description:"توابع خالص بررسی دسترسی و خواندن/نوشتن/پاک‌کردن cache مرورگر.",code:N2}];function it({children:e}){const[t,n]=g.useState(!1),r=typeof e=="string"?e:String(e??""),o=async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(r);else{const i=document.createElement("textarea");i.value=r,i.style.position="fixed",i.style.opacity="0",document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove()}n(!0),window.setTimeout(()=>n(!1),1400)}catch(i){console.error("Copy failed:",i)}};return u.jsxs(F,{position:"relative",w:"full",children:[u.jsx(wt,{type:"button",size:"xs",position:"absolute",top:2,right:2,zIndex:1,bg:"whiteAlpha.200",color:"white",_hover:{bg:"whiteAlpha.300"},onClick:o,children:t?"کپی شد":"کپی کد"}),u.jsx(F,{as:"pre",dir:"ltr",textAlign:"left",overflowX:"auto",w:"full",p:{base:3,md:4},pt:{base:10,md:10},bg:"gray.900",color:"gray.100",borderRadius:"lg",fontSize:{base:"12px",md:"13px"},lineHeight:"1.8",whiteSpace:"pre",children:u.jsx(F,{as:"code",children:r})})]})}function In({id:e,title:t,children:n}){return u.jsxs(F,{id:e,scrollMarginTop:"18px",bg:"white",borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",overflow:"hidden",children:[u.jsx(F,{px:{base:4,md:5},py:4,borderBottomWidth:"1px",borderColor:"gray.100",children:u.jsx(B,{fontSize:{base:"md",md:"lg"},fontWeight:"700",color:"gray.800",children:t})}),u.jsx(F,{p:{base:4,md:5},children:n})]})}const kh=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("path",{d:"M4 19V9"}),u.jsx("path",{d:"M10 19V5"}),u.jsx("path",{d:"M16 19v-7"}),u.jsx("path",{d:"M22 19H2"})]}),Ch=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),u.jsx("circle",{cx:"9",cy:"7",r:"4"}),u.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),u.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),Ph=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("circle",{cx:"11",cy:"11",r:"8"}),u.jsx("path",{d:"m21 21-4.35-4.35"})]}),Th=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]});function H2(){const[e,t]=g.useState(!0),[n,r]=g.useState("در حال بررسی تصویر..."),o=g.useRef(null);return g.useEffect(()=>{const i=()=>{const a=o.current?.querySelector("uikit-app-header")?.shadowRoot?.querySelector("img.logo");if(!a?.src||!a.complete){r("در حال بارگذاری تصویر...");return}if(!a.naturalWidth){r("خطا در بارگذاری لوگو؛ آدرس فایل PNG اصلی را بررسی کنید.");return}const l=`${Math.round(a.getBoundingClientRect().width)}×${Math.round(a.getBoundingClientRect().height)}px`,c=a.src.startsWith("https://img.d.aiengines.ir/")&&a.src.endsWith("@webp");r(c?`WebP بهینه‌شده از سرویس تصاویر | ابعاد نمایش: ${l}`:e?`تصویر اصلی PNG (Fallback) | ابعاد نمایش: ${l}`:`تصویر اصلی PNG | ابعاد نمایش: ${l}`)};i();const s=window.setInterval(i,350);return()=>window.clearInterval(s)},[e]),u.jsxs(Xe,{spacing:5,children:[u.jsxs(B,{color:"gray.600",fontSize:"sm",children:["ظاهر Header داخل remote ایزوله است؛ فونت از سامانه مقصد می‌آید. رنگ پس‌زمینه با",u.jsx(P,{mx:1,children:"bg"}),"اختیاری قابل تغییر است. ",u.jsx(P,{children:"AppHeader.Extra"})," و ",u.jsx(P,{children:"AppHeader.Bi"})," نیز مستقل و اختیاری‌اند."]}),u.jsx(it,{children:A2}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"نمونه نمایش لوگوی ۱۲۵۴×۱۲۵۴ PNG"}),u.jsx(F,{ref:o,overflow:"auto",borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",children:u.jsxs(_t,{bg:"#314E89",children:[u.jsxs(_t.BrandSection,{children:[u.jsx(_t.Logo,{src:"/logo.png",alt:"نشان نمونه سامانه",optimize:e}),u.jsxs(_t.Brand,{children:[u.jsx(_t.Title,{children:"عنوان سامانه"}),u.jsx(_t.Description,{children:"توضیحات سامانه"})]})]}),u.jsx(_t.Extra,{src:P2,alt:"نشان تکمیلی",text:"متن تکمیلی"}),u.jsx(_t.Bi,{src:T2})]})}),u.jsxs(tr,{mt:3,gap:3,align:"center",justify:"space-between",wrap:"wrap",children:[u.jsx(B,{color:"gray.600",fontSize:"xs",children:n}),u.jsx(wt,{size:"xs",variant:"outline",onClick:()=>t(i=>!i),children:e?"نمایش PNG اصلی":"نمایش WebP بهینه‌شده"})]}),u.jsx(B,{mt:2,color:"gray.500",fontSize:"xs",children:"در اجرای لوکال، لوگو از پوشه public بارگذاری می‌شود. سرویس تصاویر معمولاً به localhost دسترسی ندارد؛ در این حالت PNG اصلی به‌صورت Fallback نمایش داده می‌شود."})]}),u.jsxs(F,{fontSize:"sm",color:"gray.600",children:[u.jsxs(B,{children:["• ترتیب انتهای Header: ",u.jsx(P,{children:"Extra"})," سپس ",u.jsx(P,{children:"Bi"}),"."]}),u.jsxs(B,{mt:1,children:["• هرکدام از ",u.jsx(P,{children:"Extra"})," یا ",u.jsx(P,{children:"Bi"})," را می‌توان حذف کرد."]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"Extra"})," لوگو و متن دلخواه می‌گیرد؛ اگر ",u.jsx(P,{children:"text"})," ندهی، فقط لوگو نمایش داده می‌شود و تمام ارتفاع Extra را می‌گیرد."]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"font-family"})," عمداً از Host به ارث می‌رسد."]})]})]})}function U2({allowFixedPreview:e=!0}){const[t,n]=g.useState("analysis"),[r,o]=g.useState("—"),i=g.useMemo(()=>[{id:"analysis",title:"آنالیز",mobileTitle:"آنالیز",icon:kh,active:t==="analysis",onClick:()=>{n("analysis"),o("آنالیز")}},{id:"users",title:"کاربران",mobileTitle:"کاربران",icon:Ch,active:t==="users",onClick:()=>{n("users"),o("کاربران")}},{id:"search",title:"جستجو",mobileTitle:"جستجو",icon:Ph,active:t==="search",onClick:()=>{n("search"),o("جستجو")}},{id:"restricted",title:"بخش محدود",mobileTitle:"محدود",icon:Th,disabled:!0}],[t]);return u.jsxs(Xe,{spacing:5,children:[u.jsx(B,{color:"gray.600",fontSize:"sm",children:"UI داخل remote می‌ماند؛ route، permission، active state و logout در خود سامانه مقصد تعیین می‌شوند."}),u.jsx(it,{children:R2}),u.jsxs(F,{fontSize:"sm",color:"gray.600",children:[u.jsxs(B,{children:["• برای مخفی‌کردن آیتم از ",u.jsx(P,{children:"hidden: true"})," یا filter در Host استفاده کن."]}),u.jsxs(B,{mt:1,children:["• برای حالت غیرقابل کلیک از ",u.jsx(P,{children:"disabled: true"})," استفاده کن."]}),u.jsx(B,{mt:1,children:"• تا ۴ آیتم در موبایل، خروج مستقیم آخر Bottom Navigation قرار می‌گیرد."}),u.jsx(B,{mt:1,children:"• بیشتر از ۴ آیتم: چهار آیتم اول مستقیم، بقیه + خروج داخل «بیشتر» می‌روند."})]}),u.jsxs(F,{p:3,bg:"gray.50",borderRadius:"md",fontSize:"sm",children:["آخرین callback: ",u.jsx(P,{children:r})]}),u.jsx(F,{display:{base:"block",lg:"none"},color:"gray.500",fontSize:"xs",children:"در موبایل نمونه AppSidebar به شکل Bottom Navigation پایین صفحه نمایش داده می‌شود."}),e?u.jsx(F,{display:{base:"block",lg:"none"},children:u.jsx(Kr,{items:i,ariaLabel:"نمونه AppSidebar",children:u.jsx(Kr.Exit,{onClick:()=>o("خروج")})})}):null,u.jsx(F,{display:{base:"none",lg:"block"},position:"relative",h:"360px",overflow:"hidden",borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",children:u.jsx(Kr,{items:i,ariaLabel:"نمونه AppSidebar",children:u.jsx(Kr.Exit,{onClick:()=>o("خروج")})})})]})}function G2(){const[e,t]=g.useState({full:3,compact:3,simple:3,minimal:3}),[n,r]=g.useState(!0),[o,i]=g.useState(3),[s,a]=g.useState(!1),l=g.useRef(null),c=g.useRef(null);g.useEffect(()=>(l.current=window.setTimeout(()=>r(!1),1800),()=>{l.current&&window.clearTimeout(l.current),c.current&&window.clearTimeout(c.current)}),[]);const d=(y,S)=>t(w=>({...w,[y]:S})),f=()=>{l.current&&window.clearTimeout(l.current),r(!0),l.current=window.setTimeout(()=>r(!1),1800)},p=y=>{s||(c.current&&window.clearTimeout(c.current),i(y),a(!0),c.current=window.setTimeout(()=>a(!1),1600))},m=(y,S={})=>u.jsxs(F,{w:"full",minW:0,children:[u.jsx(B,{mb:2,fontSize:"sm",fontWeight:"600",dir:"ltr",children:y}),u.jsx(es,{level:y,currentPage:e[y],totalPages:12,totalCount:120,pageSize:10,onPageChange:w=>d(y,w),...S})]}),b=y=>u.jsxs(Xe,{spacing:4,children:[y("full"),u.jsxs(tr,{w:"full",align:"flex-start",direction:{base:"column",lg:"row"},gap:{base:4,lg:0},children:[u.jsx(F,{w:{base:"100%",lg:"55%"},minW:0,children:y("compact")}),u.jsx(F,{w:{base:"100%",lg:"25%"},minW:0,children:y("simple")}),u.jsx(F,{w:{base:"100%",lg:"20%"},minW:0,children:y("minimal")})]})]});return u.jsxs(Xe,{spacing:6,children:[u.jsxs(B,{color:"gray.600",fontSize:"sm",children:["همه variantها API یکسان دارند. ",u.jsx(P,{children:"loading"})," اختیاری است و اگر پاس داده نشود رفتار قبلی کاملاً حفظ می‌شود."]}),u.jsx(it,{children:E2}),u.jsxs(F,{fontSize:"sm",color:"gray.600",children:[u.jsxs(B,{children:["• ",u.jsx(P,{children:"currentPage"}),": صفحه فعلی"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"totalPages"}),": تعداد کل صفحات"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"totalCount"}),": تعداد کل رکوردها"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"pageSize"}),": تعداد رکورد در هر صفحه"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"onPageChange"}),": callback تغییر صفحه"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"loading"}),": اختیاری؛ پیش‌فرض ",u.jsx(P,{children:"false"})]}),u.jsxs(B,{mt:1,children:["• levelها: ",u.jsx(P,{children:"full"}),"، ",u.jsx(P,{children:"compact"}),"، ",u.jsx(P,{children:"simple"}),"، ",u.jsx(P,{children:"minimal"})]})]}),u.jsxs(F,{children:[u.jsx(B,{mb:3,fontWeight:"700",fontSize:"sm",children:"نمونه حالت‌ها"}),b(y=>m(y))]}),u.jsxs(F,{borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",p:{base:3,md:4},bg:"gray.50",children:[u.jsxs(tr,{mb:3,gap:3,align:{base:"stretch",md:"center"},justify:"space-between",direction:{base:"column",md:"row"},children:[u.jsxs(F,{children:[u.jsx(B,{fontWeight:"700",fontSize:"sm",children:"Loading — دریافت اولیه"}),u.jsx(B,{mt:1,color:"gray.600",fontSize:"xs",children:"totalPages و totalCount هنوز وجود ندارند؛ صفحه ۱ ثابت می‌ماند و جای مقادیر نامشخص loader دیده می‌شود."})]}),u.jsx(wt,{size:"sm",variant:"outline",onClick:f,isDisabled:n,flexShrink:0,children:n?"در حال دریافت...":"اجرای دوباره"})]}),b(y=>u.jsxs(F,{w:"full",minW:0,children:[u.jsx(B,{mb:2,fontSize:"sm",fontWeight:"600",dir:"ltr",children:y}),u.jsx(es,{level:y,currentPage:1,totalPages:n?void 0:12,totalCount:n?void 0:120,pageSize:10,loading:n,onPageChange:()=>{}})]}))]}),u.jsxs(F,{borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",p:{base:3,md:4},bg:"gray.50",children:[u.jsxs(tr,{mb:3,gap:3,align:{base:"stretch",md:"center"},justify:"space-between",direction:{base:"column",md:"row"},children:[u.jsxs(F,{children:[u.jsx(B,{fontWeight:"700",fontSize:"sm",children:"Loading — جابه‌جایی بین صفحات"}),u.jsx(B,{mt:1,color:"gray.600",fontSize:"xs",children:"totalPages و totalCount قبلی حفظ می‌شوند و فقط صفحه جاری تا رسیدن پاسخ جدید loading نشان می‌دهد."})]}),u.jsx(wt,{size:"sm",colorScheme:"blue",onClick:()=>p(o>=12?1:o+1),isDisabled:s,flexShrink:0,children:s?"در حال دریافت صفحه...":"صفحه بعدی"})]}),b(y=>u.jsxs(F,{w:"full",minW:0,children:[u.jsx(B,{mb:2,fontSize:"sm",fontWeight:"600",dir:"ltr",children:y}),u.jsx(es,{level:y,currentPage:o,totalPages:12,totalCount:120,pageSize:10,loading:s,onPageChange:p})]}))]}),u.jsx(F,{p:3,bg:"gray.50",borderRadius:"md",fontSize:"sm",color:"gray.600",children:"ارتفاع Pagination از والد گرفته نمی‌شود؛ هر variant ارتفاعش را از کنترل‌ها و padding داخلی خودش می‌سازد."})]})}function K2(){const[e,t]=g.useState("all"),[n,r]=g.useState("users"),o=g.useMemo(()=>[{value:"all",title:"همه",icon:Ph},{value:"users",title:"کاربران",tooltip:"مدیریت کاربران",icon:Ch},{value:"reports",title:"گزارش‌ها",icon:kh},{value:"restricted",title:"غیرفعال",icon:Th,isDisabled:!0}],[]);return u.jsxs(Xe,{spacing:5,children:[u.jsxs(B,{color:"gray.600",fontSize:"sm",children:["ظاهر مستقل و ایزوله، بدون وابستگی به Chakra سامانه مقصد؛ اندازه و استایل نسخه اصلی حفظ شده است. انتخاب فقط با کلیک روی خود آیتم انجام می‌شود و تولتیپ از ",u.jsx(P,{children:"tooltip"})," یا ",u.jsx(P,{children:"title"})," استفاده می‌کند."]}),u.jsx(it,{children:_2}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"Options — نمای متنی"}),u.jsx(Sd,{items:o,mode:"text",value:e,onChange:t,ariaLabel:"انتخاب متنی"})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"Options — نمای آیکونی"}),u.jsx(Sd,{items:o,mode:"icon",value:n,onChange:r,ariaLabel:"انتخاب آیکونی"})]}),u.jsxs(B,{fontSize:"xs",color:"gray.500",children:["رفتار انتخاب همیشه ",u.jsx(P,{children:"options"})," است؛ فقط نمایش با ",u.jsx(P,{children:'mode="text"'})," یا ",u.jsx(P,{children:'mode="icon"'})," تغییر می‌کند."]})]})}function q2(){return u.jsxs(Xe,{spacing:5,children:[u.jsxs(B,{fontSize:"sm",color:"gray.600",children:[u.jsx(P,{children:"BiProvider"})," جدید از ",u.jsx(P,{children:"uikit/provider"})," مستقل از",u.jsx(P,{mx:1,children:"uikit/core"})," است. قابلیت‌ها را با import جداگانه و به‌صورت فرزند مستقیم",u.jsx(P,{mx:1,children:"BiProvider"})," (یا داخل Fragment) تعریف کنید؛ تنها قابلیت‌های موردنیاز بارگذاری می‌شوند."]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"استفاده پایه — فقط React"}),u.jsx(it,{children:$2}),u.jsx(C2,{children:u.jsx(F,{mt:3,p:3,borderWidth:"1px",borderColor:"green.200",borderRadius:"md",bg:"green.50",children:u.jsx(B,{fontSize:"sm",color:"green.800",children:"نمونه زنده: محتوای فرزند BiProvider بدون سرویس اضافه نمایش داده می‌شود."})})})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"نمونه کامل — Next.js Pages Router"}),u.jsx(it,{children:j2}),u.jsxs(B,{mt:2,fontSize:"xs",color:"gray.600",children:[u.jsx(P,{children:"clientId"})," برای Keycloak و Permission اجباری است. آدرس API و شناسه‌ها را با مقادیر سامانه جایگزین کنید. ترتیب نوشتن markerها مهم نیست؛ ترتیب اجرای واقعی: Chakra ← Query ← Router ← Keycloak ← Api ← Permission ← App."]})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"Next.js App Router"}),u.jsx(it,{children:M2}),u.jsxs(B,{mt:2,fontSize:"xs",color:"gray.600",children:["فایل Provider باید Client Component باشد. ",u.jsx(P,{children:"NextAppRouter"})," فقط هنگام استفاده از",u.jsx(P,{mx:1,children:"use-query-params"})," لازم است؛ برای Pages Router به‌جای آن ",u.jsx(P,{children:"NextPagesRouter"})," قرار دهید."]})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"React + Vite"}),u.jsx(it,{children:B2})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"استفاده از Hookها و بررسی دسترسی"}),u.jsx(it,{children:z2})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"md",children:"فهرست کامل APIهای عمومیِ شش مسیر"}),u.jsx(B,{mb:3,color:"gray.600",fontSize:"sm",children:"این فهرست از exportهای واقعی پکیج تهیه شده است. هر نمونه مستقل و قابل کپی است. کدهای احراز هویت و درخواست شبکه فقط به‌صورت نمونه نمایش داده می‌شوند و داخل دمو اجرا نمی‌شوند."}),u.jsx(Xe,{spacing:5,children:W2.map(e=>u.jsxs(F,{p:{base:3,md:4},borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",children:[u.jsx(xh,{as:"h4",size:"sm",dir:"ltr",textAlign:"left",mb:2,children:e.title}),u.jsx(B,{fontSize:"sm",fontWeight:"700",mb:2,dir:"ltr",textAlign:"left",children:e.exports}),u.jsx(B,{fontSize:"sm",color:"gray.600",mb:3,children:e.description}),u.jsx(it,{children:e.code})]},e.title))})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"قابلیت‌ها، import و تنظیمات"}),u.jsxs(Xe,{spacing:2,fontSize:"sm",color:"gray.700",children:[u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/provider"})," → ",u.jsx(P,{children:"BiProvider"}),": فقط ",u.jsx(P,{children:"children"}),"، وابسته به React."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/chakra"})," → ",u.jsx(P,{children:"Chakra"}),": ",u.jsx(P,{children:"theme"}),"، ",u.jsx(P,{children:"fonts"}),"، ",u.jsx(P,{children:"remoteUiEnabled"}),"، ",u.jsx(P,{children:"remoteUiChakraProviderProps"}),"؛ پیش‌فرض فونت و Remote UI فعال است. نیازمند Chakra UI v2 و وابستگی‌های آن."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/query"})," → ",u.jsx(P,{children:"Query"}),": ",u.jsx(P,{children:"client"})," یا ",u.jsx(P,{children:"defaultOptions"}),"؛ نیازمند TanStack React Query v5."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/keycloak"})," → ",u.jsx(P,{children:"Keycloak"}),": ",u.jsx(P,{children:"clientId"})," اجباری، ",u.jsx(P,{children:"url"}),"، ",u.jsx(P,{children:"realm"}),"، ",u.jsx(P,{children:"initOptions"}),"، ",u.jsx(P,{children:"loading"}),"، ",u.jsx(P,{children:"errorFallback"}),"، ",u.jsx(P,{children:"allowUnauthenticated"})," و ",u.jsx(P,{children:"onError"}),"؛ نیازمند ",u.jsx(P,{children:"keycloak-js"}),". پیش‌فرض login-required و implicit است."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/api"})," → ",u.jsx(P,{children:"Api"}),": ",u.jsx(P,{children:"baseUrl"}),"، ",u.jsx(P,{children:"auth"}),"، ",u.jsx(P,{children:"getToken"}),"، ",u.jsx(P,{children:"axiosConfig"}),"، ",u.jsx(P,{children:"onUnauthorized"}),"، ",u.jsx(P,{children:"logoutOnUnauthorized"})," (پیش‌فرض false)؛ نیازمند Axios، قابل مصرف با ",u.jsx(P,{children:"useApi"}),"."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/permission"})," → ",u.jsx(P,{children:"Permission"}),": ",u.jsx(P,{children:"clientId"})," اجباری، ",u.jsx(P,{children:"url"}),"، ",u.jsx(P,{children:"user"}),"، ",u.jsx(P,{children:"getToken"}),"، ",u.jsx(P,{children:"storageKey"}),"، ",u.jsx(P,{children:"loading"}),"، ",u.jsx(P,{children:"errorFallback"})," و ",u.jsx(P,{children:"enabled"}),"؛ بدون کتابخانه اضافه، قابل مصرف با ",u.jsx(P,{children:"usePermission"})," و ",u.jsx(P,{children:"Can"}),"."]}),u.jsxs(B,{children:["• اولویت احراز هویت هر دو ماژول: توکن ",u.jsx(P,{children:"Keycloak"}),"، سپس خروجی ",u.jsx(P,{children:"getToken()"})," و در نبود هر دو درخواست بدون Bearer. در ",u.jsx(P,{children:"Api"})," با ",u.jsxs(P,{children:["auth=",!1]})," تزریق توکن غیرفعال می‌شود."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/next-pages-router"})," و ",u.jsx(P,{children:"uikit/next-app-router"}),": فقط یکی را انتخاب کنید؛ نیازمند ",u.jsx(P,{children:"next-query-params"})," و ",u.jsx(P,{children:"use-query-params"}),"."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/vite"})," → ",u.jsx(P,{children:"Vite"}),": اختیاری و بدون تنظیم اضافه."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/update-checker"})," → ",u.jsx(P,{children:"Updates"}),": ",u.jsx(P,{children:"endpoint"})," (پیش‌فرض /version.json)، ",u.jsx(P,{children:"interval"})," (پیش‌فرض 30000ms) و ",u.jsx(P,{children:"message"}),"."]})]})]}),u.jsxs(B,{fontSize:"xs",color:"gray.600",children:["توجه: ",u.jsx(P,{children:"uikit/provider/legacy"})," مسیر نسخه قدیمی است و همان پراپ‌های ",u.jsx(P,{children:"uikit/core"})," را دارد. نسخه جدید ",u.jsx(P,{children:"BiProvider"})," پراپ‌هایی مانند ",u.jsx(P,{children:"apiBaseUrl"})," و ",u.jsx(P,{children:"keycloakClientId"})," نمی‌گیرد.",u.jsx(P,{mx:1,children:"Api"})," جدید، ",u.jsx(P,{children:"api"})," قدیمی در ",u.jsx(P,{children:"uikit/core"})," را تنظیم نمی‌کند. برای دریافت نسخه جدید Provider در سامانه مقصد باید پکیج UI Kit ارتقا پیدا کند؛ Remote UI به‌تنهایی آن را به‌روز نمی‌کند."]})]})}const X2=[{id:"app-header",label:"AppHeader"},{id:"app-sidebar",label:"AppSidebar"},{id:"pagination",label:"Pagination"},{id:"segmented-selector",label:"SegmentedSelector"},{id:"bi-provider",label:"BiProvider"}];function J2(){const[e,t]=g.useState(!1),[n,r]=g.useState(!1);g.useEffect(()=>{const i=()=>{t(window.scrollY>260),r(window.scrollY>=Math.max(1,window.innerHeight*.75))};return i(),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[]);const o=i=>{document.getElementById(i)?.scrollIntoView({behavior:"smooth",block:"start"})};return u.jsx(uh,{children:u.jsxs(F,{minH:"100vh",bg:"gray.50",dir:"rtl",pb:{base:20,lg:8},children:[u.jsx(F,{minH:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",children:u.jsx(Hs,{maxW:"7xl",px:{base:3,md:6},py:{base:5,md:8},children:u.jsx(gh,{columns:{base:1,sm:2,lg:4},spacing:3,children:X2.map(i=>u.jsx(wt,{type:"button",h:{base:"84px",md:"104px"},bg:"white",color:"gray.800",borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",boxShadow:"sm",fontSize:{base:"md",md:"lg"},_hover:{bg:"gray.50",borderColor:"blue.200",transform:"translateY(-2px)"},transition:"all .18s ease",onClick:()=>o(i.id),children:i.label},i.id))})})}),u.jsx(Hs,{maxW:"7xl",px:{base:3,md:6},pb:{base:5,md:8},children:u.jsxs(Xe,{spacing:6,children:[u.jsx(In,{id:"app-header",title:"AppHeader",children:u.jsx(H2,{})}),u.jsx(In,{id:"app-sidebar",title:"AppSidebar",children:u.jsx(U2,{allowFixedPreview:n})}),u.jsx(In,{id:"pagination",title:"Pagination",children:u.jsx(G2,{})}),u.jsx(In,{id:"segmented-selector",title:"SegmentedSelector",children:u.jsx(K2,{})}),u.jsx(In,{id:"bi-provider",title:"BiProvider (uikit/provider)",children:u.jsx(q2,{})})]})}),e?u.jsx(wt,{type:"button",position:"fixed",left:{base:4,md:6},bottom:{base:20,lg:6},zIndex:2e3,size:"sm",colorScheme:"blue",boxShadow:"lg",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:"بازگشت به بالا ↑"}):null]})})}export{J2 as default}; +// در برنامه عادی، refresh() / clear() از usePermission() مناسب‌تر است.`,W2=[{title:"uikit/chakra",exports:"Chakra · defaultBiTheme",description:"کامپوننت تنظیم Chakra و theme پیش‌فرض؛ Hook مستقلی از این مسیر export نمی‌شود.",code:I2},{title:"uikit/query",exports:"Query",description:"تنظیم QueryClientProvider؛ useQuery و useMutation را از @tanstack/react-query بگیرید.",code:D2},{title:"uikit/next-pages-router",exports:"NextPagesRouter",description:"آداپتور use-query-params برای Next.js Pages Router؛ تابع یا Hook دیگری از این مسیر منتشر نشده است.",code:V2},{title:"uikit/keycloak",exports:"Keycloak · useKeycloak",description:"تمام مقادیر state و متدهای login، logout و updateToken در خروجی useKeycloak نمایش داده شده‌اند.",code:F2},{title:"uikit/api",exports:"Api · useApi · fetcher",description:"نمونه درخواست Axios، تزریق instance به service و امضای fetcher(api, url).",code:L2},{title:"uikit/permission",exports:"Permission · usePermission · Can · AdminGuard · PanelAccessGuard",description:"هوک دسترسی، guardهای عمومی، refresh و clear؛ رفتار PanelAccessGuard را با دقت بخوانید.",code:O2},{title:"uikit/permission — توابع کمکی",exports:"createPermissionSet · checkPermission · getCachedPermissions · setCachedPermissions · clearCachedPermissions",description:"توابع خالص بررسی دسترسی و خواندن/نوشتن/پاک‌کردن cache مرورگر.",code:N2}];function it({children:e}){const[t,n]=g.useState(!1),r=typeof e=="string"?e:String(e??""),o=async()=>{try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(r);else{const i=document.createElement("textarea");i.value=r,i.style.position="fixed",i.style.opacity="0",document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove()}n(!0),window.setTimeout(()=>n(!1),1400)}catch(i){console.error("Copy failed:",i)}};return u.jsxs(F,{position:"relative",w:"full",children:[u.jsx(wt,{type:"button",size:"xs",position:"absolute",top:2,right:2,zIndex:1,bg:"whiteAlpha.200",color:"white",_hover:{bg:"whiteAlpha.300"},onClick:o,children:t?"کپی شد":"کپی کد"}),u.jsx(F,{as:"pre",dir:"ltr",textAlign:"left",overflowX:"auto",w:"full",p:{base:3,md:4},pt:{base:10,md:10},bg:"gray.900",color:"gray.100",borderRadius:"lg",fontSize:{base:"12px",md:"13px"},lineHeight:"1.8",whiteSpace:"pre",children:u.jsx(F,{as:"code",children:r})})]})}function In({id:e,title:t,children:n}){return u.jsxs(F,{id:e,scrollMarginTop:"18px",bg:"white",borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",overflow:"hidden",children:[u.jsx(F,{px:{base:4,md:5},py:4,borderBottomWidth:"1px",borderColor:"gray.100",children:u.jsx(B,{fontSize:{base:"md",md:"lg"},fontWeight:"700",color:"gray.800",children:t})}),u.jsx(F,{p:{base:4,md:5},children:n})]})}const kh=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("path",{d:"M4 19V9"}),u.jsx("path",{d:"M10 19V5"}),u.jsx("path",{d:"M16 19v-7"}),u.jsx("path",{d:"M22 19H2"})]}),Ch=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),u.jsx("circle",{cx:"9",cy:"7",r:"4"}),u.jsx("path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}),u.jsx("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),Ph=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("circle",{cx:"11",cy:"11",r:"8"}),u.jsx("path",{d:"m21 21-4.35-4.35"})]}),Th=()=>u.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"11",width:"18",height:"10",rx:"2"}),u.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]});function H2(){const[e,t]=g.useState(!0),[n,r]=g.useState("در حال بررسی تصویر..."),o=g.useRef(null);return g.useEffect(()=>{const i=()=>{const a=o.current?.querySelector("uikit-app-header")?.shadowRoot?.querySelector("img.logo");if(!a?.src||!a.complete){r("در حال بارگذاری تصویر...");return}if(!a.naturalWidth){r("خطا در بارگذاری لوگو؛ آدرس فایل PNG اصلی را بررسی کنید.");return}const l=`${Math.round(a.getBoundingClientRect().width)}×${Math.round(a.getBoundingClientRect().height)}px`,c=a.src.startsWith("https://img.d.aiengines.ir/")&&a.src.endsWith("@webp");r(c?`WebP بهینه‌شده از سرویس تصاویر | ابعاد نمایش: ${l}`:e?`تصویر اصلی PNG (Fallback) | ابعاد نمایش: ${l}`:`تصویر اصلی PNG | ابعاد نمایش: ${l}`)};i();const s=window.setInterval(i,350);return()=>window.clearInterval(s)},[e]),u.jsxs(Xe,{spacing:5,children:[u.jsxs(B,{color:"gray.600",fontSize:"sm",children:["ظاهر Header داخل remote ایزوله است؛ فونت از سامانه مقصد می‌آید. رنگ پس‌زمینه با",u.jsx(P,{mx:1,children:"bg"}),"اختیاری قابل تغییر است. ",u.jsx(P,{children:"AppHeader.Extra"})," و ",u.jsx(P,{children:"AppHeader.Bi"})," نیز مستقل و اختیاری‌اند."]}),u.jsx(it,{children:A2}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"نمونه نمایش لوگوی ۱۲۵۴×۱۲۵۴ PNG"}),u.jsx(F,{ref:o,overflow:"auto",borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",children:u.jsxs(_t,{bg:"#314E89",children:[u.jsxs(_t.BrandSection,{children:[u.jsx(_t.Logo,{src:"/logo.png",alt:"نشان نمونه سامانه",optimize:e}),u.jsxs(_t.Brand,{children:[u.jsx(_t.Title,{children:"عنوان سامانه"}),u.jsx(_t.Description,{children:"توضیحات سامانه"})]})]}),u.jsx(_t.Extra,{src:P2,alt:"نشان تکمیلی",text:"متن تکمیلی"}),u.jsx(_t.Bi,{src:T2})]})}),u.jsxs(tr,{mt:3,gap:3,align:"center",justify:"space-between",wrap:"wrap",children:[u.jsx(B,{color:"gray.600",fontSize:"xs",children:n}),u.jsx(wt,{size:"xs",variant:"outline",onClick:()=>t(i=>!i),children:e?"نمایش PNG اصلی":"نمایش WebP بهینه‌شده"})]}),u.jsx(B,{mt:2,color:"gray.500",fontSize:"xs",children:"در اجرای لوکال، لوگو از پوشه public بارگذاری می‌شود. سرویس تصاویر معمولاً به localhost دسترسی ندارد؛ در این حالت PNG اصلی به‌صورت Fallback نمایش داده می‌شود."})]}),u.jsxs(F,{fontSize:"sm",color:"gray.600",children:[u.jsxs(B,{children:["• ترتیب انتهای Header: ",u.jsx(P,{children:"Extra"})," سپس ",u.jsx(P,{children:"Bi"}),"."]}),u.jsxs(B,{mt:1,children:["• هرکدام از ",u.jsx(P,{children:"Extra"})," یا ",u.jsx(P,{children:"Bi"})," را می‌توان حذف کرد."]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"Extra"})," لوگو و متن دلخواه می‌گیرد؛ اگر ",u.jsx(P,{children:"text"})," ندهی، فقط لوگو نمایش داده می‌شود و تمام ارتفاع Extra را می‌گیرد."]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"font-family"})," عمداً از Host به ارث می‌رسد."]})]})]})}function U2({allowFixedPreview:e=!0}){const[t,n]=g.useState("analysis"),[r,o]=g.useState("—"),i=g.useMemo(()=>[{id:"analysis",title:"آنالیز",mobileTitle:"آنالیز",icon:kh,active:t==="analysis",onClick:()=>{n("analysis"),o("آنالیز")}},{id:"users",title:"کاربران",mobileTitle:"کاربران",icon:Ch,active:t==="users",onClick:()=>{n("users"),o("کاربران")}},{id:"search",title:"جستجو",mobileTitle:"جستجو",icon:Ph,active:t==="search",onClick:()=>{n("search"),o("جستجو")}},{id:"restricted",title:"بخش محدود",mobileTitle:"محدود",icon:Th,disabled:!0}],[t]);return u.jsxs(Xe,{spacing:5,children:[u.jsx(B,{color:"gray.600",fontSize:"sm",children:"UI داخل remote می‌ماند؛ route، permission، active state و logout در خود سامانه مقصد تعیین می‌شوند."}),u.jsx(it,{children:R2}),u.jsxs(F,{fontSize:"sm",color:"gray.600",children:[u.jsxs(B,{children:["• برای مخفی‌کردن آیتم از ",u.jsx(P,{children:"hidden: true"})," یا filter در Host استفاده کن."]}),u.jsxs(B,{mt:1,children:["• برای حالت غیرقابل کلیک از ",u.jsx(P,{children:"disabled: true"})," استفاده کن."]}),u.jsx(B,{mt:1,children:"• تا ۴ آیتم در موبایل، خروج مستقیم آخر Bottom Navigation قرار می‌گیرد."}),u.jsx(B,{mt:1,children:"• بیشتر از ۴ آیتم: چهار آیتم اول مستقیم، بقیه + خروج داخل «بیشتر» می‌روند."})]}),u.jsxs(F,{p:3,bg:"gray.50",borderRadius:"md",fontSize:"sm",children:["آخرین callback: ",u.jsx(P,{children:r})]}),u.jsx(F,{display:{base:"block",lg:"none"},color:"gray.500",fontSize:"xs",children:"در موبایل نمونه AppSidebar به شکل Bottom Navigation پایین صفحه نمایش داده می‌شود."}),e?u.jsx(F,{display:{base:"block",lg:"none"},children:u.jsx(Kr,{items:i,ariaLabel:"نمونه AppSidebar",children:u.jsx(Kr.Exit,{onClick:()=>o("خروج")})})}):null,u.jsx(F,{display:{base:"none",lg:"block"},position:"relative",h:"360px",overflow:"hidden",borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",children:u.jsx(Kr,{items:i,ariaLabel:"نمونه AppSidebar",children:u.jsx(Kr.Exit,{onClick:()=>o("خروج")})})})]})}function G2(){const[e,t]=g.useState({full:3,compact:3,simple:3,minimal:3}),[n,r]=g.useState(!0),[o,i]=g.useState(3),[s,a]=g.useState(!1),l=g.useRef(null),c=g.useRef(null);g.useEffect(()=>(l.current=window.setTimeout(()=>r(!1),1800),()=>{l.current&&window.clearTimeout(l.current),c.current&&window.clearTimeout(c.current)}),[]);const d=(y,S)=>t(w=>({...w,[y]:S})),f=()=>{l.current&&window.clearTimeout(l.current),r(!0),l.current=window.setTimeout(()=>r(!1),1800)},p=y=>{s||(c.current&&window.clearTimeout(c.current),i(y),a(!0),c.current=window.setTimeout(()=>a(!1),1600))},m=(y,S={})=>u.jsxs(F,{w:"full",minW:0,children:[u.jsx(B,{mb:2,fontSize:"sm",fontWeight:"600",dir:"ltr",children:y}),u.jsx(es,{level:y,currentPage:e[y],totalPages:12,totalCount:120,pageSize:10,onPageChange:w=>d(y,w),...S})]}),b=y=>u.jsxs(Xe,{spacing:4,children:[y("full"),u.jsxs(tr,{w:"full",align:"flex-start",direction:{base:"column",lg:"row"},gap:{base:4,lg:0},children:[u.jsx(F,{w:{base:"100%",lg:"55%"},minW:0,children:y("compact")}),u.jsx(F,{w:{base:"100%",lg:"25%"},minW:0,children:y("simple")}),u.jsx(F,{w:{base:"100%",lg:"20%"},minW:0,children:y("minimal")})]})]});return u.jsxs(Xe,{spacing:6,children:[u.jsxs(B,{color:"gray.600",fontSize:"sm",children:["همه variantها API یکسان دارند. ",u.jsx(P,{children:"loading"})," اختیاری است و اگر پاس داده نشود رفتار قبلی کاملاً حفظ می‌شود."]}),u.jsx(it,{children:E2}),u.jsxs(F,{fontSize:"sm",color:"gray.600",children:[u.jsxs(B,{children:["• ",u.jsx(P,{children:"currentPage"}),": صفحه فعلی"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"totalPages"}),": تعداد کل صفحات"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"totalCount"}),": تعداد کل رکوردها"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"pageSize"}),": تعداد رکورد در هر صفحه"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"onPageChange"}),": callback تغییر صفحه"]}),u.jsxs(B,{mt:1,children:["• ",u.jsx(P,{children:"loading"}),": اختیاری؛ پیش‌فرض ",u.jsx(P,{children:"false"})]}),u.jsxs(B,{mt:1,children:["• levelها: ",u.jsx(P,{children:"full"}),"، ",u.jsx(P,{children:"compact"}),"، ",u.jsx(P,{children:"simple"}),"، ",u.jsx(P,{children:"minimal"})]})]}),u.jsxs(F,{children:[u.jsx(B,{mb:3,fontWeight:"700",fontSize:"sm",children:"نمونه حالت‌ها"}),b(y=>m(y))]}),u.jsxs(F,{borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",p:{base:3,md:4},bg:"gray.50",children:[u.jsxs(tr,{mb:3,gap:3,align:{base:"stretch",md:"center"},justify:"space-between",direction:{base:"column",md:"row"},children:[u.jsxs(F,{children:[u.jsx(B,{fontWeight:"700",fontSize:"sm",children:"Loading — دریافت اولیه"}),u.jsx(B,{mt:1,color:"gray.600",fontSize:"xs",children:"totalPages و totalCount هنوز وجود ندارند؛ صفحه ۱ ثابت می‌ماند و جای مقادیر نامشخص loader دیده می‌شود."})]}),u.jsx(wt,{size:"sm",variant:"outline",onClick:f,isDisabled:n,flexShrink:0,children:n?"در حال دریافت...":"اجرای دوباره"})]}),b(y=>u.jsxs(F,{w:"full",minW:0,children:[u.jsx(B,{mb:2,fontSize:"sm",fontWeight:"600",dir:"ltr",children:y}),u.jsx(es,{level:y,currentPage:1,totalPages:n?void 0:12,totalCount:n?void 0:120,pageSize:10,loading:n,onPageChange:()=>{}})]}))]}),u.jsxs(F,{borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",p:{base:3,md:4},bg:"gray.50",children:[u.jsxs(tr,{mb:3,gap:3,align:{base:"stretch",md:"center"},justify:"space-between",direction:{base:"column",md:"row"},children:[u.jsxs(F,{children:[u.jsx(B,{fontWeight:"700",fontSize:"sm",children:"Loading — جابه‌جایی بین صفحات"}),u.jsx(B,{mt:1,color:"gray.600",fontSize:"xs",children:"totalPages و totalCount قبلی حفظ می‌شوند و فقط صفحه جاری تا رسیدن پاسخ جدید loading نشان می‌دهد."})]}),u.jsx(wt,{size:"sm",colorScheme:"blue",onClick:()=>p(o>=12?1:o+1),isDisabled:s,flexShrink:0,children:s?"در حال دریافت صفحه...":"صفحه بعدی"})]}),b(y=>u.jsxs(F,{w:"full",minW:0,children:[u.jsx(B,{mb:2,fontSize:"sm",fontWeight:"600",dir:"ltr",children:y}),u.jsx(es,{level:y,currentPage:o,totalPages:12,totalCount:120,pageSize:10,loading:s,onPageChange:p})]}))]}),u.jsx(F,{p:3,bg:"gray.50",borderRadius:"md",fontSize:"sm",color:"gray.600",children:"ارتفاع Pagination از والد گرفته نمی‌شود؛ هر variant ارتفاعش را از کنترل‌ها و padding داخلی خودش می‌سازد."})]})}function K2(){const[e,t]=g.useState("all"),[n,r]=g.useState("users"),o=g.useMemo(()=>[{value:"all",title:"همه",icon:Ph},{value:"users",title:"کاربران",tooltip:"مدیریت کاربران",icon:Ch},{value:"reports",title:"گزارش‌ها",icon:kh},{value:"restricted",title:"غیرفعال",icon:Th,isDisabled:!0}],[]);return u.jsxs(Xe,{spacing:5,children:[u.jsxs(B,{color:"gray.600",fontSize:"sm",children:["ظاهر مستقل و ایزوله، بدون وابستگی به Chakra سامانه مقصد؛ اندازه و استایل نسخه اصلی حفظ شده است. انتخاب فقط با کلیک روی خود آیتم انجام می‌شود و تولتیپ از ",u.jsx(P,{children:"tooltip"})," یا ",u.jsx(P,{children:"title"})," استفاده می‌کند."]}),u.jsx(it,{children:_2}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"Options — نمای متنی"}),u.jsx(Sd,{items:o,mode:"text",value:e,onChange:t,ariaLabel:"انتخاب متنی"})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"Options — نمای آیکونی"}),u.jsx(Sd,{items:o,mode:"icon",value:n,onChange:r,ariaLabel:"انتخاب آیکونی"})]}),u.jsxs(B,{fontSize:"xs",color:"gray.500",children:["رفتار انتخاب همیشه ",u.jsx(P,{children:"options"})," است؛ فقط نمایش با ",u.jsx(P,{children:'mode="text"'})," یا ",u.jsx(P,{children:'mode="icon"'})," تغییر می‌کند."]})]})}function q2(){return u.jsxs(Xe,{spacing:5,children:[u.jsxs(B,{fontSize:"sm",color:"gray.600",children:[u.jsx(P,{children:"BiProvider"})," جدید از ",u.jsx(P,{children:"uikit/provider"})," مستقل از",u.jsx(P,{mx:1,children:"uikit/core"})," است. قابلیت‌ها را با import جداگانه و به‌صورت فرزند مستقیم",u.jsx(P,{mx:1,children:"BiProvider"})," (یا داخل Fragment) تعریف کنید؛ تنها قابلیت‌های موردنیاز بارگذاری می‌شوند."]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"استفاده پایه — فقط React"}),u.jsx(it,{children:$2}),u.jsx(C2,{children:u.jsx(F,{mt:3,p:3,borderWidth:"1px",borderColor:"green.200",borderRadius:"md",bg:"green.50",children:u.jsx(B,{fontSize:"sm",color:"green.800",children:"نمونه زنده: محتوای فرزند BiProvider بدون سرویس اضافه نمایش داده می‌شود."})})})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"نمونه کامل — Next.js Pages Router"}),u.jsx(it,{children:j2}),u.jsxs(B,{mt:2,fontSize:"xs",color:"gray.600",children:[u.jsx(P,{children:"clientId"})," برای Keycloak و Permission اجباری است. آدرس API و شناسه‌ها را با مقادیر سامانه جایگزین کنید. ترتیب نوشتن markerها مهم نیست؛ ترتیب اجرای واقعی: Chakra ← Query ← Router ← Keycloak ← Api ← Permission ← App. با حضور Chakra، لودینگ Keycloak و Permission به‌صورت پیش‌فرض Spinner است؛ نیازی به ارسال loading نیست و loading سفارشی (حتی null) اولویت دارد."]})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"Next.js App Router"}),u.jsx(it,{children:M2}),u.jsxs(B,{mt:2,fontSize:"xs",color:"gray.600",children:["فایل Provider باید Client Component باشد. ",u.jsx(P,{children:"NextAppRouter"})," فقط هنگام استفاده از",u.jsx(P,{mx:1,children:"use-query-params"})," لازم است؛ برای Pages Router به‌جای آن ",u.jsx(P,{children:"NextPagesRouter"})," قرار دهید."]})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"React + Vite"}),u.jsx(it,{children:B2})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"استفاده از Hookها و بررسی دسترسی"}),u.jsx(it,{children:z2})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"md",children:"فهرست کامل APIهای عمومیِ شش مسیر"}),u.jsx(B,{mb:3,color:"gray.600",fontSize:"sm",children:"این فهرست از exportهای واقعی پکیج تهیه شده است. هر نمونه مستقل و قابل کپی است. کدهای احراز هویت و درخواست شبکه فقط به‌صورت نمونه نمایش داده می‌شوند و داخل دمو اجرا نمی‌شوند."}),u.jsx(Xe,{spacing:5,children:W2.map(e=>u.jsxs(F,{p:{base:3,md:4},borderWidth:"1px",borderColor:"gray.200",borderRadius:"lg",children:[u.jsx(xh,{as:"h4",size:"sm",dir:"ltr",textAlign:"left",mb:2,children:e.title}),u.jsx(B,{fontSize:"sm",fontWeight:"700",mb:2,dir:"ltr",textAlign:"left",children:e.exports}),u.jsx(B,{fontSize:"sm",color:"gray.600",mb:3,children:e.description}),u.jsx(it,{children:e.code})]},e.title))})]}),u.jsxs(F,{children:[u.jsx(B,{mb:2,fontWeight:"700",fontSize:"sm",children:"قابلیت‌ها، import و تنظیمات"}),u.jsxs(Xe,{spacing:2,fontSize:"sm",color:"gray.700",children:[u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/provider"})," → ",u.jsx(P,{children:"BiProvider"}),": فقط ",u.jsx(P,{children:"children"}),"، وابسته به React."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/chakra"})," → ",u.jsx(P,{children:"Chakra"}),": ",u.jsx(P,{children:"theme"}),"، ",u.jsx(P,{children:"fonts"}),"، ",u.jsx(P,{children:"remoteUiEnabled"}),"، ",u.jsx(P,{children:"remoteUiChakraProviderProps"}),"؛ پیش‌فرض فونت و Remote UI فعال است. نیازمند Chakra UI v2 و وابستگی‌های آن."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/query"})," → ",u.jsx(P,{children:"Query"}),": ",u.jsx(P,{children:"client"})," یا ",u.jsx(P,{children:"defaultOptions"}),"؛ نیازمند TanStack React Query v5."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/keycloak"})," → ",u.jsx(P,{children:"Keycloak"}),": ",u.jsx(P,{children:"clientId"})," اجباری، ",u.jsx(P,{children:"url"}),"، ",u.jsx(P,{children:"realm"}),"، ",u.jsx(P,{children:"initOptions"}),"، ",u.jsx(P,{children:"loading"}),"، ",u.jsx(P,{children:"errorFallback"}),"، ",u.jsx(P,{children:"allowUnauthenticated"})," و ",u.jsx(P,{children:"onError"}),"؛ نیازمند ",u.jsx(P,{children:"keycloak-js"}),". پیش‌فرض login-required و implicit است."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/api"})," → ",u.jsx(P,{children:"Api"}),": ",u.jsx(P,{children:"baseUrl"}),"، ",u.jsx(P,{children:"auth"}),"، ",u.jsx(P,{children:"getToken"}),"، ",u.jsx(P,{children:"axiosConfig"}),"، ",u.jsx(P,{children:"onUnauthorized"}),"، ",u.jsx(P,{children:"logoutOnUnauthorized"})," (پیش‌فرض false)؛ نیازمند Axios، قابل مصرف با ",u.jsx(P,{children:"useApi"}),"."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/permission"})," → ",u.jsx(P,{children:"Permission"}),": ",u.jsx(P,{children:"clientId"})," اجباری، ",u.jsx(P,{children:"url"}),"، ",u.jsx(P,{children:"user"}),"، ",u.jsx(P,{children:"getToken"}),"، ",u.jsx(P,{children:"storageKey"}),"، ",u.jsx(P,{children:"loading"}),"، ",u.jsx(P,{children:"errorFallback"})," و ",u.jsx(P,{children:"enabled"}),"؛ بدون کتابخانه اضافه، قابل مصرف با ",u.jsx(P,{children:"usePermission"})," و ",u.jsx(P,{children:"Can"}),"."]}),u.jsxs(B,{children:["• اولویت احراز هویت هر دو ماژول: توکن ",u.jsx(P,{children:"Keycloak"}),"، سپس خروجی ",u.jsx(P,{children:"getToken()"})," و در نبود هر دو درخواست بدون Bearer. در ",u.jsx(P,{children:"Api"})," با ",u.jsxs(P,{children:["auth=",!1]})," تزریق توکن غیرفعال می‌شود."]}),u.jsxs(B,{children:["• Loading پیش‌فرض با حضور ",u.jsx(P,{children:"Chakra"}),": هر دو ماژول ",u.jsx(P,{children:"Keycloak"})," و ",u.jsx(P,{children:"Permission"})," خودکار Chakra ",u.jsx(P,{children:"Spinner"})," نشان می‌دهند؛ ",u.jsx(P,{children:"loading"})," ارسالی (حتی null) اولویت دارد. بدون Chakra، رفتار قبلی حفظ می‌شود."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/next-pages-router"})," و ",u.jsx(P,{children:"uikit/next-app-router"}),": فقط یکی را انتخاب کنید؛ نیازمند ",u.jsx(P,{children:"next-query-params"})," و ",u.jsx(P,{children:"use-query-params"}),"."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/vite"})," → ",u.jsx(P,{children:"Vite"}),": اختیاری و بدون تنظیم اضافه."]}),u.jsxs(B,{children:["• ",u.jsx(P,{children:"uikit/update-checker"})," → ",u.jsx(P,{children:"Updates"}),": ",u.jsx(P,{children:"endpoint"})," (پیش‌فرض /version.json)، ",u.jsx(P,{children:"interval"})," (پیش‌فرض 30000ms) و ",u.jsx(P,{children:"message"}),"."]})]})]}),u.jsxs(B,{fontSize:"xs",color:"gray.600",children:["توجه: ",u.jsx(P,{children:"uikit/provider/legacy"})," مسیر نسخه قدیمی است و همان پراپ‌های ",u.jsx(P,{children:"uikit/core"})," را دارد. نسخه جدید ",u.jsx(P,{children:"BiProvider"})," پراپ‌هایی مانند ",u.jsx(P,{children:"apiBaseUrl"})," و ",u.jsx(P,{children:"keycloakClientId"})," نمی‌گیرد.",u.jsx(P,{mx:1,children:"Api"})," جدید، ",u.jsx(P,{children:"api"})," قدیمی در ",u.jsx(P,{children:"uikit/core"})," را تنظیم نمی‌کند. برای دریافت نسخه جدید Provider در سامانه مقصد باید پکیج UI Kit ارتقا پیدا کند؛ Remote UI به‌تنهایی آن را به‌روز نمی‌کند."]})]})}const X2=[{id:"app-header",label:"AppHeader"},{id:"app-sidebar",label:"AppSidebar"},{id:"pagination",label:"Pagination"},{id:"segmented-selector",label:"SegmentedSelector"},{id:"bi-provider",label:"BiProvider"}];function J2(){const[e,t]=g.useState(!1),[n,r]=g.useState(!1);g.useEffect(()=>{const i=()=>{t(window.scrollY>260),r(window.scrollY>=Math.max(1,window.innerHeight*.75))};return i(),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[]);const o=i=>{document.getElementById(i)?.scrollIntoView({behavior:"smooth",block:"start"})};return u.jsx(uh,{children:u.jsxs(F,{minH:"100vh",bg:"gray.50",dir:"rtl",pb:{base:20,lg:8},children:[u.jsx(F,{minH:"100dvh",display:"flex",alignItems:"center",justifyContent:"center",children:u.jsx(Hs,{maxW:"7xl",px:{base:3,md:6},py:{base:5,md:8},children:u.jsx(gh,{columns:{base:1,sm:2,lg:4},spacing:3,children:X2.map(i=>u.jsx(wt,{type:"button",h:{base:"84px",md:"104px"},bg:"white",color:"gray.800",borderWidth:"1px",borderColor:"gray.200",borderRadius:"xl",boxShadow:"sm",fontSize:{base:"md",md:"lg"},_hover:{bg:"gray.50",borderColor:"blue.200",transform:"translateY(-2px)"},transition:"all .18s ease",onClick:()=>o(i.id),children:i.label},i.id))})})}),u.jsx(Hs,{maxW:"7xl",px:{base:3,md:6},pb:{base:5,md:8},children:u.jsxs(Xe,{spacing:6,children:[u.jsx(In,{id:"app-header",title:"AppHeader",children:u.jsx(H2,{})}),u.jsx(In,{id:"app-sidebar",title:"AppSidebar",children:u.jsx(U2,{allowFixedPreview:n})}),u.jsx(In,{id:"pagination",title:"Pagination",children:u.jsx(G2,{})}),u.jsx(In,{id:"segmented-selector",title:"SegmentedSelector",children:u.jsx(K2,{})}),u.jsx(In,{id:"bi-provider",title:"BiProvider (uikit/provider)",children:u.jsx(q2,{})})]})}),e?u.jsx(wt,{type:"button",position:"fixed",left:{base:4,md:6},bottom:{base:20,lg:6},zIndex:2e3,size:"sm",colorScheme:"blue",boxShadow:"lg",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:"بازگشت به بالا ↑"}):null]})})}export{J2 as default}; diff --git a/dist/remote/demo-assets/index-DNhZDl2y.js b/dist/remote/demo-assets/index-GAwfVE8_.js similarity index 99% rename from dist/remote/demo-assets/index-DNhZDl2y.js rename to dist/remote/demo-assets/index-GAwfVE8_.js index 14dc9c0..b14f476 100644 --- a/dist/remote/demo-assets/index-DNhZDl2y.js +++ b/dist/remote/demo-assets/index-GAwfVE8_.js @@ -37,4 +37,4 @@ function oc(e,t){for(var n=0;n")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=i);break}}}finally{El=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?hn(e):""}function Uc(e){switch(e.tag){case 5:return hn(e.type);case 16:return hn("Lazy");case 13:return hn("Suspense");case 19:return hn("SuspenseList");case 0:case 2:case 15:return e=_l(e.type,!1),e;case 11:return e=_l(e.type.render,!1),e;case 1:return e=_l(e.type,!0),e;default:return""}}function Jl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ot:return"Fragment";case Rt:return"Portal";case Xl:return"Profiler";case Ku:return"StrictMode";case Gl:return"Suspense";case Zl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case as:return(e.displayName||"Context")+".Consumer";case ss:return(e._context.displayName||"Context")+".Provider";case Yu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xu:return t=e.displayName||null,t!==null?t:Jl(e.type)||"Memo";case Ge:t=e._payload,e=e._init;try{return Jl(e(t))}catch{}}return null}function $c(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Jl(t);case 8:return t===Ku?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function at(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ac(e){var t=fs(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,u=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,u.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rr(e){e._valueTracker||(e._valueTracker=Ac(e))}function ds(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=fs(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ql(e,t){var n=t.checked;return A({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ho(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=at(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ps(e,t){t=t.checked,t!=null&&Qu(e,"checked",t,!1)}function bl(e,t){ps(e,t);var n=at(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?eu(e,t.type,n):t.hasOwnProperty("defaultValue")&&eu(e,t.type,at(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function eu(e,t,n){(t!=="number"||Lr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var yn=Array.isArray;function Ht(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=lr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ln(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Sn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Vc=["Webkit","ms","Moz","O"];Object.keys(Sn).forEach(function(e){Vc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Sn[t]=Sn[e]})});function ys(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Sn.hasOwnProperty(e)&&Sn[e]?(""+t).trim():t+"px"}function gs(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ys(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Bc=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ru(e,t){if(t){if(Bc[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(y(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(y(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(y(61))}if(t.style!=null&&typeof t.style!="object")throw Error(y(62))}}function lu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var uu=null;function Gu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ou=null,Wt=null,Qt=null;function Yo(e){if(e=Gn(e)){if(typeof ou!="function")throw Error(y(280));var t=e.stateNode;t&&(t=ol(t),ou(e.stateNode,e.type,t))}}function ws(e){Wt?Qt?Qt.push(e):Qt=[e]:Wt=e}function Ss(){if(Wt){var e=Wt,t=Qt;if(Qt=Wt=null,Yo(e),t)for(e=0;e>>=0,e===0?32:31-(bc(e)/ef|0)|0}var ur=64,or=4194304;function gn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Dr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,u=e.pingedLanes,o=n&268435455;if(o!==0){var i=o&~l;i!==0?r=gn(i):(u&=o,u!==0&&(r=gn(u)))}else o=n&~l,o!==0?r=gn(o):u!==0&&(r=gn(u));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,u=t&-t,l>=u||l===16&&(u&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Yn(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Le(t),e[t]=n}function lf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=En),ni=" ",ri=!1;function As(e,t){switch(e){case"keyup":return Mf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mt=!1;function If(e,t){switch(e){case"compositionend":return Vs(t);case"keypress":return t.which!==32?null:(ri=!0,ni);case"textInput":return e=t.data,e===ni&&ri?null:e;default:return null}}function jf(e,t){if(Mt)return e==="compositionend"||!ro&&As(e,t)?(e=Us(),kr=eo=be=null,Mt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ii(n)}}function Qs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ks(){for(var e=window,t=Lr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Lr(e.document)}return t}function lo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Qf(e){var t=Ks(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Qs(n.ownerDocument.documentElement,n)){if(r!==null&&lo(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,u=Math.min(r.start,l);r=r.end===void 0?u:Math.min(r.end,l),!e.extend&&u>r&&(l=r,r=u,u=l),l=si(n,u);var o=si(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),u>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Dt=null,du=null,Cn=null,pu=!1;function ai(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;pu||Dt==null||Dt!==Lr(r)||(r=Dt,"selectionStart"in r&&lo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Cn&&jn(Cn,r)||(Cn=r,r=Fr(du,"onSelect"),0Ft||(e.current=wu[Ft],wu[Ft]=null,Ft--)}function M(e,t){Ft++,wu[Ft]=e.current,e.current=t}var ct={},re=dt(ct),ce=dt(!1),_t=ct;function Zt(e,t){var n=e.type.contextTypes;if(!n)return ct;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},u;for(u in n)l[u]=t[u];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function fe(e){return e=e.childContextTypes,e!=null}function $r(){I(ce),I(re)}function hi(e,t,n){if(re.current!==ct)throw Error(y(168));M(re,t),M(ce,n)}function ta(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(y(108,$c(e)||"Unknown",l));return A({},n,r)}function Ar(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ct,_t=re.current,M(re,e),M(ce,ce.current),!0}function yi(e,t,n){var r=e.stateNode;if(!r)throw Error(y(169));n?(e=ta(e,t,_t),r.__reactInternalMemoizedMergedChildContext=e,I(ce),I(re),M(re,e)):I(ce),M(ce,n)}var $e=null,il=!1,Fl=!1;function na(e){$e===null?$e=[e]:$e.push(e)}function rd(e){il=!0,na(e)}function pt(){if(!Fl&&$e!==null){Fl=!0;var e=0,t=O;try{var n=$e;for(O=1;e>=o,l-=o,Ae=1<<32-Le(t)+l|n<P?(B=x,x=null):B=x.sibling;var L=p(f,x,d[P],h);if(L===null){x===null&&(x=B);break}e&&x&&L.alternate===null&&t(f,x),a=u(L,a,P),C===null?E=L:C.sibling=L,C=L,x=B}if(P===d.length)return n(f,x),F&&ht(f,P),E;if(x===null){for(;PP?(B=x,x=null):B=x.sibling;var xe=p(f,x,L.value,h);if(xe===null){x===null&&(x=B);break}e&&x&&xe.alternate===null&&t(f,x),a=u(xe,a,P),C===null?E=xe:C.sibling=xe,C=xe,x=B}if(L.done)return n(f,x),F&&ht(f,P),E;if(x===null){for(;!L.done;P++,L=d.next())L=m(f,L.value,h),L!==null&&(a=u(L,a,P),C===null?E=L:C.sibling=L,C=L);return F&&ht(f,P),E}for(x=r(f,x);!L.done;P++,L=d.next())L=g(x,f,P,L.value,h),L!==null&&(e&&L.alternate!==null&&x.delete(L.key===null?P:L.key),a=u(L,a,P),C===null?E=L:C.sibling=L,C=L);return e&&x.forEach(function(un){return t(f,un)}),F&&ht(f,P),E}function j(f,a,d,h){if(typeof d=="object"&&d!==null&&d.type===Ot&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case nr:e:{for(var E=d.key,C=a;C!==null;){if(C.key===E){if(E=d.type,E===Ot){if(C.tag===7){n(f,C.sibling),a=l(C,d.props.children),a.return=f,f=a;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ge&&Si(E)===C.type){n(f,C.sibling),a=l(C,d.props),a.ref=pn(f,C,d),a.return=f,f=a;break e}n(f,C);break}else t(f,C);C=C.sibling}d.type===Ot?(a=Et(d.props.children,f.mode,h,d.key),a.return=f,f=a):(h=Tr(d.type,d.key,d.props,null,f.mode,h),h.ref=pn(f,a,d),h.return=f,f=h)}return o(f);case Rt:e:{for(C=d.key;a!==null;){if(a.key===C)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{n(f,a);break}else t(f,a);a=a.sibling}a=Ql(d,f.mode,h),a.return=f,f=a}return o(f);case Ge:return C=d._init,j(f,a,C(d._payload),h)}if(yn(d))return w(f,a,d,h);if(sn(d))return S(f,a,d,h);pr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(f,a.sibling),a=l(a,d),a.return=f,f=a):(n(f,a),a=Wl(d,f.mode,h),a.return=f,f=a),o(f)):n(f,a)}return j}var qt=oa(!0),ia=oa(!1),Hr=dt(null),Wr=null,At=null,so=null;function ao(){so=At=Wr=null}function co(e){var t=Hr.current;I(Hr),e._currentValue=t}function Eu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yt(e,t){Wr=e,so=At=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ae=!0),e.firstContext=null)}function _e(e){var t=e._currentValue;if(so!==e)if(e={context:e,memoizedValue:t,next:null},At===null){if(Wr===null)throw Error(y(308));At=e,Wr.dependencies={lanes:0,firstContext:e}}else At=At.next=e;return t}var wt=null;function fo(e){wt===null?wt=[e]:wt.push(e)}function sa(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,fo(t)):(n.next=l.next,l.next=n),t.interleaved=n,Qe(e,r)}function Qe(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ze=!1;function po(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Be(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ut(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,R&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Qe(e,n)}return l=r.interleaved,l===null?(t.next=t,fo(r)):(t.next=l.next,l.next=t),r.interleaved=t,Qe(e,n)}function _r(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ju(e,n)}}function ki(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};u===null?l=u=o:u=u.next=o,n=n.next}while(n!==null);u===null?l=u=t:u=u.next=t}else l=u=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:u,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qr(e,t,n,r){var l=e.updateQueue;Ze=!1;var u=l.firstBaseUpdate,o=l.lastBaseUpdate,i=l.shared.pending;if(i!==null){l.shared.pending=null;var s=i,c=s.next;s.next=null,o===null?u=c:o.next=c,o=s;var v=e.alternate;v!==null&&(v=v.updateQueue,i=v.lastBaseUpdate,i!==o&&(i===null?v.firstBaseUpdate=c:i.next=c,v.lastBaseUpdate=s))}if(u!==null){var m=l.baseState;o=0,v=c=s=null,i=u;do{var p=i.lane,g=i.eventTime;if((r&p)===p){v!==null&&(v=v.next={eventTime:g,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var w=e,S=i;switch(p=t,g=n,S.tag){case 1:if(w=S.payload,typeof w=="function"){m=w.call(g,m,p);break e}m=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,p=typeof w=="function"?w.call(g,m,p):w,p==null)break e;m=A({},m,p);break e;case 2:Ze=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,p=l.effects,p===null?l.effects=[i]:p.push(i))}else g={eventTime:g,lane:p,tag:i.tag,payload:i.payload,callback:i.callback,next:null},v===null?(c=v=g,s=m):v=v.next=g,o|=p;if(i=i.next,i===null){if(i=l.shared.pending,i===null)break;p=i,i=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}while(!0);if(v===null&&(s=m),l.baseState=s,l.firstBaseUpdate=c,l.lastBaseUpdate=v,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else u===null&&(l.shared.lanes=0);Pt|=o,e.lanes=o,e.memoizedState=m}}function Ei(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=$l.transition;$l.transition={};try{e(!1),t()}finally{O=n,$l.transition=r}}function Pa(){return Ce().memoizedState}function id(e,t,n){var r=it(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Na(e))za(t,n);else if(n=sa(e,t,n,r),n!==null){var l=ue();Re(n,e,r,l),Ta(n,t,r)}}function sd(e,t,n){var r=it(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Na(e))za(t,l);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var o=t.lastRenderedState,i=u(o,n);if(l.hasEagerState=!0,l.eagerState=i,Oe(i,o)){var s=t.interleaved;s===null?(l.next=l,fo(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=sa(e,t,l,r),n!==null&&(l=ue(),Re(n,e,r,l),Ta(n,t,r))}}function Na(e){var t=e.alternate;return e===$||t!==null&&t===$}function za(e,t){xn=Yr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ta(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ju(e,n)}}var Xr={readContext:_e,useCallback:ee,useContext:ee,useEffect:ee,useImperativeHandle:ee,useInsertionEffect:ee,useLayoutEffect:ee,useMemo:ee,useReducer:ee,useRef:ee,useState:ee,useDebugValue:ee,useDeferredValue:ee,useTransition:ee,useMutableSource:ee,useSyncExternalStore:ee,useId:ee,unstable_isNewReconciler:!1},ad={readContext:_e,useCallback:function(e,t){return De().memoizedState=[e,t===void 0?null:t],e},useContext:_e,useEffect:Ci,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xr(4194308,4,ka.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xr(4194308,4,e,t)},useInsertionEffect:function(e,t){return xr(4,2,e,t)},useMemo:function(e,t){var n=De();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=De();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=id.bind(null,$,e),[r.memoizedState,e]},useRef:function(e){var t=De();return e={current:e},t.memoizedState=e},useState:_i,useDebugValue:ko,useDeferredValue:function(e){return De().memoizedState=e},useTransition:function(){var e=_i(!1),t=e[0];return e=od.bind(null,e[1]),De().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$,l=De();if(F){if(n===void 0)throw Error(y(407));n=n()}else{if(n=t(),Z===null)throw Error(y(349));xt&30||pa(r,t,n)}l.memoizedState=n;var u={value:n,getSnapshot:t};return l.queue=u,Ci(va.bind(null,r,u,e),[e]),r.flags|=2048,Wn(9,ma.bind(null,r,u,n,t),void 0,null),n},useId:function(){var e=De(),t=Z.identifierPrefix;if(F){var n=Ve,r=Ae;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Bn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ie]=t,e[$n]=r,$a(e,t,!1,!1),t.stateNode=e;e:{switch(o=lu(n,r),n){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;ltn&&(t.flags|=128,r=!0,mn(u,!1),t.lanes=4194304)}else{if(!r)if(e=Kr(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mn(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!F)return te(t),null}else 2*W()-u.renderingStartTime>tn&&n!==1073741824&&(t.flags|=128,r=!0,mn(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=W(),t.sibling=null,n=U.current,M(U,r?n&1|2:n&1),t):(te(t),null);case 22:case 23:return No(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pe&1073741824&&(te(t),t.subtreeFlags&6&&(t.flags|=8192)):te(t),null;case 24:return null;case 25:return null}throw Error(y(156,t.tag))}function yd(e,t){switch(oo(t),t.tag){case 1:return fe(t.type)&&$r(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bt(),I(ce),I(re),ho(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vo(t),null;case 13:if(I(U),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(y(340));Jt()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(U),null;case 4:return bt(),null;case 10:return co(t.type._context),null;case 22:case 23:return No(),null;case 24:return null;default:return null}}var vr=!1,ne=!1,gd=typeof WeakSet=="function"?WeakSet:Set,k=null;function Vt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){V(e,t,r)}else n.current=null}function Ru(e,t,n){try{n()}catch(r){V(e,t,r)}}var Ii=!1;function wd(e,t){if(mu=Ir,e=Ks(),lo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,s=-1,c=0,v=0,m=e,p=null;t:for(;;){for(var g;m!==n||l!==0&&m.nodeType!==3||(i=o+l),m!==u||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===e)break t;if(p===n&&++c===l&&(i=o),p===u&&++v===r&&(s=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},Ir=!1,k=t;k!==null;)if(t=k,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,k=e;else for(;k!==null;){t=k;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,j=w.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:Ne(t.type,S),j);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(h){V(t,t.return,h)}if(e=t.sibling,e!==null){e.return=t.return,k=e;break}k=t.return}return w=Ii,Ii=!1,w}function Pn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&Ru(t,n,u)}l=l.next}while(l!==r)}}function cl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ou(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ba(e){var t=e.alternate;t!==null&&(e.alternate=null,Ba(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ie],delete t[$n],delete t[gu],delete t[td],delete t[nd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ha(e){return e.tag===5||e.tag===3||e.tag===4}function ji(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ha(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ur));else if(r!==4&&(e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}var J=null,ze=!1;function Xe(e,t,n){for(n=n.child;n!==null;)Wa(e,t,n),n=n.sibling}function Wa(e,t,n){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(nl,n)}catch{}switch(n.tag){case 5:ne||Vt(n,t);case 6:var r=J,l=ze;J=null,Xe(e,t,n),J=r,ze=l,J!==null&&(ze?(e=J,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):J.removeChild(n.stateNode));break;case 18:J!==null&&(ze?(e=J,n=n.stateNode,e.nodeType===8?jl(e.parentNode,n):e.nodeType===1&&jl(e,n),Dn(e)):jl(J,n.stateNode));break;case 4:r=J,l=ze,J=n.stateNode.containerInfo,ze=!0,Xe(e,t,n),J=r,ze=l;break;case 0:case 11:case 14:case 15:if(!ne&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&(u&2||u&4)&&Ru(n,t,o),l=l.next}while(l!==r)}Xe(e,t,n);break;case 1:if(!ne&&(Vt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){V(n,t,i)}Xe(e,t,n);break;case 21:Xe(e,t,n);break;case 22:n.mode&1?(ne=(r=ne)||n.memoizedState!==null,Xe(e,t,n),ne=r):Xe(e,t,n);break;default:Xe(e,t,n)}}function Fi(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gd),t.forEach(function(r){var l=zd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Pe(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=W()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kd(r/1960))-r,10e?16:e,et===null)var r=!1;else{if(e=et,et=null,Jr=0,R&6)throw Error(y(331));var l=R;for(R|=4,k=e.current;k!==null;){var u=k,o=u.child;if(k.flags&16){var i=u.deletions;if(i!==null){for(var s=0;sW()-xo?kt(e,0):Co|=n),de(e,t)}function qa(e,t){t===0&&(e.mode&1?(t=or,or<<=1,!(or&130023424)&&(or=4194304)):t=1);var n=ue();e=Qe(e,t),e!==null&&(Yn(e,t,n),de(e,n))}function Nd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qa(e,n)}function zd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(t),qa(e,n)}var ba;ba=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ce.current)ae=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ae=!1,vd(e,t,n);ae=!!(e.flags&131072)}else ae=!1,F&&t.flags&1048576&&ra(t,Br,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pr(e,t),e=t.pendingProps;var l=Zt(t,re.current);Yt(t,n),l=go(null,t,r,e,l,n);var u=wo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,fe(r)?(u=!0,Ar(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,po(t),l.updater=al,t.stateNode=l,l._reactInternals=t,Cu(t,r,e,n),t=Nu(null,t,r,!0,u,n)):(t.tag=0,F&&u&&uo(t),le(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Ld(r),e=Ne(r,e),l){case 0:t=Pu(null,t,r,e,n);break e;case 1:t=Oi(null,t,r,e,n);break e;case 11:t=Li(null,t,r,e,n);break e;case 14:t=Ri(null,t,r,Ne(r.type,e),n);break e}throw Error(y(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Pu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Oi(e,t,r,l,n);case 3:e:{if(ja(t),e===null)throw Error(y(387));r=t.pendingProps,u=t.memoizedState,l=u.element,aa(e,t),Qr(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=en(Error(y(423)),t),t=Mi(e,t,r,n,l);break e}else if(r!==l){l=en(Error(y(424)),t),t=Mi(e,t,r,n,l);break e}else for(me=lt(t.stateNode.containerInfo.firstChild),ve=t,F=!0,Te=null,n=ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jt(),r===l){t=Ke(e,t,n);break e}le(e,t,r,n)}t=t.child}return t;case 5:return ca(t),e===null&&ku(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,hu(r,l)?o=null:u!==null&&hu(r,u)&&(t.flags|=32),Ia(e,t),le(e,t,o,n),t.child;case 6:return e===null&&ku(t),null;case 13:return Fa(e,t,n);case 4:return mo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qt(t,null,r,n):le(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Li(e,t,r,l,n);case 7:return le(e,t,t.pendingProps,n),t.child;case 8:return le(e,t,t.pendingProps.children,n),t.child;case 12:return le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,M(Hr,r._currentValue),r._currentValue=o,u!==null)if(Oe(u.value,o)){if(u.children===l.children&&!ce.current){t=Ke(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Be(-1,n&-n),s.tag=2;var c=u.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?s.next=s:(s.next=v.next,v.next=s),c.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),Eu(u.return,n,t),i.lanes|=n;break}s=s.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(y(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),Eu(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}le(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yt(t,n),l=_e(l),r=r(l),t.flags|=1,le(e,t,r,n),t.child;case 14:return r=t.type,l=Ne(r,t.pendingProps),l=Ne(r.type,l),Ri(e,t,r,l,n);case 15:return Ma(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Pr(e,t),t.tag=1,fe(r)?(e=!0,Ar(t)):e=!1,Yt(t,n),La(t,r,l),Cu(t,r,l,n),Nu(null,t,r,!0,e,n);case 19:return Ua(e,t,n);case 22:return Da(e,t,n)}throw Error(y(156,t.tag))};function ec(e,t){return Ns(e,t)}function Td(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(e,t,n,r){return new Td(e,t,n,r)}function To(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ld(e){if(typeof e=="function")return To(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yu)return 11;if(e===Xu)return 14}return 2}function st(e,t){var n=e.alternate;return n===null?(n=ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Tr(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")To(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ot:return Et(n.children,l,u,t);case Ku:o=8,l|=8;break;case Xl:return e=ke(12,n,t,l|2),e.elementType=Xl,e.lanes=u,e;case Gl:return e=ke(13,n,t,l),e.elementType=Gl,e.lanes=u,e;case Zl:return e=ke(19,n,t,l),e.elementType=Zl,e.lanes=u,e;case cs:return dl(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ss:o=10;break e;case as:o=9;break e;case Yu:o=11;break e;case Xu:o=14;break e;case Ge:o=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return t=ke(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function Et(e,t,n,r){return e=ke(7,e,r,t),e.lanes=n,e}function dl(e,t,n,r){return e=ke(22,e,r,t),e.elementType=cs,e.lanes=n,e.stateNode={isHidden:!1},e}function Wl(e,t,n){return e=ke(6,e,null,t),e.lanes=n,e}function Ql(e,t,n){return t=ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Rd(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xl(0),this.expirationTimes=xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Lo(e,t,n,r,l,u,o,i,s){return e=new Rd(e,t,n,i,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=ke(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},po(u),e}function Od(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lc)}catch(e){console.error(e)}}lc(),ls.exports=ye;var Fd=ls.exports,Ud,Qi=Fd;Ud=Kl.createRoot=Qi.createRoot,Kl.hydrateRoot=Qi.hydrateRoot;const Jn={GBadge:"https://uikit.d.aiengines.ir/GBadge.js",Pagination:"https://uikit.d.aiengines.ir/Pagination.js",AppHeader:"https://uikit.d.aiengines.ir/AppHeader.js",AppSidebar:"https://uikit.d.aiengines.ir/AppSidebar.js",SegmentedSelector:"https://uikit.d.aiengines.ir/SegmentedSelector.js"},Vd="__UIKIT_REMOTE_DEPS__",Bd="__UIKIT_REACT_REMOTE_DEPS__",qn=window.location.origin;Jn.AppHeader=`${qn}/AppHeader.js`;Jn.AppSidebar=`${qn}/AppSidebar.js`;Jn.SegmentedSelector=`${qn}/SegmentedSelector.js`;Jn.Pagination=`${qn}/Pagination.js`;Jn.GBadge=`${qn}/GBadge.js`;ac(async()=>{const{default:e}=await import("./AppHeaderPreview-BtcI8Bja.js");return{default:e}},[],import.meta.url).then(({default:e})=>{Kl.createRoot(document.getElementById("root")).render($o.jsx(ns.StrictMode,{children:$o.jsx(e,{})}))});export{Jn as D,Ad as R,Fd as a,Ud as b,$d as c,ns as d,Vd as e,Bd as f,cc as g,$o as j,tl as r}; +`+u.stack}return{value:e,source:t,stack:l,digest:null}}function Bl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function xu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var dd=typeof WeakMap=="function"?WeakMap:Map;function Ra(e,t,n){n=Be(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zr||(Zr=!0,Iu=r),xu(e,t)},n}function Oa(e,t,n){n=Be(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){xu(e,t)}}var u=e.stateNode;return u!==null&&typeof u.componentDidCatch=="function"&&(n.callback=function(){xu(e,t),typeof r!="function"&&(ot===null?ot=new Set([this]):ot.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ni(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new dd;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Pd.bind(null,e,t,n),t.then(e,e))}function zi(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ti(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Be(-1,1),t.tag=2,ut(n,t,1))),n.lanes|=1),e)}var pd=Ye.ReactCurrentOwner,ae=!1;function le(e,t,n,r){t.child=e===null?ia(t,null,n,r):qt(t,e.child,n,r)}function Li(e,t,n,r,l){n=n.render;var u=t.ref;return Yt(t,l),r=go(e,t,n,r,u,l),n=wo(),e!==null&&!ae?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ke(e,t,l)):(F&&n&&uo(t),t.flags|=1,le(e,t,r,l),t.child)}function Ri(e,t,n,r,l){if(e===null){var u=n.type;return typeof u=="function"&&!To(u)&&u.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=u,Ma(e,t,u,r,l)):(e=Tr(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!(e.lanes&l)){var o=u.memoizedProps;if(n=n.compare,n=n!==null?n:jn,n(o,r)&&e.ref===t.ref)return Ke(e,t,l)}return t.flags|=1,e=st(u,r),e.ref=t.ref,e.return=t,t.child=e}function Ma(e,t,n,r,l){if(e!==null){var u=e.memoizedProps;if(jn(u,r)&&e.ref===t.ref)if(ae=!1,t.pendingProps=r=u,(e.lanes&l)!==0)e.flags&131072&&(ae=!0);else return t.lanes=e.lanes,Ke(e,t,l)}return Pu(e,t,n,r,l)}function Da(e,t,n){var r=t.pendingProps,l=r.children,u=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},M(Bt,pe),pe|=n;else{if(!(n&1073741824))return e=u!==null?u.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,M(Bt,pe),pe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=u!==null?u.baseLanes:n,M(Bt,pe),pe|=r}else u!==null?(r=u.baseLanes|n,t.memoizedState=null):r=n,M(Bt,pe),pe|=r;return le(e,t,l,n),t.child}function Ia(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Pu(e,t,n,r,l){var u=fe(n)?_t:re.current;return u=Zt(t,u),Yt(t,l),n=go(e,t,n,r,u,l),r=wo(),e!==null&&!ae?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Ke(e,t,l)):(F&&r&&uo(t),t.flags|=1,le(e,t,n,l),t.child)}function Oi(e,t,n,r,l){if(fe(n)){var u=!0;Ar(t)}else u=!1;if(Yt(t,l),t.stateNode===null)Pr(e,t),La(t,n,r),Cu(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,i=t.memoizedProps;o.props=i;var s=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=_e(c):(c=fe(n)?_t:re.current,c=Zt(t,c));var v=n.getDerivedStateFromProps,m=typeof v=="function"||typeof o.getSnapshotBeforeUpdate=="function";m||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==r||s!==c)&&Pi(t,o,r,c),Ze=!1;var p=t.memoizedState;o.state=p,Qr(t,r,o,l),s=t.memoizedState,i!==r||p!==s||ce.current||Ze?(typeof v=="function"&&(_u(t,n,v,r),s=t.memoizedState),(i=Ze||xi(t,n,i,r,p,s,c))?(m||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),o.props=r,o.state=s,o.context=c,r=i):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,aa(e,t),i=t.memoizedProps,c=t.type===t.elementType?i:Ne(t.type,i),o.props=c,m=t.pendingProps,p=o.context,s=n.contextType,typeof s=="object"&&s!==null?s=_e(s):(s=fe(n)?_t:re.current,s=Zt(t,s));var g=n.getDerivedStateFromProps;(v=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(i!==m||p!==s)&&Pi(t,o,r,s),Ze=!1,p=t.memoizedState,o.state=p,Qr(t,r,o,l);var w=t.memoizedState;i!==m||p!==w||ce.current||Ze?(typeof g=="function"&&(_u(t,n,g,r),w=t.memoizedState),(c=Ze||xi(t,n,c,r,p,w,s)||!1)?(v||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,s),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,s)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=s,r=c):(typeof o.componentDidUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Nu(e,t,n,r,u,l)}function Nu(e,t,n,r,l,u){Ia(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&yi(t,n,!1),Ke(e,t,u);r=t.stateNode,pd.current=t;var i=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=qt(t,e.child,null,u),t.child=qt(t,null,i,u)):le(e,t,i,u),t.memoizedState=r.state,l&&yi(t,n,!0),t.child}function ja(e){var t=e.stateNode;t.pendingContext?hi(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hi(e,t.context,!1),mo(e,t.containerInfo)}function Mi(e,t,n,r,l){return Jt(),io(l),t.flags|=256,le(e,t,n,r),t.child}var zu={dehydrated:null,treeContext:null,retryLane:0};function Tu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fa(e,t,n){var r=t.pendingProps,l=U.current,u=!1,o=(t.flags&128)!==0,i;if((i=o)||(i=e!==null&&e.memoizedState===null?!1:(l&2)!==0),i?(u=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),M(U,l&1),e===null)return ku(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,u?(r=t.mode,u=t.child,o={mode:"hidden",children:o},!(r&1)&&u!==null?(u.childLanes=0,u.pendingProps=o):u=dl(o,r,0,null),e=Et(e,r,n,null),u.return=t,e.return=t,u.sibling=e,t.child=u,t.child.memoizedState=Tu(n),t.memoizedState=zu,e):Eo(t,o));if(l=e.memoizedState,l!==null&&(i=l.dehydrated,i!==null))return md(e,t,o,r,i,l,n);if(u){u=r.fallback,o=t.mode,l=e.child,i=l.sibling;var s={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=st(l,s),r.subtreeFlags=l.subtreeFlags&14680064),i!==null?u=st(i,u):(u=Et(u,o,n,null),u.flags|=2),u.return=t,r.return=t,r.sibling=u,t.child=r,r=u,u=t.child,o=e.child.memoizedState,o=o===null?Tu(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},u.memoizedState=o,u.childLanes=e.childLanes&~n,t.memoizedState=zu,r}return u=e.child,e=u.sibling,r=st(u,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Eo(e,t){return t=dl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function mr(e,t,n,r){return r!==null&&io(r),qt(t,e.child,null,n),e=Eo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function md(e,t,n,r,l,u,o){if(n)return t.flags&256?(t.flags&=-257,r=Bl(Error(y(422))),mr(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(u=r.fallback,l=t.mode,r=dl({mode:"visible",children:r.children},l,0,null),u=Et(u,l,o,null),u.flags|=2,r.return=t,u.return=t,r.sibling=u,t.child=r,t.mode&1&&qt(t,e.child,null,o),t.child.memoizedState=Tu(o),t.memoizedState=zu,u);if(!(t.mode&1))return mr(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var i=r.dgst;return r=i,u=Error(y(419)),r=Bl(u,r,void 0),mr(e,t,o,r)}if(i=(o&e.childLanes)!==0,ae||i){if(r=Z,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==u.retryLane&&(u.retryLane=l,Qe(e,l),Re(r,e,l,-1))}return zo(),r=Bl(Error(y(421))),mr(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Nd.bind(null,e),l._reactRetry=t,null):(e=u.treeContext,me=lt(l.nextSibling),ve=t,F=!0,Te=null,e!==null&&(we[Se++]=Ae,we[Se++]=Ve,we[Se++]=Ct,Ae=e.id,Ve=e.overflow,Ct=t),t=Eo(t,r.children),t.flags|=4096,t)}function Di(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Eu(e.return,t,n)}function Hl(e,t,n,r,l){var u=e.memoizedState;u===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(u.isBackwards=t,u.rendering=null,u.renderingStartTime=0,u.last=r,u.tail=n,u.tailMode=l)}function Ua(e,t,n){var r=t.pendingProps,l=r.revealOrder,u=r.tail;if(le(e,t,r.children,n),r=U.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Di(e,n,t);else if(e.tag===19)Di(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(M(U,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Kr(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Hl(t,!1,l,n,u);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Kr(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Hl(t,!0,n,null,u);break;case"together":Hl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Pr(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ke(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Pt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(y(153));if(t.child!==null){for(e=t.child,n=st(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=st(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vd(e,t,n){switch(t.tag){case 3:ja(t),Jt();break;case 5:ca(t);break;case 1:fe(t.type)&&Ar(t);break;case 4:mo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;M(Hr,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(M(U,U.current&1),t.flags|=128,null):n&t.child.childLanes?Fa(e,t,n):(M(U,U.current&1),e=Ke(e,t,n),e!==null?e.sibling:null);M(U,U.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ua(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),M(U,U.current),r)break;return null;case 22:case 23:return t.lanes=0,Da(e,t,n)}return Ke(e,t,n)}var $a,Lu,Aa,Va;$a=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Lu=function(){};Aa=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,St(Fe.current);var u=null;switch(n){case"input":l=ql(e,l),r=ql(e,r),u=[];break;case"select":l=A({},l,{value:void 0}),r=A({},r,{value:void 0}),u=[];break;case"textarea":l=tu(e,l),r=tu(e,r),u=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ur)}ru(n,r);var o;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var i=l[c];for(o in i)i.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Tn.hasOwnProperty(c)?u||(u=[]):(u=u||[]).push(c,null));for(c in r){var s=r[c];if(i=l?.[c],r.hasOwnProperty(c)&&s!==i&&(s!=null||i!=null))if(c==="style")if(i){for(o in i)!i.hasOwnProperty(o)||s&&s.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in s)s.hasOwnProperty(o)&&i[o]!==s[o]&&(n||(n={}),n[o]=s[o])}else n||(u||(u=[]),u.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,i=i?i.__html:void 0,s!=null&&i!==s&&(u=u||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(u=u||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Tn.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&D("scroll",e),u||i===s||(u=[])):(u=u||[]).push(c,s))}n&&(u=u||[]).push("style",n);var c=u;(t.updateQueue=c)&&(t.flags|=4)}};Va=function(e,t,n,r){n!==r&&(t.flags|=4)};function mn(e,t){if(!F)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function te(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function hd(e,t,n){var r=t.pendingProps;switch(oo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return te(t),null;case 1:return fe(t.type)&&$r(),te(t),null;case 3:return r=t.stateNode,bt(),I(ce),I(re),ho(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(dr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Te!==null&&(Uu(Te),Te=null))),Lu(e,t),te(t),null;case 5:vo(t);var l=St(Vn.current);if(n=t.type,e!==null&&t.stateNode!=null)Aa(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(y(166));return te(t),null}if(e=St(Fe.current),dr(t)){r=t.stateNode,n=t.type;var u=t.memoizedProps;switch(r[Ie]=t,r[$n]=u,e=(t.mode&1)!==0,n){case"dialog":D("cancel",r),D("close",r);break;case"iframe":case"object":case"embed":D("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Ie]=t,e[$n]=r,$a(e,t,!1,!1),t.stateNode=e;e:{switch(o=lu(n,r),n){case"dialog":D("cancel",e),D("close",e),l=r;break;case"iframe":case"object":case"embed":D("load",e),l=r;break;case"video":case"audio":for(l=0;ltn&&(t.flags|=128,r=!0,mn(u,!1),t.lanes=4194304)}else{if(!r)if(e=Kr(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mn(u,!0),u.tail===null&&u.tailMode==="hidden"&&!o.alternate&&!F)return te(t),null}else 2*W()-u.renderingStartTime>tn&&n!==1073741824&&(t.flags|=128,r=!0,mn(u,!1),t.lanes=4194304);u.isBackwards?(o.sibling=t.child,t.child=o):(n=u.last,n!==null?n.sibling=o:t.child=o,u.last=o)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=W(),t.sibling=null,n=U.current,M(U,r?n&1|2:n&1),t):(te(t),null);case 22:case 23:return No(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pe&1073741824&&(te(t),t.subtreeFlags&6&&(t.flags|=8192)):te(t),null;case 24:return null;case 25:return null}throw Error(y(156,t.tag))}function yd(e,t){switch(oo(t),t.tag){case 1:return fe(t.type)&&$r(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bt(),I(ce),I(re),ho(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vo(t),null;case 13:if(I(U),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(y(340));Jt()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(U),null;case 4:return bt(),null;case 10:return co(t.type._context),null;case 22:case 23:return No(),null;case 24:return null;default:return null}}var vr=!1,ne=!1,gd=typeof WeakSet=="function"?WeakSet:Set,k=null;function Vt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){V(e,t,r)}else n.current=null}function Ru(e,t,n){try{n()}catch(r){V(e,t,r)}}var Ii=!1;function wd(e,t){if(mu=Ir,e=Ks(),lo(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var o=0,i=-1,s=-1,c=0,v=0,m=e,p=null;t:for(;;){for(var g;m!==n||l!==0&&m.nodeType!==3||(i=o+l),m!==u||r!==0&&m.nodeType!==3||(s=o+r),m.nodeType===3&&(o+=m.nodeValue.length),(g=m.firstChild)!==null;)p=m,m=g;for(;;){if(m===e)break t;if(p===n&&++c===l&&(i=o),p===u&&++v===r&&(s=o),(g=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=g}n=i===-1||s===-1?null:{start:i,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(vu={focusedElem:e,selectionRange:n},Ir=!1,k=t;k!==null;)if(t=k,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,k=e;else for(;k!==null;){t=k;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,j=w.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:Ne(t.type,S),j);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(y(163))}}catch(h){V(t,t.return,h)}if(e=t.sibling,e!==null){e.return=t.return,k=e;break}k=t.return}return w=Ii,Ii=!1,w}function Pn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var u=l.destroy;l.destroy=void 0,u!==void 0&&Ru(t,n,u)}l=l.next}while(l!==r)}}function cl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ou(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ba(e){var t=e.alternate;t!==null&&(e.alternate=null,Ba(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ie],delete t[$n],delete t[gu],delete t[td],delete t[nd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ha(e){return e.tag===5||e.tag===3||e.tag===4}function ji(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ha(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ur));else if(r!==4&&(e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Du(e,t,n),e=e.sibling;e!==null;)Du(e,t,n),e=e.sibling}var J=null,ze=!1;function Xe(e,t,n){for(n=n.child;n!==null;)Wa(e,t,n),n=n.sibling}function Wa(e,t,n){if(je&&typeof je.onCommitFiberUnmount=="function")try{je.onCommitFiberUnmount(nl,n)}catch{}switch(n.tag){case 5:ne||Vt(n,t);case 6:var r=J,l=ze;J=null,Xe(e,t,n),J=r,ze=l,J!==null&&(ze?(e=J,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):J.removeChild(n.stateNode));break;case 18:J!==null&&(ze?(e=J,n=n.stateNode,e.nodeType===8?jl(e.parentNode,n):e.nodeType===1&&jl(e,n),Dn(e)):jl(J,n.stateNode));break;case 4:r=J,l=ze,J=n.stateNode.containerInfo,ze=!0,Xe(e,t,n),J=r,ze=l;break;case 0:case 11:case 14:case 15:if(!ne&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var u=l,o=u.destroy;u=u.tag,o!==void 0&&(u&2||u&4)&&Ru(n,t,o),l=l.next}while(l!==r)}Xe(e,t,n);break;case 1:if(!ne&&(Vt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(i){V(n,t,i)}Xe(e,t,n);break;case 21:Xe(e,t,n);break;case 22:n.mode&1?(ne=(r=ne)||n.memoizedState!==null,Xe(e,t,n),ne=r):Xe(e,t,n);break;default:Xe(e,t,n)}}function Fi(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new gd),t.forEach(function(r){var l=zd.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Pe(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~u}if(r=l,r=W()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*kd(r/1960))-r,10e?16:e,et===null)var r=!1;else{if(e=et,et=null,Jr=0,R&6)throw Error(y(331));var l=R;for(R|=4,k=e.current;k!==null;){var u=k,o=u.child;if(k.flags&16){var i=u.deletions;if(i!==null){for(var s=0;sW()-xo?kt(e,0):Co|=n),de(e,t)}function qa(e,t){t===0&&(e.mode&1?(t=or,or<<=1,!(or&130023424)&&(or=4194304)):t=1);var n=ue();e=Qe(e,t),e!==null&&(Yn(e,t,n),de(e,n))}function Nd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qa(e,n)}function zd(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(y(314))}r!==null&&r.delete(t),qa(e,n)}var ba;ba=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ce.current)ae=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ae=!1,vd(e,t,n);ae=!!(e.flags&131072)}else ae=!1,F&&t.flags&1048576&&ra(t,Br,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Pr(e,t),e=t.pendingProps;var l=Zt(t,re.current);Yt(t,n),l=go(null,t,r,e,l,n);var u=wo();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,fe(r)?(u=!0,Ar(t)):u=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,po(t),l.updater=al,t.stateNode=l,l._reactInternals=t,Cu(t,r,e,n),t=Nu(null,t,r,!0,u,n)):(t.tag=0,F&&u&&uo(t),le(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Pr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Ld(r),e=Ne(r,e),l){case 0:t=Pu(null,t,r,e,n);break e;case 1:t=Oi(null,t,r,e,n);break e;case 11:t=Li(null,t,r,e,n);break e;case 14:t=Ri(null,t,r,Ne(r.type,e),n);break e}throw Error(y(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Pu(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Oi(e,t,r,l,n);case 3:e:{if(ja(t),e===null)throw Error(y(387));r=t.pendingProps,u=t.memoizedState,l=u.element,aa(e,t),Qr(t,r,null,n);var o=t.memoizedState;if(r=o.element,u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){l=en(Error(y(423)),t),t=Mi(e,t,r,n,l);break e}else if(r!==l){l=en(Error(y(424)),t),t=Mi(e,t,r,n,l);break e}else for(me=lt(t.stateNode.containerInfo.firstChild),ve=t,F=!0,Te=null,n=ia(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Jt(),r===l){t=Ke(e,t,n);break e}le(e,t,r,n)}t=t.child}return t;case 5:return ca(t),e===null&&ku(t),r=t.type,l=t.pendingProps,u=e!==null?e.memoizedProps:null,o=l.children,hu(r,l)?o=null:u!==null&&hu(r,u)&&(t.flags|=32),Ia(e,t),le(e,t,o,n),t.child;case 6:return e===null&&ku(t),null;case 13:return Fa(e,t,n);case 4:return mo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qt(t,null,r,n):le(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Li(e,t,r,l,n);case 7:return le(e,t,t.pendingProps,n),t.child;case 8:return le(e,t,t.pendingProps.children,n),t.child;case 12:return le(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,u=t.memoizedProps,o=l.value,M(Hr,r._currentValue),r._currentValue=o,u!==null)if(Oe(u.value,o)){if(u.children===l.children&&!ce.current){t=Ke(e,t,n);break e}}else for(u=t.child,u!==null&&(u.return=t);u!==null;){var i=u.dependencies;if(i!==null){o=u.child;for(var s=i.firstContext;s!==null;){if(s.context===r){if(u.tag===1){s=Be(-1,n&-n),s.tag=2;var c=u.updateQueue;if(c!==null){c=c.shared;var v=c.pending;v===null?s.next=s:(s.next=v.next,v.next=s),c.pending=s}}u.lanes|=n,s=u.alternate,s!==null&&(s.lanes|=n),Eu(u.return,n,t),i.lanes|=n;break}s=s.next}}else if(u.tag===10)o=u.type===t.type?null:u.child;else if(u.tag===18){if(o=u.return,o===null)throw Error(y(341));o.lanes|=n,i=o.alternate,i!==null&&(i.lanes|=n),Eu(o,n,t),o=u.sibling}else o=u.child;if(o!==null)o.return=u;else for(o=u;o!==null;){if(o===t){o=null;break}if(u=o.sibling,u!==null){u.return=o.return,o=u;break}o=o.return}u=o}le(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yt(t,n),l=_e(l),r=r(l),t.flags|=1,le(e,t,r,n),t.child;case 14:return r=t.type,l=Ne(r,t.pendingProps),l=Ne(r.type,l),Ri(e,t,r,l,n);case 15:return Ma(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ne(r,l),Pr(e,t),t.tag=1,fe(r)?(e=!0,Ar(t)):e=!1,Yt(t,n),La(t,r,l),Cu(t,r,l,n),Nu(null,t,r,!0,e,n);case 19:return Ua(e,t,n);case 22:return Da(e,t,n)}throw Error(y(156,t.tag))};function ec(e,t){return Ns(e,t)}function Td(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ke(e,t,n,r){return new Td(e,t,n,r)}function To(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ld(e){if(typeof e=="function")return To(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yu)return 11;if(e===Xu)return 14}return 2}function st(e,t){var n=e.alternate;return n===null?(n=ke(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Tr(e,t,n,r,l,u){var o=2;if(r=e,typeof e=="function")To(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ot:return Et(n.children,l,u,t);case Ku:o=8,l|=8;break;case Xl:return e=ke(12,n,t,l|2),e.elementType=Xl,e.lanes=u,e;case Gl:return e=ke(13,n,t,l),e.elementType=Gl,e.lanes=u,e;case Zl:return e=ke(19,n,t,l),e.elementType=Zl,e.lanes=u,e;case cs:return dl(n,l,u,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ss:o=10;break e;case as:o=9;break e;case Yu:o=11;break e;case Xu:o=14;break e;case Ge:o=16,r=null;break e}throw Error(y(130,e==null?e:typeof e,""))}return t=ke(o,n,t,l),t.elementType=e,t.type=r,t.lanes=u,t}function Et(e,t,n,r){return e=ke(7,e,r,t),e.lanes=n,e}function dl(e,t,n,r){return e=ke(22,e,r,t),e.elementType=cs,e.lanes=n,e.stateNode={isHidden:!1},e}function Wl(e,t,n){return e=ke(6,e,null,t),e.lanes=n,e}function Ql(e,t,n){return t=ke(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Rd(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xl(0),this.expirationTimes=xl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Lo(e,t,n,r,l,u,o,i,s){return e=new Rd(e,t,n,i,s),t===1?(t=1,u===!0&&(t|=8)):t=0,u=ke(3,null,null,t),e.current=u,u.stateNode=e,u.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},po(u),e}function Od(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(lc)}catch(e){console.error(e)}}lc(),ls.exports=ye;var Fd=ls.exports,Ud,Qi=Fd;Ud=Kl.createRoot=Qi.createRoot,Kl.hydrateRoot=Qi.hydrateRoot;const Jn={GBadge:"https://uikit.d.aiengines.ir/GBadge.js",Pagination:"https://uikit.d.aiengines.ir/Pagination.js",AppHeader:"https://uikit.d.aiengines.ir/AppHeader.js",AppSidebar:"https://uikit.d.aiengines.ir/AppSidebar.js",SegmentedSelector:"https://uikit.d.aiengines.ir/SegmentedSelector.js"},Vd="__UIKIT_REMOTE_DEPS__",Bd="__UIKIT_REACT_REMOTE_DEPS__",qn=window.location.origin;Jn.AppHeader=`${qn}/AppHeader.js`;Jn.AppSidebar=`${qn}/AppSidebar.js`;Jn.SegmentedSelector=`${qn}/SegmentedSelector.js`;Jn.Pagination=`${qn}/Pagination.js`;Jn.GBadge=`${qn}/GBadge.js`;ac(async()=>{const{default:e}=await import("./AppHeaderPreview-DOKJC5wC.js");return{default:e}},[],import.meta.url).then(({default:e})=>{Kl.createRoot(document.getElementById("root")).render($o.jsx(ns.StrictMode,{children:$o.jsx(e,{})}))});export{Jn as D,Ad as R,Fd as a,Ud as b,$d as c,ns as d,Vd as e,Bd as f,cc as g,$o as j,tl as r}; diff --git a/dist/remote/index.html b/dist/remote/index.html index a6d0999..39ec6e0 100644 --- a/dist/remote/index.html +++ b/dist/remote/index.html @@ -5,7 +5,7 @@ UI Kit Remote Demo - +
diff --git a/package.json b/package.json index cbea165..714bbf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uikit", - "version": "1.2.4", + "version": "1.2.5", "type": "module", "main": "./dist/index.js", "module": "./dist/index.js", diff --git a/src/chakra/index.jsx b/src/chakra/index.jsx index f54e8c1..f10a260 100644 --- a/src/chakra/index.jsx +++ b/src/chakra/index.jsx @@ -1,11 +1,12 @@ "use client"; import React, { useEffect } from "react"; -import { extendTheme, withDefaultColorScheme, ChakraProvider, Badge, Button, HStack, IconButton, Input, Text } from "@chakra-ui/react"; +import { extendTheme, withDefaultColorScheme, ChakraProvider, Spinner, Badge, Button, HStack, IconButton, Input, Text } from "@chakra-ui/react"; import { Global } from "@emotion/react"; import { createRoot } from "react-dom/client"; import fontUrl from "../assets/fonts/estedad.woff2?url"; import { defineFeature } from "../internal/feature-registry.jsx"; +import { ChakraLoadingContext } from "../internal/provider-runtime.jsx"; export const defaultBiTheme = extendTheme({ direction: "rtl", @@ -54,8 +55,10 @@ function ChakraLayer({ children, theme = defaultBiTheme, fonts = true, remoteUiE }, [remoteUiEnabled, theme, remoteUiChakraProviderProps]); return - {fonts && } - {children} + }> + {fonts && } + {children} + ; } diff --git a/src/dev/AppHeaderPreview.jsx b/src/dev/AppHeaderPreview.jsx index d5e62be..6570cad 100644 --- a/src/dev/AppHeaderPreview.jsx +++ b/src/dev/AppHeaderPreview.jsx @@ -283,6 +283,8 @@ export function Providers({ children }) { // url="https://auth.example.com" // realm="my-realm" // initOptions={{ onLoad: "login-required" }} + // اگر Chakra در همین BiProvider باشد، loading پیش‌فرض Spinner است. + // نمونه سفارشی با اولویت بالاتر: loading={Loading auth...} errorFallback={Auth failed} onError={(error) => console.error(error)} @@ -366,6 +368,8 @@ export function Providers({ children }) { getToken={() => localStorage.getItem("access_token")} // url="https://api.example.com/permissions/list" // storageKey="permissions:permission-client:my-user" + // اگر Chakra در همین BiProvider باشد، loading پیش‌فرض Spinner است. + // نمونه سفارشی با اولویت بالاتر: loading={Loading permissions...} errorFallback={Permission error} /> @@ -935,6 +939,7 @@ function ProviderDocs() { clientId برای Keycloak و Permission اجباری است. آدرس API و شناسه‌ها را با مقادیر سامانه جایگزین کنید. ترتیب نوشتن markerها مهم نیست؛ ترتیب اجرای واقعی: Chakra ← Query ← Router ← Keycloak ← Api ← Permission ← App. + با حضور Chakra، لودینگ Keycloak و Permission به‌صورت پیش‌فرض Spinner است؛ نیازی به ارسال loading نیست و loading سفارشی (حتی null) اولویت دارد. @@ -985,6 +990,7 @@ function ProviderDocs() { • uikit/api → Api: baseUrl، auth، getToken، axiosConfig، onUnauthorized، logoutOnUnauthorized (پیش‌فرض false)؛ نیازمند Axios، قابل مصرف با useApi. • uikit/permission → Permission: clientId اجباری، url، user، getToken، storageKey، loading، errorFallback و enabled؛ بدون کتابخانه اضافه، قابل مصرف با usePermission و Can. • اولویت احراز هویت هر دو ماژول: توکن Keycloak، سپس خروجی getToken() و در نبود هر دو درخواست بدون Bearer. در Api با auth={false} تزریق توکن غیرفعال می‌شود. + • Loading پیش‌فرض با حضور Chakra: هر دو ماژول Keycloak و Permission خودکار Chakra Spinner نشان می‌دهند؛ loading ارسالی (حتی null) اولویت دارد. بدون Chakra، رفتار قبلی حفظ می‌شود. • uikit/next-pages-router و uikit/next-app-router: فقط یکی را انتخاب کنید؛ نیازمند next-query-params و use-query-params. • uikit/vite → Vite: اختیاری و بدون تنظیم اضافه. • uikit/update-checker → Updates: endpoint (پیش‌فرض /version.json)، interval (پیش‌فرض 30000ms) و message. diff --git a/src/internal/provider-runtime.jsx b/src/internal/provider-runtime.jsx index 6296ee5..8eec900 100644 --- a/src/internal/provider-runtime.jsx +++ b/src/internal/provider-runtime.jsx @@ -4,6 +4,9 @@ import { createContext, useContext } from "react"; export const KeycloakContext = createContext(null); export const ApiContext = createContext(null); +// Optional loading UI from . React-only so Keycloak and Permission +// remain usable without installing or enabling Chakra. +export const ChakraLoadingContext = createContext(undefined); export function useKeycloakOptional() { return useContext(KeycloakContext); diff --git a/src/keycloak/index.d.ts b/src/keycloak/index.d.ts index 0d00c9b..258723d 100644 --- a/src/keycloak/index.d.ts +++ b/src/keycloak/index.d.ts @@ -5,6 +5,7 @@ export interface KeycloakProps { url?: string; realm?: string; initOptions?: Record; + /** Defaults to Chakra Spinner when is present; otherwise null. Explicit null disables it. */ loading?: ReactNode; errorFallback?: ReactNode; allowUnauthenticated?: boolean; diff --git a/src/keycloak/index.jsx b/src/keycloak/index.jsx index b4a0a0e..e91dd45 100644 --- a/src/keycloak/index.jsx +++ b/src/keycloak/index.jsx @@ -1,9 +1,9 @@ "use client"; -import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import KeycloakClient from "keycloak-js"; import { defineFeature } from "../internal/feature-registry.jsx"; -import { KeycloakContext, useKeycloak } from "../internal/provider-runtime.jsx"; +import { ChakraLoadingContext, KeycloakContext, useKeycloak } from "../internal/provider-runtime.jsx"; import { setKeycloakLogoutHandler } from "../core/runtime.jsx"; function KeycloakLayer({ @@ -12,12 +12,14 @@ function KeycloakLayer({ url = "https://auth.ibagher.ir", realm = "bi", initOptions, - loading = null, + loading, errorFallback = null, allowUnauthenticated = false, onError, }) { if (!clientId) throw new Error(" requires clientId."); + const chakraLoading = useContext(ChakraLoadingContext); + const loadingContent = loading !== undefined ? loading : (chakraLoading ?? null); const client = useMemo( () => new KeycloakClient({ url, realm, clientId }), @@ -79,7 +81,7 @@ function KeycloakLayer({ login, logout, updateToken, }), [client, state, login, logout, updateToken]); - if (!value.initialized) return loading; + if (!value.initialized) return loadingContent; if (value.error) return errorFallback; if (!value.authenticated && !allowUnauthenticated) return null; return {children}; diff --git a/src/permission/index.d.ts b/src/permission/index.d.ts index d7dd706..8084c7f 100644 --- a/src/permission/index.d.ts +++ b/src/permission/index.d.ts @@ -7,6 +7,7 @@ export interface PermissionProps { /** Used only when Keycloak has no token. Otherwise the permission request is unauthenticated. */ getToken?: () => string | null | Promise; storageKey?: string; + /** Defaults to Chakra Spinner when is present; otherwise legacy text. Explicit null disables it. */ loading?: ReactNode; errorFallback?: ReactNode; enabled?: boolean; diff --git a/src/permission/index.jsx b/src/permission/index.jsx index 50fae3e..1ed93d2 100644 --- a/src/permission/index.jsx +++ b/src/permission/index.jsx @@ -1,8 +1,8 @@ "use client"; -import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; import { defineFeature } from "../internal/feature-registry.jsx"; -import { useKeycloakOptional } from "../internal/provider-runtime.jsx"; +import { ChakraLoadingContext, useKeycloakOptional } from "../internal/provider-runtime.jsx"; // The shared context is React-only and is also consumed by existing uikit/layout. import { PermissionContext, usePermission } from "../core/runtime.jsx"; @@ -47,11 +47,15 @@ function PermissionLayer({ user = null, getToken, storageKey, - loading =
Loading permissions...
, + loading, errorFallback =
Error loading permissions
, enabled = true, }) { if (!clientId) throw new Error(" requires clientId."); + const chakraLoading = useContext(ChakraLoadingContext); + const loadingContent = loading !== undefined + ? loading + : (chakraLoading ??
Loading permissions...
); const keycloak = useKeycloakOptional(); // Never reuse one user's cached permissions for another authenticated user. const identity = keycloak?.instance?.tokenParsed?.sub ?? user?.id ?? "anonymous"; @@ -121,7 +125,7 @@ function PermissionLayer({ refresh, clear, }), [user, permissions, can, cannot, current.isLoading, current.error, refresh, clear]); - if (current.isLoading && !permissions) return loading; + if (current.isLoading && !permissions) return loadingContent; if (current.error && !permissions) return errorFallback; return {children}; }