diff --git a/client/src/app/settings/edit.tsx b/client/src/app/settings/edit.tsx index 0ec8174..a665324 100644 --- a/client/src/app/settings/edit.tsx +++ b/client/src/app/settings/edit.tsx @@ -19,6 +19,11 @@ import { Form, Input, Label, + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, Switch, } from "@/ui"; @@ -27,6 +32,7 @@ import { AlertCircleIcon } from "lucide-react"; import { useMemo, useState } from "react"; import { Controller, SubmitHandler, useForm } from "react-hook-form"; import { Trans } from "react-i18next"; +import { useTranslation } from "react-i18next"; import { useUnsavedChangesNotifier } from "@/lib/hooks"; import { cn } from "@/lib/utils"; @@ -40,11 +46,13 @@ export const SettingsEditor = () => { const [activeSection, setActiveSection] = useState("profile"); const { useOne, useUpdate, useUploadLogo } = useSettings(); const { toast } = useToast(); + const { i18n } = useTranslation(); const { data, status, error: queryError } = useOne(); const defaultValues = useMemo( () => ({ + lang_code: "es", contact_information: "", default_payment_method: "", default_notes: "", @@ -65,7 +73,7 @@ export const SettingsEditor = () => { const form = useForm({ mode: "onBlur", - values: data?.dealer, + values: data ? { ...data.dealer, lang_code: data.lang_code } : undefined, defaultValues, /*resolver: joiResolver( Joi.object({ @@ -130,6 +138,9 @@ export const SettingsEditor = () => { }, //onSettled: () => {}, onSuccess: () => { + if (i18n.language !== data.lang_code) { + void i18n.changeLanguage(data.lang_code ?? "es"); + } reset(getValues()); toast({ description: "Ajustes guardados", variant: "success" }); }, @@ -189,6 +200,38 @@ export const SettingsEditor = () => {
+ + + + + + + + + + + ( + + )} + /> + + + + + diff --git a/client/src/app/settings/hooks/useSettings.tsx b/client/src/app/settings/hooks/useSettings.tsx index 089a623..45e7863 100644 --- a/client/src/app/settings/hooks/useSettings.tsx +++ b/client/src/app/settings/hooks/useSettings.tsx @@ -17,11 +17,13 @@ export type UseSettingsGetParamsType = { export const useSettings = (params?: UseSettingsGetParamsType) => { const dataSource = useDataSource(); const keys = useQueryKey(); + const settingsQueryKey = keys().data().resource("settings").action("one").id("me").params().get(); + const profileQueryKey = keys().auth().action("profile").get(); return { useOne: () => useOne({ - queryKey: keys().data().resource("settings").action("one").id("me").params().get(), + queryKey: settingsQueryKey, queryFn: () => dataSource.getOne({ resource: "profile", @@ -34,7 +36,7 @@ export const useSettings = (params?: UseSettingsGetParamsType) => { const queryClient = useQueryClient(); return useMutation({ - mutationKey: keys().data().resource("settings").action("one").id("me").params().get(), + mutationKey: settingsQueryKey, mutationFn: (data) => { return dataSource.updateOne({ resource: "profile", @@ -42,10 +44,23 @@ export const useSettings = (params?: UseSettingsGetParamsType) => { id: "", }); }, - onSuccess: () => { - queryClient.invalidateQueries({ - queryKey: ["data", "default", "settings"], - }); + onSuccess: (updatedDealer, variables) => { + const updateCachedProfile = (profile: IGetProfileResponse_DTO | undefined) => + profile + ? { + ...profile, + lang_code: variables.lang_code ?? profile.lang_code, + dealer: { ...profile.dealer, ...updatedDealer }, + } + : profile; + + queryClient.setQueryData(settingsQueryKey, updateCachedProfile); + queryClient.setQueryData(profileQueryKey, updateCachedProfile); + + return Promise.all([ + queryClient.invalidateQueries({ queryKey: settingsQueryKey }), + queryClient.invalidateQueries({ queryKey: profileQueryKey }), + ]); }, }); }, diff --git a/client/src/components/ProtectedRoute/ProtectedRoute.test.tsx b/client/src/components/ProtectedRoute/ProtectedRoute.test.tsx index 1247156..7f5efb7 100644 --- a/client/src/components/ProtectedRoute/ProtectedRoute.test.tsx +++ b/client/src/components/ProtectedRoute/ProtectedRoute.test.tsx @@ -5,6 +5,7 @@ import { ProtectedRoute } from "./ProtectedRoute"; const useIsLoggedIn = jest.fn(); const useGetProfile = jest.fn(); +const changeLanguage = jest.fn(); jest.mock("@/lib/hooks", () => ({ useIsLoggedIn: () => useIsLoggedIn(), @@ -16,6 +17,10 @@ jest.mock("@/components", () => ({ LoadingOverlay: () =>
, })); +jest.mock("react-i18next", () => ({ + useTranslation: () => ({ i18n: { language: "en", changeLanguage } }), +})); + const renderProtectedRoute = () => { const container = document.createElement("div"); document.body.appendChild(container); @@ -48,6 +53,7 @@ describe("ProtectedRoute", () => { }); beforeEach(() => { + changeLanguage.mockClear(); useIsLoggedIn.mockReturnValue({ isSuccess: true, isLoading: false, @@ -80,6 +86,7 @@ describe("ProtectedRoute", () => { const container = renderProtectedRoute(); expect(container.querySelector("[data-testid='quotes']")).not.toBeNull(); + expect(changeLanguage).toHaveBeenCalledWith("es"); }); it("renders an error instead of treating a profile request failure as a logout", () => { diff --git a/client/src/components/ProtectedRoute/ProtectedRoute.tsx b/client/src/components/ProtectedRoute/ProtectedRoute.tsx index eeeaffe..fd863e3 100644 --- a/client/src/components/ProtectedRoute/ProtectedRoute.tsx +++ b/client/src/components/ProtectedRoute/ProtectedRoute.tsx @@ -1,6 +1,7 @@ import { ErrorOverlay, LoadingOverlay } from "@/components"; import { useGetProfile, useIsLoggedIn } from "@/lib/hooks"; import React, { useId } from "react"; +import { useTranslation } from "react-i18next"; import { Navigate, useLocation } from "react-router-dom"; type ProctectRouteProps = { @@ -9,7 +10,7 @@ type ProctectRouteProps = { export const ProtectedRoute = ({ children }: ProctectRouteProps) => { const location = useLocation(); - //const { i18n } = useTranslation(); + const { i18n } = useTranslation(); const id = useId(); const { @@ -28,12 +29,11 @@ export const ProtectedRoute = ({ children }: ProctectRouteProps) => { enabled: isLoggedInSuccess && authenticated, }); - // Cambiamos el idioma de la aplicación si es necesario - /*React.useEffect(() => { + React.useEffect(() => { if (isProfileSuccess && profile?.lang_code && i18n.language !== profile.lang_code) { - i18n.changeLanguage(profile.lang_code); + void i18n.changeLanguage(profile.lang_code); } - }, [isProfileSuccess, profile?.lang_code, i18n]);*/ + }, [isProfileSuccess, profile?.lang_code, i18n]); if (isLoggedInLoading || isProfileLoading || (isProfileSuccess && profile === null && isProfileFetching)) { return ; diff --git a/client/src/locales/en.json b/client/src/locales/en.json index 1244429..1b0667c 100644 --- a/client/src/locales/en.json +++ b/client/src/locales/en.json @@ -438,6 +438,11 @@ } }, "form_fields": { + "language": { + "label": "Language", + "placeholder": "Select a language", + "desc": "Preferred language for the interface" + }, "image": { "label": "Logotype", "placeholder": "", @@ -485,4 +490,4 @@ } } } -} \ No newline at end of file +} diff --git a/client/src/locales/es.json b/client/src/locales/es.json index 51700ea..1842d3d 100644 --- a/client/src/locales/es.json +++ b/client/src/locales/es.json @@ -440,6 +440,11 @@ } }, "form_fields": { + "language": { + "label": "Idioma", + "placeholder": "Selecciona un idioma", + "desc": "Idioma preferido para la interfaz" + }, "logo": { "label": "Logotipo", "placeholder": "", @@ -498,4 +503,4 @@ "form_fields": {} } } -} \ No newline at end of file +} diff --git a/dist/client/assets/index-BVZyG6kc.js b/dist/client/assets/index-BVZyG6kc.js new file mode 100644 index 0000000..31743d8 --- /dev/null +++ b/dist/client/assets/index-BVZyG6kc.js @@ -0,0 +1,254 @@ +var L_=Object.defineProperty;var T_=(n,o,r)=>o in n?L_(n,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[o]=r;var Se=(n,o,r)=>T_(n,typeof o!="symbol"?o+"":o,r);import{u as Ec,a as Jt,b as en,c as Mn,d as Ne,j as i,P as O_,e as P_,f as ge,g as k_,N as Wi,R as Pe,J as Rt,h as ke,i as er,D as tr,l as La,M as Lt,V as q_,r as T,k as Ac,m as Fc,n as ir,o as Ic,B as U,C as $_,p as sr,q as ar,s as or,S as ao,t as lr,v as Bi,w,x as oo,y as Yi,z as Qi,A as Xi,E as Or,F as lo,G as Zi,H as Ji,I as es,K as ts,L as z_,O as Dn,Q as V_,T as B_,U as U_,W as Te,X as ct,Y as Ve,Z as He,_ as Oe,$ as hn,a0 as uo,a1 as G_,a2 as co,a3 as pn,a4 as fo,a5 as go,a6 as qr,a7 as Nt,a8 as Dc,a9 as H_,aa as Ui,ab as ur,ac as mo,ad as ho,ae as po,af as xo,ag as Mc,ah as vo,ai as _o,aj as bo,ak as ns,al as K_,am as Fn,an as rs,ao as fc,ap as W_,aq as Y_,ar as Q_,as as wo,at as zt,au as _n,av as is,aw as Lc,ax as In,ay as X_,az as Tc,aA as Z_,aB as se,aC as ss,aD as gc,aE as Oc,aF as Pc,aG as kc,aH as Ln,aI as qc,aJ as as,aK as zr,aL as Vr,aM as Br,aN as $r,aO as J_,aP as $c,aQ as Ke,aR as We,aS as Wa,aT as Ye,aU as nr,aV as cr,aW as rr,aX as e0,aY as t0,aZ as n0,a_ as Ya,a$ as r0,b0 as i0,b1 as Zn,b2 as zc,b3 as Qa,b4 as Vc,b5 as qt,b6 as s0,b7 as mc,b8 as os,b9 as dr,ba as Bc,bb as a0,bc as So,bd as o0,be as Uc,bf as Gc,bg as Hc,bh as Kc,bi as Wc,bj as Yc,bk as Qc,bl as Xc,bm as Zc,bn as l0,bo as Pi,bp as u0,bq as c0,br as d0,bs as f0,bt as g0,bu as m0,bv as h0,bw as p0,bx as x0,by as v0,bz as _0,bA as hc,bB as Jc,bC as ed,bD as td,bE as nd,bF as rd,bG as id,bH as sd,bI as b0,bJ as Ta,bK as w0,bL as S0,bM as j0,bN as ad,bO as od,bP as Xa,bQ as Za,bR as C0,bS as Oa,bT as y0,bU as N0,bV as pc}from"./index-QDyDWtz5.js";const R0=n=>{const{onSuccess:o,...r}=n||{},a=Mn(),{login:l}=Ec(),c=Jt();return en({mutationKey:a().auth().action("login").get(),mutationFn:l,onSuccess:async(d,h,p)=>{d.success&&c.removeQueries({queryKey:a().auth().get()}),await(o==null?void 0:o(d,h,p))},...r})};/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ld=Ne("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const E0=Ne("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xc=Ne("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vc=Ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const A0=Ne("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const F0=Ne("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ud=Ne("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I0=Ne("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const D0=Ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M0=Ne("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jo=Ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cd=Ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L0=Ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dd=Ne("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const T0=Ne("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O0=Ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fd=Ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const P0=Ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Co=Ne("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yo=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const k0=Ne("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q0=Ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $0=Ne("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gd=Ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** + * @license lucide-react v0.427.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const md=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),z0=({className:n,...o})=>i.jsx(P_,{className:ge("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),...o}),_c=O_,V0=({withHandle:n,className:o,...r})=>i.jsx(k_,{className:ge("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",o),...r,children:n&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(fd,{className:"h-2.5 w-2.5"})})});function ut({className:n,...o}){return i.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",n),...o})}const B0=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("total_items");let ki;const U0=new Uint8Array(16);function G0(){if(!ki&&(ki=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ki))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ki(U0)}const Ge=[];for(let n=0;n<256;++n)Ge.push((n+256).toString(16).slice(1));function H0(n,o=0){return Ge[n[o+0]]+Ge[n[o+1]]+Ge[n[o+2]]+Ge[n[o+3]]+"-"+Ge[n[o+4]]+Ge[n[o+5]]+"-"+Ge[n[o+6]]+Ge[n[o+7]]+"-"+Ge[n[o+8]]+Ge[n[o+9]]+"-"+Ge[n[o+10]]+Ge[n[o+11]]+Ge[n[o+12]]+Ge[n[o+13]]+Ge[n[o+14]]+Ge[n[o+15]]}const K0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),bc={randomUUID:K0};function W0(n,o,r){if(bc.randomUUID&&!n)return bc.randomUUID();n=n||{};const a=n.random||(n.rng||G0)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,H0(a)}class dn extends Wi{static validate(o,r){const a=Pe.RULE_ALLOW_EMPTY.default(""),l=Rt.string().guid({version:["uuidv4"]}).label(r.label?r.label:"id"),c=Rt.alternatives(a,l);return Pe.validate(c,o)}static sanitize(o){return o.trim()}static create(o,r={}){const a={label:"id",generateOnEmpty:!1,...r};if(!o&&!a.generateOnEmpty)return ke.fail(er(tr.INVALID_INPUT_DATA,"ID is null or empty"));if(o){const l=dn.validate(o,a);return l.isFailure?ke.fail(er(tr.INVALID_INPUT_DATA,l.error.message,a)):ke.ok(new dn(dn.sanitize(l.object)))}return a.generateOnEmpty?dn.generateNewID():ke.ok(new dn(null))}static generateNewID(){return ke.ok(new dn(W0()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}const Pa={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},fn=class fn extends Wi{constructor(){super(...arguments);Se(this,"toString",()=>this.code)}static validate(r,a){const l=Rt.alternatives(Pe.RULE_ALLOW_EMPTY.default(""),Rt.string().lowercase().valid(...Object.keys(Pa)).label(String(a.label)));return Pe.validate(l,r)}static sanitize(r){return r?String(r).toLowerCase():void 0}static createFromCode(r,a={}){const l={...a,label:a.label?a.label:"lang_code"},c=fn.validate(r,l);if(c.isFailure)return ke.fail(er(tr.INVALID_INPUT_DATA,c.error.message,l));const d=fn.sanitize(c.object),h=d?{...Pa[c.object],code:d}:void 0;return ke.ok(new fn(h))}static createDefaultCode(){return fn.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Se(fn,"DEFAULT_LANGUAGE_CODE","es"),Se(fn,"LANGUAGES",Pa);let Pr=fn;class hd{constructor(o){Se(this,"_collection",[]);this._collection=o??[]}add(o){this._collection.push(o)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(o=>o.isFailure)}getFirstFaultyResult(){return this._collection.find(o=>o.isFailure)}getAllFaultyResults(){return this._collection.filter(o=>o.isFailure)}get objects(){return this._collection.filter(o=>o.isSuccess).map(o=>o.object)}get errors(){return this._collection.filter(o=>o.isFailure).map(o=>o.error)}}const pd=2,ka={amount:0,scale:pd},xe=class xe extends Wi{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,h=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Rt.number().min(xe.MIN_SCALE).max(xe.MAX_SCALE).label(l.label?l.label:"scale"),v=new hd([Pe.validate(Rt.alternatives(c,d,h,p),r),Pe.validate(Rt.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);if(v.hasSomeFaultyResult())return v.getFirstFaultyResult();let R=typeof r=="string"?parseInt(r,10):Number(r),N=La.isNull(a)?xe.DEFAULT_SCALE:Number(a);const b=R/Math.pow(10,N);return bxe.MAX_VALUE?ke.fail(new Error(`Value with scale is out of range: ${b}`)):ke.ok()}static create(r=ka,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=ka.amount,scale:c=ka.scale}=r,d={label:"percentage",...a},h=xe.validate(l,c,d);if(h.isFailure)return ke.fail(er(tr.INVALID_INPUT_DATA,h.error.message,d));let p=xe._sanitize(l);const x={amount:La.isNull(p)?0:p,scale:c};return ke.ok(new this(x,La.isNull(p),a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return xe.create({amount:null,scale:xe.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let h=c,p=2;return d===void 0?p=0:(d===""&&(h=c+d.padEnd(1,"0"),p=1),d.length===1?(h=c+d.padEnd(1,"0"),p=1):d.length===2&&(h=c+d.padEnd(2,"0"),p=2)),xe.create({amount:h,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}static _isWithinRange(r,a){const l=Number(xe._toString(r,a));return l>=xe.MIN_VALUE&&l<=xe.MAX_VALUE}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return xe._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==xe.DEFAULT_SCALE?this.convertScale(xe.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rxe.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new xe({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);if(!xe._isWithinRange(d,r))throw new Error(`Value out of range after conversion: ${d} ${r}`);return new xe({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}isWithinRange(){return xe._isWithinRange(this.amount,this.scale)}};Se(xe,"DEFAULT_SCALE",pd),Se(xe,"MIN_VALUE",0),Se(xe,"MAX_VALUE",100),Se(xe,"MIN_SCALE",0),Se(xe,"MAX_SCALE",2);let $t=xe;const xd=2,qa={amount:0,scale:xd},ve=class ve extends Wi{constructor(r,a,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(a),this._options=Object.freeze(l)}static validate(r,a,l={}){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,h=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Rt.number().min(ve.MIN_SCALE).max(ve.MAX_SCALE).label(l.label?l.label:"scale"),v=new hd([Pe.validate(Rt.alternatives(c,d,h,p),r),Pe.validate(Rt.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),a)]);return v.hasSomeFaultyResult()?v.getFirstFaultyResult():ke.ok()}static create(r=qa,a={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=qa.amount,scale:c=qa.scale}=r,d={label:"quantity",...a},h=ve.validate(l,c,d);if(h.isFailure)return ke.fail(er(tr.INVALID_INPUT_DATA,h.error.message,d));let p=ve._sanitize(l);const x={amount:p===null?0:p,scale:c};return ke.ok(new ve(x,p===null,a))}static createFromFormattedValue(r,a={}){if(r===null||r==="")return ve.create({amount:null,scale:ve.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let h=c,p=2;return d===void 0?p=0:(d===""&&(h=c+d.padEnd(1,"0"),p=1),d.length===1?(h=c+d.padEnd(1,"0"),p=1):d.length===2&&(h=c+d.padEnd(2,"0"),p=2)),ve.create({amount:h,scale:p},a)}static _sanitize(r){let a=null;return typeof r=="string"?a=parseInt(r,10):a=r,a}static _toString(r,a){if(r===null)return"";const l=Math.pow(10,a);return(Number(r)/l).toFixed(a)}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return ve._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==ve.DEFAULT_SCALE?this.convertScale(ve.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rve.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new ve({amount:null,scale:r},!0,this._options);const a=Math.pow(10,this.scale),l=Number(this.amount)/a,c=Math.pow(10,r),d=Math.round(l*c);return new ve({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}increment(r){return this.isNull()?r?ve.create(r.toObject()):ve.create():r?this.hasSameScale(r)?ve.create({amount:Number(this.amount)+Number(r.amount),scale:this.scale},this._options):ke.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):ve.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(r){return this.isNull()?r?ve.create(r.toObject()):ve.create():r?this.hasSameScale(r)?ve.create({amount:Number(this.amount)-Number(r.amount),scale:this.scale},this._options):ke.fail(Error("No se pueden restar cantidades con diferentes escalas.")):ve.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Se(ve,"DEFAULT_SCALE",xd),Se(ve,"MIN_SCALE",0),Se(ve,"MAX_SCALE",2);let xn=ve;const wc=2;class Y0 extends Lt{static create(o){const{amount:r,currencyCode:a,scale:l=wc}=o,c=Lt.create({amount:r,currencyCode:a,scale:l});if(c.isFailure)return c;const d=c.object.convertScale(wc);return ke.ok(d)}}class Jn extends q_{constructor(){super(...arguments);Se(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Se(this,"isEmpty",()=>!this.isValid());Se(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Se(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Se(this,"toLocaleDateString",(r,a)=>this.isValid()?this.props.toLocaleDateString(r,a):"");Se(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(r,a){const l=Pe.RULE_ALLOW_EMPTY.default(0),c=Rt.date().label(String(a.label)),d=Rt.alternatives(l,c);return Pe.validate(d,r)}static createCurrentDate(){return ke.ok(new Jn(new Date))}static create(r,a={}){const l={...a,dateFormat:a.dateFormat?a.dateFormat:"YYYY-MM-DD",label:a.label?a.label:"date"},c=Jn.validate(r,l);return c.isFailure?ke.fail(er(tr.INVALID_INPUT_DATA,c.error.message,l)):ke.ok(new Jn(new Date(c.object)))}toString(){if(!this.isEmpty()){const r=this.props.getFullYear(),a=String(this.props.getMonth()+1).padStart(2,"0"),l=String(this.props.getDate()).padStart(2,"0");return`${r}-${a}-${l}`}return""}toPrimitive(){return this.toISO8601()}}const Q0=({isPending:n,interval:o=1e3,onInterval:r})=>{const[a,l]=T.useState(void 0);return T.useEffect(()=>{let c;return n&&(c=setInterval(()=>{l(d=>d===void 0?o:d+o)},o)),()=>{clearInterval(c),l(void 0)}},[n,o]),T.useEffect(()=>{r&&a&&r(a)},[a]),{elapsedTime:a}},X0=2*60*1e3,Z0=60*1e3,No=({queryKey:n,queryFn:o,enabled:r,select:a,queryOptions:l={},overtimeOptions:c})=>{const[d,h]=T.useState(!1),p=Ac({queryKey:n,queryFn:o,placeholderData:Fc,staleTime:Z0,refetchInterval:X0,refetchOnWindowFocus:!0,enabled:r&&!!o,select:a,...l});T.useEffect(()=>{p.isSuccess&&B0(p.data)&&h(p.data.total_items===0)},[p]);const{elapsedTime:x}=Q0({isPending:p.isFetching,interval:c==null?void 0:c.interval,onInterval:c==null?void 0:c.onInterval});return{...p,overtime:{elapsedTime:x},isEmpty:d}},vd=n=>Ac({placeholderData:Fc,...n});function J0(n){return en({...n})}/** + * table-core + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function eb(){return{accessor:(n,o)=>typeof n=="function"?{...o,accessorFn:n}:{...o,accessorKey:n},display:n=>n,group:n=>n}}function gn(n,o){return typeof n=="function"?n(o):n}function xt(n,o){return r=>{o.setState(a=>({...a,[n]:gn(r,a[n])}))}}function ls(n){return n instanceof Function}function tb(n){return Array.isArray(n)&&n.every(o=>typeof o=="number")}function nb(n,o){const r=[],a=l=>{l.forEach(c=>{r.push(c);const d=o(c);d!=null&&d.length&&a(d)})};return a(n),r}function X(n,o,r){let a=[],l;return c=>{let d;r.key&&r.debug&&(d=Date.now());const h=n(c);if(!(h.length!==a.length||h.some((v,R)=>a[R]!==v)))return l;a=h;let x;if(r.key&&r.debug&&(x=Date.now()),l=o(...h),r==null||r.onChange==null||r.onChange(l),r.key&&r.debug&&r!=null&&r.debug()){const v=Math.round((Date.now()-d)*100)/100,R=Math.round((Date.now()-x)*100)/100,N=R/16,b=(E,C)=>{for(E=String(E);E.length{var l;return(l=n==null?void 0:n.debugAll)!=null?l:n[o]},key:!1,onChange:a}}function rb(n,o,r,a){const l=()=>{var d;return(d=c.getValue())!=null?d:n.options.renderFallbackValue},c={id:`${o.id}_${r.id}`,row:o,column:r,getValue:()=>o.getValue(a),renderValue:l,getContext:X(()=>[n,r,o,c],(d,h,p,x)=>({table:d,column:h,row:p,cell:x,getValue:x.getValue,renderValue:x.renderValue}),Z(n.options,"debugCells"))};return n._features.forEach(d=>{d.createCell==null||d.createCell(c,r,o,n)},{}),c}function ib(n,o,r,a){var l,c;const h={...n._getDefaultColumnDef(),...o},p=h.accessorKey;let x=(l=(c=h.id)!=null?c:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?l:typeof h.header=="string"?h.header:void 0,v;if(h.accessorFn?v=h.accessorFn:p&&(p.includes(".")?v=N=>{let b=N;for(const C of p.split(".")){var E;b=(E=b)==null?void 0:E[C]}return b}:v=N=>N[h.accessorKey]),!x)throw new Error;let R={id:`${String(x)}`,accessorFn:v,parent:a,depth:r,columnDef:h,columns:[],getFlatColumns:X(()=>[!0],()=>{var N;return[R,...(N=R.columns)==null?void 0:N.flatMap(b=>b.getFlatColumns())]},Z(n.options,"debugColumns")),getLeafColumns:X(()=>[n._getOrderColumnsFn()],N=>{var b;if((b=R.columns)!=null&&b.length){let E=R.columns.flatMap(C=>C.getLeafColumns());return N(E)}return[R]},Z(n.options,"debugColumns"))};for(const N of n._features)N.createColumn==null||N.createColumn(R,n);return R}const Ze="debugHeaders";function Sc(n,o,r){var a;let c={id:(a=r.id)!=null?a:o.id,column:o,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const d=[],h=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(h),d.push(p)};return h(c),d},getContext:()=>({table:n,header:c,column:o})};return n._features.forEach(d=>{d.createHeader==null||d.createHeader(c,n)}),c}const sb={createTable:n=>{n.getHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>{var c,d;const h=(c=a==null?void 0:a.map(R=>r.find(N=>N.id===R)).filter(Boolean))!=null?c:[],p=(d=l==null?void 0:l.map(R=>r.find(N=>N.id===R)).filter(Boolean))!=null?d:[],x=r.filter(R=>!(a!=null&&a.includes(R.id))&&!(l!=null&&l.includes(R.id)));return qi(o,[...h,...x,...p],n)},Z(n.options,Ze)),n.getCenterHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>(r=r.filter(c=>!(a!=null&&a.includes(c.id))&&!(l!=null&&l.includes(c.id))),qi(o,r,n,"center")),Z(n.options,Ze)),n.getLeftHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(o,c,n,"left")},Z(n.options,Ze)),n.getRightHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(o,c,n,"right")},Z(n.options,Ze)),n.getFooterGroups=X(()=>[n.getHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getLeftFooterGroups=X(()=>[n.getLeftHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getCenterFooterGroups=X(()=>[n.getCenterHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getRightFooterGroups=X(()=>[n.getRightHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getFlatHeaders=X(()=>[n.getHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getLeftFlatHeaders=X(()=>[n.getLeftHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getCenterFlatHeaders=X(()=>[n.getCenterHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getRightFlatHeaders=X(()=>[n.getRightHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getCenterLeafHeaders=X(()=>[n.getCenterFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,Ze)),n.getLeftLeafHeaders=X(()=>[n.getLeftFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,Ze)),n.getRightLeafHeaders=X(()=>[n.getRightFlatHeaders()],o=>o.filter(r=>{var a;return!((a=r.subHeaders)!=null&&a.length)}),Z(n.options,Ze)),n.getLeafHeaders=X(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(o,r,a)=>{var l,c,d,h,p,x;return[...(l=(c=o[0])==null?void 0:c.headers)!=null?l:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[],...(p=(x=a[0])==null?void 0:x.headers)!=null?p:[]].map(v=>v.getLeafHeaders()).flat()},Z(n.options,Ze))}};function qi(n,o,r,a){var l,c;let d=0;const h=function(N,b){b===void 0&&(b=1),d=Math.max(d,b),N.filter(E=>E.getIsVisible()).forEach(E=>{var C;(C=E.columns)!=null&&C.length&&h(E.columns,b+1)},0)};h(n);let p=[];const x=(N,b)=>{const E={depth:b,id:[a,`${b}`].filter(Boolean).join("_"),headers:[]},C=[];N.forEach(L=>{const I=[...C].reverse()[0],q=L.column.depth===E.depth;let $,te=!1;if(q&&L.column.parent?$=L.column.parent:($=L.column,te=!0),I&&(I==null?void 0:I.column)===$)I.subHeaders.push(L);else{const O=Sc(r,$,{id:[a,b,$.id,L==null?void 0:L.id].filter(Boolean).join("_"),isPlaceholder:te,placeholderId:te?`${C.filter(k=>k.column===$).length}`:void 0,depth:b,index:C.length});O.subHeaders.push(L),C.push(O)}E.headers.push(L),L.headerGroup=E}),p.push(E),b>0&&x(C,b-1)},v=o.map((N,b)=>Sc(r,N,{depth:d,index:b}));x(v,d-1),p.reverse();const R=N=>N.filter(E=>E.column.getIsVisible()).map(E=>{let C=0,L=0,I=[0];E.subHeaders&&E.subHeaders.length?(I=[],R(E.subHeaders).forEach($=>{let{colSpan:te,rowSpan:O}=$;C+=te,I.push(O)})):C=1;const q=Math.min(...I);return L=L+q,E.colSpan=C,E.rowSpan=L,{colSpan:C,rowSpan:L}});return R((l=(c=p[0])==null?void 0:c.headers)!=null?l:[]),p}const Ro=(n,o,r,a,l,c,d)=>{let h={id:o,index:a,original:r,depth:l,parentId:d,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(h._valuesCache.hasOwnProperty(p))return h._valuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return h._valuesCache[p]=x.accessorFn(h.original,a),h._valuesCache[p]},getUniqueValues:p=>{if(h._uniqueValuesCache.hasOwnProperty(p))return h._uniqueValuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(h._uniqueValuesCache[p]=x.columnDef.getUniqueValues(h.original,a),h._uniqueValuesCache[p]):(h._uniqueValuesCache[p]=[h.getValue(p)],h._uniqueValuesCache[p])},renderValue:p=>{var x;return(x=h.getValue(p))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>nb(h.subRows,p=>p.subRows),getParentRow:()=>h.parentId?n.getRow(h.parentId,!0):void 0,getParentRows:()=>{let p=[],x=h;for(;;){const v=x.getParentRow();if(!v)break;p.push(v),x=v}return p.reverse()},getAllCells:X(()=>[n.getAllLeafColumns()],p=>p.map(x=>rb(n,h,x,x.id)),Z(n.options,"debugRows")),_getAllCellsByColumnId:X(()=>[h.getAllCells()],p=>p.reduce((x,v)=>(x[v.column.id]=v,x),{}),Z(n.options,"debugRows"))};for(let p=0;p{n._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():o.getPreFilteredRowModel(),n._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},_d=(n,o,r)=>{var a,l;const c=r==null||(a=r.toString())==null?void 0:a.toLowerCase();return!!(!((l=n.getValue(o))==null||(l=l.toString())==null||(l=l.toLowerCase())==null)&&l.includes(c))};_d.autoRemove=n=>Tt(n);const bd=(n,o,r)=>{var a;return!!(!((a=n.getValue(o))==null||(a=a.toString())==null)&&a.includes(r))};bd.autoRemove=n=>Tt(n);const wd=(n,o,r)=>{var a;return((a=n.getValue(o))==null||(a=a.toString())==null?void 0:a.toLowerCase())===(r==null?void 0:r.toLowerCase())};wd.autoRemove=n=>Tt(n);const Sd=(n,o,r)=>{var a;return(a=n.getValue(o))==null?void 0:a.includes(r)};Sd.autoRemove=n=>Tt(n);const jd=(n,o,r)=>!r.some(a=>{var l;return!((l=n.getValue(o))!=null&&l.includes(a))});jd.autoRemove=n=>Tt(n)||!(n!=null&&n.length);const Cd=(n,o,r)=>r.some(a=>{var l;return(l=n.getValue(o))==null?void 0:l.includes(a)});Cd.autoRemove=n=>Tt(n)||!(n!=null&&n.length);const yd=(n,o,r)=>n.getValue(o)===r;yd.autoRemove=n=>Tt(n);const Nd=(n,o,r)=>n.getValue(o)==r;Nd.autoRemove=n=>Tt(n);const Eo=(n,o,r)=>{let[a,l]=r;const c=n.getValue(o);return c>=a&&c<=l};Eo.resolveFilterValue=n=>{let[o,r]=n,a=typeof o!="number"?parseFloat(o):o,l=typeof r!="number"?parseFloat(r):r,c=o===null||Number.isNaN(a)?-1/0:a,d=r===null||Number.isNaN(l)?1/0:l;if(c>d){const h=c;c=d,d=h}return[c,d]};Eo.autoRemove=n=>Tt(n)||Tt(n[0])&&Tt(n[1]);const Zt={includesString:_d,includesStringSensitive:bd,equalsString:wd,arrIncludes:Sd,arrIncludesAll:jd,arrIncludesSome:Cd,equals:yd,weakEquals:Nd,inNumberRange:Eo};function Tt(n){return n==null||n===""}const ob={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:xt("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,o)=>{n.getAutoFilterFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);return typeof a=="string"?Zt.includesString:typeof a=="number"?Zt.inNumberRange:typeof a=="boolean"||a!==null&&typeof a=="object"?Zt.equals:Array.isArray(a)?Zt.arrIncludes:Zt.weakEquals},n.getFilterFn=()=>{var r,a;return ls(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(r=(a=o.options.filterFns)==null?void 0:a[n.columnDef.filterFn])!=null?r:Zt[n.columnDef.filterFn]},n.getCanFilter=()=>{var r,a,l;return((r=n.columnDef.enableColumnFilter)!=null?r:!0)&&((a=o.options.enableColumnFilters)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var r;return(r=o.getState().columnFilters)==null||(r=r.find(a=>a.id===n.id))==null?void 0:r.value},n.getFilterIndex=()=>{var r,a;return(r=(a=o.getState().columnFilters)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.setFilterValue=r=>{o.setColumnFilters(a=>{const l=n.getFilterFn(),c=a==null?void 0:a.find(v=>v.id===n.id),d=gn(r,c?c.value:void 0);if(jc(l,d,n)){var h;return(h=a==null?void 0:a.filter(v=>v.id!==n.id))!=null?h:[]}const p={id:n.id,value:d};if(c){var x;return(x=a==null?void 0:a.map(v=>v.id===n.id?p:v))!=null?x:[]}return a!=null&&a.length?[...a,p]:[p]})}},createRow:(n,o)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=o=>{const r=n.getAllLeafColumns(),a=l=>{var c;return(c=gn(o,l))==null?void 0:c.filter(d=>{const h=r.find(p=>p.id===d.id);if(h){const p=h.getFilterFn();if(jc(p,d.value,h))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(a)},n.resetColumnFilters=o=>{var r,a;n.setColumnFilters(o?[]:(r=(a=n.initialState)==null?void 0:a.columnFilters)!=null?r:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function jc(n,o,r){return(n&&n.autoRemove?n.autoRemove(o,r):!1)||typeof o>"u"||typeof o=="string"&&!o}const lb=(n,o,r)=>r.reduce((a,l)=>{const c=l.getValue(n);return a+(typeof c=="number"?c:0)},0),ub=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a>c||a===void 0&&c>=c)&&(a=c)}),a},cb=(n,o,r)=>{let a;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(a=c)&&(a=c)}),a},db=(n,o,r)=>{let a,l;return r.forEach(c=>{const d=c.getValue(n);d!=null&&(a===void 0?d>=d&&(a=l=d):(a>d&&(a=d),l{let r=0,a=0;if(o.forEach(l=>{let c=l.getValue(n);c!=null&&(c=+c)>=c&&(++r,a+=c)}),r)return a/r},gb=(n,o)=>{if(!o.length)return;const r=o.map(c=>c.getValue(n));if(!tb(r))return;if(r.length===1)return r[0];const a=Math.floor(r.length/2),l=r.sort((c,d)=>c-d);return r.length%2!==0?l[a]:(l[a-1]+l[a])/2},mb=(n,o)=>Array.from(new Set(o.map(r=>r.getValue(n))).values()),hb=(n,o)=>new Set(o.map(r=>r.getValue(n))).size,pb=(n,o)=>o.length,$a={sum:lb,min:ub,max:cb,extent:db,mean:fb,median:gb,unique:mb,uniqueCount:hb,count:pb},xb={getDefaultColumnDef:()=>({aggregatedCell:n=>{var o,r;return(o=(r=n.getValue())==null||r.toString==null?void 0:r.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:xt("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,o)=>{n.toggleGrouping=()=>{o.setGrouping(r=>r!=null&&r.includes(n.id)?r.filter(a=>a!==n.id):[...r??[],n.id])},n.getCanGroup=()=>{var r,a;return((r=n.columnDef.enableGrouping)!=null?r:!0)&&((a=o.options.enableGrouping)!=null?a:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.includes(n.id)},n.getGroupedIndex=()=>{var r;return(r=o.getState().grouping)==null?void 0:r.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const r=n.getCanGroup();return()=>{r&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const r=o.getCoreRowModel().flatRows[0],a=r==null?void 0:r.getValue(n.id);if(typeof a=="number")return $a.sum;if(Object.prototype.toString.call(a)==="[object Date]")return $a.extent},n.getAggregationFn=()=>{var r,a;if(!n)throw new Error;return ls(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(r=(a=o.options.aggregationFns)==null?void 0:a[n.columnDef.aggregationFn])!=null?r:$a[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=o=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(o),n.resetGrouping=o=>{var r,a;n.setGrouping(o?[]:(r=(a=n.initialState)==null?void 0:a.grouping)!=null?r:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,o)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=r=>{if(n._groupingValuesCache.hasOwnProperty(r))return n._groupingValuesCache[r];const a=o.getColumn(r);return a!=null&&a.columnDef.getGroupingValue?(n._groupingValuesCache[r]=a.columnDef.getGroupingValue(n.original),n._groupingValuesCache[r]):n.getValue(r)},n._groupingValuesCache={}},createCell:(n,o,r,a)=>{n.getIsGrouped=()=>o.getIsGrouped()&&o.id===r.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&o.getIsGrouped(),n.getIsAggregated=()=>{var l;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((l=r.subRows)!=null&&l.length)}}};function vb(n,o,r){if(!(o!=null&&o.length)||!r)return n;const a=n.filter(c=>!o.includes(c.id));return r==="remove"?a:[...o.map(c=>n.find(d=>d.id===c)).filter(Boolean),...a]}const _b={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:xt("columnOrder",n)}),createColumn:(n,o)=>{n.getIndex=X(r=>[kr(o,r)],r=>r.findIndex(a=>a.id===n.id),Z(o.options,"debugColumns")),n.getIsFirstColumn=r=>{var a;return((a=kr(o,r)[0])==null?void 0:a.id)===n.id},n.getIsLastColumn=r=>{var a;const l=kr(o,r);return((a=l[l.length-1])==null?void 0:a.id)===n.id}},createTable:n=>{n.setColumnOrder=o=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(o),n.resetColumnOrder=o=>{var r;n.setColumnOrder(o?[]:(r=n.initialState.columnOrder)!=null?r:[])},n._getOrderColumnsFn=X(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(o,r,a)=>l=>{let c=[];if(!(o!=null&&o.length))c=l;else{const d=[...o],h=[...l];for(;h.length&&d.length;){const p=d.shift(),x=h.findIndex(v=>v.id===p);x>-1&&c.push(h.splice(x,1)[0])}c=[...c,...h]}return vb(c,r,a)},Z(n.options,"debugTable"))}},za=()=>({left:[],right:[]}),bb={getInitialState:n=>({columnPinning:za(),...n}),getDefaultOptions:n=>({onColumnPinningChange:xt("columnPinning",n)}),createColumn:(n,o)=>{n.pin=r=>{const a=n.getLeafColumns().map(l=>l.id).filter(Boolean);o.setColumnPinning(l=>{var c,d;if(r==="right"){var h,p;return{left:((h=l==null?void 0:l.left)!=null?h:[]).filter(R=>!(a!=null&&a.includes(R))),right:[...((p=l==null?void 0:l.right)!=null?p:[]).filter(R=>!(a!=null&&a.includes(R))),...a]}}if(r==="left"){var x,v;return{left:[...((x=l==null?void 0:l.left)!=null?x:[]).filter(R=>!(a!=null&&a.includes(R))),...a],right:((v=l==null?void 0:l.right)!=null?v:[]).filter(R=>!(a!=null&&a.includes(R)))}}return{left:((c=l==null?void 0:l.left)!=null?c:[]).filter(R=>!(a!=null&&a.includes(R))),right:((d=l==null?void 0:l.right)!=null?d:[]).filter(R=>!(a!=null&&a.includes(R)))}})},n.getCanPin=()=>n.getLeafColumns().some(a=>{var l,c,d;return((l=a.columnDef.enablePinning)!=null?l:!0)&&((c=(d=o.options.enableColumnPinning)!=null?d:o.options.enablePinning)!=null?c:!0)}),n.getIsPinned=()=>{const r=n.getLeafColumns().map(h=>h.id),{left:a,right:l}=o.getState().columnPinning,c=r.some(h=>a==null?void 0:a.includes(h)),d=r.some(h=>l==null?void 0:l.includes(h));return c?"left":d?"right":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();return l?(r=(a=o.getState().columnPinning)==null||(a=a[l])==null?void 0:a.indexOf(n.id))!=null?r:-1:0}},createRow:(n,o)=>{n.getCenterVisibleCells=X(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(r,a,l)=>{const c=[...a??[],...l??[]];return r.filter(d=>!c.includes(d.column.id))},Z(o.options,"debugRows")),n.getLeftVisibleCells=X(()=>[n._getAllVisibleCells(),o.getState().columnPinning.left],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"left"})),Z(o.options,"debugRows")),n.getRightVisibleCells=X(()=>[n._getAllVisibleCells(),o.getState().columnPinning.right],(r,a)=>(a??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"right"})),Z(o.options,"debugRows"))},createTable:n=>{n.setColumnPinning=o=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(o),n.resetColumnPinning=o=>{var r,a;return n.setColumnPinning(o?za():(r=(a=n.initialState)==null?void 0:a.columnPinning)!=null?r:za())},n.getIsSomeColumnsPinned=o=>{var r;const a=n.getState().columnPinning;if(!o){var l,c;return!!((l=a.left)!=null&&l.length||(c=a.right)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n.getLeftLeafColumns=X(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),Z(n.options,"debugColumns")),n.getRightLeafColumns=X(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(o,r)=>(r??[]).map(a=>o.find(l=>l.id===a)).filter(Boolean),Z(n.options,"debugColumns")),n.getCenterLeafColumns=X(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a)=>{const l=[...r??[],...a??[]];return o.filter(c=>!l.includes(c.id))},Z(n.options,"debugColumns"))}},$i={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Va=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),wb={getDefaultColumnDef:()=>$i,getInitialState:n=>({columnSizing:{},columnSizingInfo:Va(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:xt("columnSizing",n),onColumnSizingInfoChange:xt("columnSizingInfo",n)}),createColumn:(n,o)=>{n.getSize=()=>{var r,a,l;const c=o.getState().columnSizing[n.id];return Math.min(Math.max((r=n.columnDef.minSize)!=null?r:$i.minSize,(a=c??n.columnDef.size)!=null?a:$i.size),(l=n.columnDef.maxSize)!=null?l:$i.maxSize)},n.getStart=X(r=>[r,kr(o,r),o.getState().columnSizing],(r,a)=>a.slice(0,n.getIndex(r)).reduce((l,c)=>l+c.getSize(),0),Z(o.options,"debugColumns")),n.getAfter=X(r=>[r,kr(o,r),o.getState().columnSizing],(r,a)=>a.slice(n.getIndex(r)+1).reduce((l,c)=>l+c.getSize(),0),Z(o.options,"debugColumns")),n.resetSize=()=>{o.setColumnSizing(r=>{let{[n.id]:a,...l}=r;return l})},n.getCanResize=()=>{var r,a;return((r=n.columnDef.enableResizing)!=null?r:!0)&&((a=o.options.enableColumnResizing)!=null?a:!0)},n.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,o)=>{n.getSize=()=>{let r=0;const a=l=>{if(l.subHeaders.length)l.subHeaders.forEach(a);else{var c;r+=(c=l.column.getSize())!=null?c:0}};return a(n),r},n.getStart=()=>{if(n.index>0){const r=n.headerGroup.headers[n.index-1];return r.getStart()+r.getSize()}return 0},n.getResizeHandler=r=>{const a=o.getColumn(n.column.id),l=a==null?void 0:a.getCanResize();return c=>{if(!a||!l||(c.persist==null||c.persist(),Ba(c)&&c.touches&&c.touches.length>1))return;const d=n.getSize(),h=n?n.getLeafHeaders().map(I=>[I.column.id,I.column.getSize()]):[[a.id,a.getSize()]],p=Ba(c)?Math.round(c.touches[0].clientX):c.clientX,x={},v=(I,q)=>{typeof q=="number"&&(o.setColumnSizingInfo($=>{var te,O;const k=o.options.columnResizeDirection==="rtl"?-1:1,K=(q-((te=$==null?void 0:$.startOffset)!=null?te:0))*k,ne=Math.max(K/((O=$==null?void 0:$.startSize)!=null?O:0),-.999999);return $.columnSizingStart.forEach(B=>{let[me,_e]=B;x[me]=Math.round(Math.max(_e+_e*ne,0)*100)/100}),{...$,deltaOffset:K,deltaPercentage:ne}}),(o.options.columnResizeMode==="onChange"||I==="end")&&o.setColumnSizing($=>({...$,...x})))},R=I=>v("move",I),N=I=>{v("end",I),o.setColumnSizingInfo(q=>({...q,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=r||typeof document<"u"?document:null,E={moveHandler:I=>R(I.clientX),upHandler:I=>{b==null||b.removeEventListener("mousemove",E.moveHandler),b==null||b.removeEventListener("mouseup",E.upHandler),N(I.clientX)}},C={moveHandler:I=>(I.cancelable&&(I.preventDefault(),I.stopPropagation()),R(I.touches[0].clientX),!1),upHandler:I=>{var q;b==null||b.removeEventListener("touchmove",C.moveHandler),b==null||b.removeEventListener("touchend",C.upHandler),I.cancelable&&(I.preventDefault(),I.stopPropagation()),N((q=I.touches[0])==null?void 0:q.clientX)}},L=Sb()?{passive:!1}:!1;Ba(c)?(b==null||b.addEventListener("touchmove",C.moveHandler,L),b==null||b.addEventListener("touchend",C.upHandler,L)):(b==null||b.addEventListener("mousemove",E.moveHandler,L),b==null||b.addEventListener("mouseup",E.upHandler,L)),o.setColumnSizingInfo(I=>({...I,startOffset:p,startSize:d,deltaOffset:0,deltaPercentage:0,columnSizingStart:h,isResizingColumn:a.id}))}}},createTable:n=>{n.setColumnSizing=o=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(o),n.setColumnSizingInfo=o=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(o),n.resetColumnSizing=o=>{var r;n.setColumnSizing(o?{}:(r=n.initialState.columnSizing)!=null?r:{})},n.resetHeaderSizeInfo=o=>{var r;n.setColumnSizingInfo(o?Va():(r=n.initialState.columnSizingInfo)!=null?r:Va())},n.getTotalSize=()=>{var o,r;return(o=(r=n.getHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getLeftTotalSize=()=>{var o,r;return(o=(r=n.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getCenterTotalSize=()=>{var o,r;return(o=(r=n.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0},n.getRightTotalSize=()=>{var o,r;return(o=(r=n.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((a,l)=>a+l.getSize(),0))!=null?o:0}}};let zi=null;function Sb(){if(typeof zi=="boolean")return zi;let n=!1;try{const o={get passive(){return n=!0,!1}},r=()=>{};window.addEventListener("test",r,o),window.removeEventListener("test",r)}catch{n=!1}return zi=n,zi}function Ba(n){return n.type==="touchstart"}const jb={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:xt("columnVisibility",n)}),createColumn:(n,o)=>{n.toggleVisibility=r=>{n.getCanHide()&&o.setColumnVisibility(a=>({...a,[n.id]:r??!n.getIsVisible()}))},n.getIsVisible=()=>{var r,a;const l=n.columns;return(r=l.length?l.some(c=>c.getIsVisible()):(a=o.getState().columnVisibility)==null?void 0:a[n.id])!=null?r:!0},n.getCanHide=()=>{var r,a;return((r=n.columnDef.enableHiding)!=null?r:!0)&&((a=o.options.enableHiding)!=null?a:!0)},n.getToggleVisibilityHandler=()=>r=>{n.toggleVisibility==null||n.toggleVisibility(r.target.checked)}},createRow:(n,o)=>{n._getAllVisibleCells=X(()=>[n.getAllCells(),o.getState().columnVisibility],r=>r.filter(a=>a.column.getIsVisible()),Z(o.options,"debugRows")),n.getVisibleCells=X(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(r,a,l)=>[...r,...a,...l],Z(o.options,"debugRows"))},createTable:n=>{const o=(r,a)=>X(()=>[a(),a().filter(l=>l.getIsVisible()).map(l=>l.id).join("_")],l=>l.filter(c=>c.getIsVisible==null?void 0:c.getIsVisible()),Z(n.options,"debugColumns"));n.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=r=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(r),n.resetColumnVisibility=r=>{var a;n.setColumnVisibility(r?{}:(a=n.initialState.columnVisibility)!=null?a:{})},n.toggleAllColumnsVisible=r=>{var a;r=(a=r)!=null?a:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((l,c)=>({...l,[c.id]:r||!(c.getCanHide!=null&&c.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>r=>{var a;n.toggleAllColumnsVisible((a=r.target)==null?void 0:a.checked)}}};function kr(n,o){return o?o==="center"?n.getCenterVisibleLeafColumns():o==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const Cb={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},yb={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:xt("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var r;const a=(r=n.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[o.id])==null?void 0:r.getValue();return typeof a=="string"||typeof a=="number"}}),createColumn:(n,o)=>{n.getCanGlobalFilter=()=>{var r,a,l,c;return((r=n.columnDef.enableGlobalFilter)!=null?r:!0)&&((a=o.options.enableGlobalFilter)!=null?a:!0)&&((l=o.options.enableFilters)!=null?l:!0)&&((c=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(n))!=null?c:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>Zt.includesString,n.getGlobalFilterFn=()=>{var o,r;const{globalFilterFn:a}=n.options;return ls(a)?a:a==="auto"?n.getGlobalAutoFilterFn():(o=(r=n.options.filterFns)==null?void 0:r[a])!=null?o:Zt[a]},n.setGlobalFilter=o=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(o)},n.resetGlobalFilter=o=>{n.setGlobalFilter(o?void 0:n.initialState.globalFilter)}}},Nb={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:xt("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let o=!1,r=!1;n._autoResetExpanded=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetExpanded)!=null?a:!n.options.manualExpanding){if(r)return;r=!0,n._queue(()=>{n.resetExpanded(),r=!1})}},n.setExpanded=a=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(a),n.toggleAllRowsExpanded=a=>{a??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=a=>{var l,c;n.setExpanded(a?{}:(l=(c=n.initialState)==null?void 0:c.expanded)!=null?l:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(a=>a.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>a=>{a.persist==null||a.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const a=n.getState().expanded;return a===!0||Object.values(a).some(Boolean)},n.getIsAllRowsExpanded=()=>{const a=n.getState().expanded;return typeof a=="boolean"?a===!0:!(!Object.keys(a).length||n.getRowModel().flatRows.some(l=>!l.getIsExpanded()))},n.getExpandedDepth=()=>{let a=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(c=>{const d=c.split(".");a=Math.max(a,d.length)}),a},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,o)=>{n.toggleExpanded=r=>{o.setExpanded(a=>{var l;const c=a===!0?!0:!!(a!=null&&a[n.id]);let d={};if(a===!0?Object.keys(o.getRowModel().rowsById).forEach(h=>{d[h]=!0}):d=a,r=(l=r)!=null?l:!c,!c&&r)return{...d,[n.id]:!0};if(c&&!r){const{[n.id]:h,...p}=d;return p}return a})},n.getIsExpanded=()=>{var r;const a=o.getState().expanded;return!!((r=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(n))!=null?r:a===!0||a!=null&&a[n.id])},n.getCanExpand=()=>{var r,a,l;return(r=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(n))!=null?r:((a=o.options.enableExpanding)!=null?a:!0)&&!!((l=n.subRows)!=null&&l.length)},n.getIsAllParentsExpanded=()=>{let r=!0,a=n;for(;r&&a.parentId;)a=o.getRow(a.parentId,!0),r=a.getIsExpanded();return r},n.getToggleExpandedHandler=()=>{const r=n.getCanExpand();return()=>{r&&n.toggleExpanded()}}}},Ja=0,eo=10,Ua=()=>({pageIndex:Ja,pageSize:eo}),Rb={getInitialState:n=>({...n,pagination:{...Ua(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:xt("pagination",n)}),createTable:n=>{let o=!1,r=!1;n._autoResetPageIndex=()=>{var a,l;if(!o){n._queue(()=>{o=!0});return}if((a=(l=n.options.autoResetAll)!=null?l:n.options.autoResetPageIndex)!=null?a:!n.options.manualPagination){if(r)return;r=!0,n._queue(()=>{n.resetPageIndex(),r=!1})}},n.setPagination=a=>{const l=c=>gn(a,c);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(l)},n.resetPagination=a=>{var l;n.setPagination(a?Ua():(l=n.initialState.pagination)!=null?l:Ua())},n.setPageIndex=a=>{n.setPagination(l=>{let c=gn(a,l.pageIndex);const d=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return c=Math.max(0,Math.min(c,d)),{...l,pageIndex:c}})},n.resetPageIndex=a=>{var l,c;n.setPageIndex(a?Ja:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageIndex)!=null?l:Ja)},n.resetPageSize=a=>{var l,c;n.setPageSize(a?eo:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageSize)!=null?l:eo)},n.setPageSize=a=>{n.setPagination(l=>{const c=Math.max(1,gn(a,l.pageSize)),d=l.pageSize*l.pageIndex,h=Math.floor(d/c);return{...l,pageIndex:h,pageSize:c}})},n.setPageCount=a=>n.setPagination(l=>{var c;let d=gn(a,(c=n.options.pageCount)!=null?c:-1);return typeof d=="number"&&(d=Math.max(-1,d)),{...l,pageCount:d}}),n.getPageOptions=X(()=>[n.getPageCount()],a=>{let l=[];return a&&a>0&&(l=[...new Array(a)].fill(null).map((c,d)=>d)),l},Z(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:a}=n.getState().pagination,l=n.getPageCount();return l===-1?!0:l===0?!1:an.setPageIndex(a=>a-1),n.nextPage=()=>n.setPageIndex(a=>a+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var a;return(a=n.options.pageCount)!=null?a:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var a;return(a=n.options.rowCount)!=null?a:n.getPrePaginationRowModel().rows.length}}},Ga=()=>({top:[],bottom:[]}),Eb={getInitialState:n=>({rowPinning:Ga(),...n}),getDefaultOptions:n=>({onRowPinningChange:xt("rowPinning",n)}),createRow:(n,o)=>{n.pin=(r,a,l)=>{const c=a?n.getLeafRows().map(p=>{let{id:x}=p;return x}):[],d=l?n.getParentRows().map(p=>{let{id:x}=p;return x}):[],h=new Set([...d,n.id,...c]);o.setRowPinning(p=>{var x,v;if(r==="bottom"){var R,N;return{top:((R=p==null?void 0:p.top)!=null?R:[]).filter(C=>!(h!=null&&h.has(C))),bottom:[...((N=p==null?void 0:p.bottom)!=null?N:[]).filter(C=>!(h!=null&&h.has(C))),...Array.from(h)]}}if(r==="top"){var b,E;return{top:[...((b=p==null?void 0:p.top)!=null?b:[]).filter(C=>!(h!=null&&h.has(C))),...Array.from(h)],bottom:((E=p==null?void 0:p.bottom)!=null?E:[]).filter(C=>!(h!=null&&h.has(C)))}}return{top:((x=p==null?void 0:p.top)!=null?x:[]).filter(C=>!(h!=null&&h.has(C))),bottom:((v=p==null?void 0:p.bottom)!=null?v:[]).filter(C=>!(h!=null&&h.has(C)))}})},n.getCanPin=()=>{var r;const{enableRowPinning:a,enablePinning:l}=o.options;return typeof a=="function"?a(n):(r=a??l)!=null?r:!0},n.getIsPinned=()=>{const r=[n.id],{top:a,bottom:l}=o.getState().rowPinning,c=r.some(h=>a==null?void 0:a.includes(h)),d=r.some(h=>l==null?void 0:l.includes(h));return c?"top":d?"bottom":!1},n.getPinnedIndex=()=>{var r,a;const l=n.getIsPinned();if(!l)return-1;const c=(r=l==="top"?o.getTopRows():o.getBottomRows())==null?void 0:r.map(d=>{let{id:h}=d;return h});return(a=c==null?void 0:c.indexOf(n.id))!=null?a:-1}},createTable:n=>{n.setRowPinning=o=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(o),n.resetRowPinning=o=>{var r,a;return n.setRowPinning(o?Ga():(r=(a=n.initialState)==null?void 0:a.rowPinning)!=null?r:Ga())},n.getIsSomeRowsPinned=o=>{var r;const a=n.getState().rowPinning;if(!o){var l,c;return!!((l=a.top)!=null&&l.length||(c=a.bottom)!=null&&c.length)}return!!((r=a[o])!=null&&r.length)},n._getPinnedRows=(o,r,a)=>{var l;return((l=n.options.keepPinnedRows)==null||l?(r??[]).map(d=>{const h=n.getRow(d,!0);return h.getIsAllParentsExpanded()?h:null}):(r??[]).map(d=>o.find(h=>h.id===d))).filter(Boolean).map(d=>({...d,position:a}))},n.getTopRows=X(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(o,r)=>n._getPinnedRows(o,r,"top"),Z(n.options,"debugRows")),n.getBottomRows=X(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(o,r)=>n._getPinnedRows(o,r,"bottom"),Z(n.options,"debugRows")),n.getCenterRows=X(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(o,r,a)=>{const l=new Set([...r??[],...a??[]]);return o.filter(c=>!l.has(c.id))},Z(n.options,"debugRows"))}},Ab={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:xt("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=o=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(o),n.resetRowSelection=o=>{var r;return n.setRowSelection(o?{}:(r=n.initialState.rowSelection)!=null?r:{})},n.toggleAllRowsSelected=o=>{n.setRowSelection(r=>{o=typeof o<"u"?o:!n.getIsAllRowsSelected();const a={...r},l=n.getPreGroupedRowModel().flatRows;return o?l.forEach(c=>{c.getCanSelect()&&(a[c.id]=!0)}):l.forEach(c=>{delete a[c.id]}),a})},n.toggleAllPageRowsSelected=o=>n.setRowSelection(r=>{const a=typeof o<"u"?o:!n.getIsAllPageRowsSelected(),l={...r};return n.getRowModel().rows.forEach(c=>{to(l,c.id,a,!0,n)}),l}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=X(()=>[n.getState().rowSelection,n.getCoreRowModel()],(o,r)=>Object.keys(o).length?Ha(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getFilteredSelectedRowModel=X(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(o,r)=>Object.keys(o).length?Ha(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getGroupedSelectedRowModel=X(()=>[n.getState().rowSelection,n.getSortedRowModel()],(o,r)=>Object.keys(o).length?Ha(n,r):{rows:[],flatRows:[],rowsById:{}},Z(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const o=n.getFilteredRowModel().flatRows,{rowSelection:r}=n.getState();let a=!!(o.length&&Object.keys(r).length);return a&&o.some(l=>l.getCanSelect()&&!r[l.id])&&(a=!1),a},n.getIsAllPageRowsSelected=()=>{const o=n.getPaginationRowModel().flatRows.filter(l=>l.getCanSelect()),{rowSelection:r}=n.getState();let a=!!o.length;return a&&o.some(l=>!r[l.id])&&(a=!1),a},n.getIsSomeRowsSelected=()=>{var o;const r=Object.keys((o=n.getState().rowSelection)!=null?o:{}).length;return r>0&&r{const o=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:o.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>o=>{n.toggleAllRowsSelected(o.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>o=>{n.toggleAllPageRowsSelected(o.target.checked)}},createRow:(n,o)=>{n.toggleSelected=(r,a)=>{const l=n.getIsSelected();o.setRowSelection(c=>{var d;if(r=typeof r<"u"?r:!l,n.getCanSelect()&&l===r)return c;const h={...c};return to(h,n.id,r,(d=a==null?void 0:a.selectChildren)!=null?d:!0,o),h})},n.getIsSelected=()=>{const{rowSelection:r}=o.getState();return Ao(n,r)},n.getIsSomeSelected=()=>{const{rowSelection:r}=o.getState();return no(n,r)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=o.getState();return no(n,r)==="all"},n.getCanSelect=()=>{var r;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(n):(r=o.options.enableRowSelection)!=null?r:!0},n.getCanSelectSubRows=()=>{var r;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(n):(r=o.options.enableSubRowSelection)!=null?r:!0},n.getCanMultiSelect=()=>{var r;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(n):(r=o.options.enableMultiRowSelection)!=null?r:!0},n.getToggleSelectedHandler=()=>{const r=n.getCanSelect();return a=>{var l;r&&n.toggleSelected((l=a.target)==null?void 0:l.checked)}}}},to=(n,o,r,a,l)=>{var c;const d=l.getRow(o,!0);r?(d.getCanMultiSelect()||Object.keys(n).forEach(h=>delete n[h]),d.getCanSelect()&&(n[o]=!0)):delete n[o],a&&(c=d.subRows)!=null&&c.length&&d.getCanSelectSubRows()&&d.subRows.forEach(h=>to(n,h.id,r,a,l))};function Ha(n,o){const r=n.getState().rowSelection,a=[],l={},c=function(d,h){return d.map(p=>{var x;const v=Ao(p,r);if(v&&(a.push(p),l[p.id]=p),(x=p.subRows)!=null&&x.length&&(p={...p,subRows:c(p.subRows)}),v)return p}).filter(Boolean)};return{rows:c(o.rows),flatRows:a,rowsById:l}}function Ao(n,o){var r;return(r=o[n.id])!=null?r:!1}function no(n,o,r){var a;if(!((a=n.subRows)!=null&&a.length))return!1;let l=!0,c=!1;return n.subRows.forEach(d=>{if(!(c&&!l)&&(d.getCanSelect()&&(Ao(d,o)?c=!0:l=!1),d.subRows&&d.subRows.length)){const h=no(d,o);h==="all"?c=!0:(h==="some"&&(c=!0),l=!1)}}),l?"all":c?"some":!1}const ro=/([0-9]+)/gm,Fb=(n,o,r)=>Rd(vn(n.getValue(r)).toLowerCase(),vn(o.getValue(r)).toLowerCase()),Ib=(n,o,r)=>Rd(vn(n.getValue(r)),vn(o.getValue(r))),Db=(n,o,r)=>Fo(vn(n.getValue(r)).toLowerCase(),vn(o.getValue(r)).toLowerCase()),Mb=(n,o,r)=>Fo(vn(n.getValue(r)),vn(o.getValue(r))),Lb=(n,o,r)=>{const a=n.getValue(r),l=o.getValue(r);return a>l?1:aFo(n.getValue(r),o.getValue(r));function Fo(n,o){return n===o?0:n>o?1:-1}function vn(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function Rd(n,o){const r=n.split(ro).filter(Boolean),a=o.split(ro).filter(Boolean);for(;r.length&&a.length;){const l=r.shift(),c=a.shift(),d=parseInt(l,10),h=parseInt(c,10),p=[d,h].sort();if(isNaN(p[0])){if(l>c)return 1;if(c>l)return-1;continue}if(isNaN(p[1]))return isNaN(d)?-1:1;if(d>h)return 1;if(h>d)return-1}return r.length-a.length}const Lr={alphanumeric:Fb,alphanumericCaseSensitive:Ib,text:Db,textCaseSensitive:Mb,datetime:Lb,basic:Tb},Ob={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:xt("sorting",n),isMultiSortEvent:o=>o.shiftKey}),createColumn:(n,o)=>{n.getAutoSortingFn=()=>{const r=o.getFilteredRowModel().flatRows.slice(10);let a=!1;for(const l of r){const c=l==null?void 0:l.getValue(n.id);if(Object.prototype.toString.call(c)==="[object Date]")return Lr.datetime;if(typeof c=="string"&&(a=!0,c.split(ro).length>1))return Lr.alphanumeric}return a?Lr.text:Lr.basic},n.getAutoSortDir=()=>{const r=o.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var r,a;if(!n)throw new Error;return ls(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(r=(a=o.options.sortingFns)==null?void 0:a[n.columnDef.sortingFn])!=null?r:Lr[n.columnDef.sortingFn]},n.toggleSorting=(r,a)=>{const l=n.getNextSortingOrder(),c=typeof r<"u"&&r!==null;o.setSorting(d=>{const h=d==null?void 0:d.find(b=>b.id===n.id),p=d==null?void 0:d.findIndex(b=>b.id===n.id);let x=[],v,R=c?r:l==="desc";if(d!=null&&d.length&&n.getCanMultiSort()&&a?h?v="toggle":v="add":d!=null&&d.length&&p!==d.length-1?v="replace":h?v="toggle":v="replace",v==="toggle"&&(c||l||(v="remove")),v==="add"){var N;x=[...d,{id:n.id,desc:R}],x.splice(0,x.length-((N=o.options.maxMultiSortColCount)!=null?N:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=d.map(b=>b.id===n.id?{...b,desc:R}:b):v==="remove"?x=d.filter(b=>b.id!==n.id):x=[{id:n.id,desc:R}];return x})},n.getFirstSortDir=()=>{var r,a;return((r=(a=n.columnDef.sortDescFirst)!=null?a:o.options.sortDescFirst)!=null?r:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=r=>{var a,l;const c=n.getFirstSortDir(),d=n.getIsSorted();return d?d!==c&&((a=o.options.enableSortingRemoval)==null||a)&&(!(r&&(l=o.options.enableMultiRemove)!=null)||l)?!1:d==="desc"?"asc":"desc":c},n.getCanSort=()=>{var r,a;return((r=n.columnDef.enableSorting)!=null?r:!0)&&((a=o.options.enableSorting)!=null?a:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var r,a;return(r=(a=n.columnDef.enableMultiSort)!=null?a:o.options.enableMultiSort)!=null?r:!!n.accessorFn},n.getIsSorted=()=>{var r;const a=(r=o.getState().sorting)==null?void 0:r.find(l=>l.id===n.id);return a?a.desc?"desc":"asc":!1},n.getSortIndex=()=>{var r,a;return(r=(a=o.getState().sorting)==null?void 0:a.findIndex(l=>l.id===n.id))!=null?r:-1},n.clearSorting=()=>{o.setSorting(r=>r!=null&&r.length?r.filter(a=>a.id!==n.id):[])},n.getToggleSortingHandler=()=>{const r=n.getCanSort();return a=>{r&&(a.persist==null||a.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(a):!1))}}},createTable:n=>{n.setSorting=o=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(o),n.resetSorting=o=>{var r,a;n.setSorting(o?[]:(r=(a=n.initialState)==null?void 0:a.sorting)!=null?r:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},Pb=[sb,jb,_b,bb,ab,ob,Cb,yb,Ob,xb,Nb,Rb,Eb,Ab,wb];function kb(n){var o,r;const a=[...Pb,...(o=n._features)!=null?o:[]];let l={_features:a};const c=l._features.reduce((N,b)=>Object.assign(N,b.getDefaultOptions==null?void 0:b.getDefaultOptions(l)),{}),d=N=>l.options.mergeOptions?l.options.mergeOptions(c,N):{...c,...N};let p={...{},...(r=n.initialState)!=null?r:{}};l._features.forEach(N=>{var b;p=(b=N.getInitialState==null?void 0:N.getInitialState(p))!=null?b:p});const x=[];let v=!1;const R={_features:a,options:{...c,...n},initialState:p,_queue:N=>{x.push(N),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{l.setState(l.initialState)},setOptions:N=>{const b=gn(N,l.options);l.options=d(b)},getState:()=>l.options.state,setState:N=>{l.options.onStateChange==null||l.options.onStateChange(N)},_getRowId:(N,b,E)=>{var C;return(C=l.options.getRowId==null?void 0:l.options.getRowId(N,b,E))!=null?C:`${E?[E.id,b].join("."):b}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(N,b)=>{let E=(b?l.getPrePaginationRowModel():l.getRowModel()).rowsById[N];if(!E&&(E=l.getCoreRowModel().rowsById[N],!E))throw new Error;return E},_getDefaultColumnDef:X(()=>[l.options.defaultColumn],N=>{var b;return N=(b=N)!=null?b:{},{header:E=>{const C=E.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:E=>{var C,L;return(C=(L=E.renderValue())==null||L.toString==null?void 0:L.toString())!=null?C:null},...l._features.reduce((E,C)=>Object.assign(E,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...N}},Z(n,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:X(()=>[l._getColumnDefs()],N=>{const b=function(E,C,L){return L===void 0&&(L=0),E.map(I=>{const q=ib(l,I,L,C),$=I;return q.columns=$.columns?b($.columns,q,L+1):[],q})};return b(N)},Z(n,"debugColumns")),getAllFlatColumns:X(()=>[l.getAllColumns()],N=>N.flatMap(b=>b.getFlatColumns()),Z(n,"debugColumns")),_getAllFlatColumnsById:X(()=>[l.getAllFlatColumns()],N=>N.reduce((b,E)=>(b[E.id]=E,b),{}),Z(n,"debugColumns")),getAllLeafColumns:X(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(N,b)=>{let E=N.flatMap(C=>C.getLeafColumns());return b(E)},Z(n,"debugColumns")),getColumn:N=>l._getAllFlatColumnsById()[N]};Object.assign(l,R);for(let N=0;NX(()=>[n.options.data],o=>{const r={rows:[],flatRows:[],rowsById:{}},a=function(l,c,d){c===void 0&&(c=0);const h=[];for(let x=0;xn._autoResetPageIndex()))}function Ad(n,o,r){return r.options.filterFromLeafRows?qb(n,o,r):$b(n,o,r)}function qb(n,o,r){var a;const l=[],c={},d=(a=r.options.maxLeafRowFilterDepth)!=null?a:100,h=function(p,x){x===void 0&&(x=0);const v=[];for(let N=0;NX(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter,n.getFilteredRowModel()],(r,a,l)=>{if(!r.rows.length||!(a!=null&&a.length)&&!l)return r;const c=[...a.map(h=>h.id).filter(h=>h!==o),l?"__global__":void 0].filter(Boolean),d=h=>{for(let p=0;pX(()=>{var r;return[(r=n.getColumn(o))==null?void 0:r.getFacetedRowModel()]},r=>{if(!r)return new Map;let a=new Map;for(let c=0;cX(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter],(o,r,a)=>{if(!o.rows.length||!(r!=null&&r.length)&&!a){for(let N=0;N{var b;const E=n.getColumn(N.id);if(!E)return;const C=E.getFilterFn();C&&l.push({id:N.id,filterFn:C,resolvedValue:(b=C.resolveFilterValue==null?void 0:C.resolveFilterValue(N.value))!=null?b:N.value})});const d=(r??[]).map(N=>N.id),h=n.getGlobalFilterFn(),p=n.getAllLeafColumns().filter(N=>N.getCanGlobalFilter());a&&h&&p.length&&(d.push("__global__"),p.forEach(N=>{var b;c.push({id:N.id,filterFn:h,resolvedValue:(b=h.resolveFilterValue==null?void 0:h.resolveFilterValue(a))!=null?b:a})}));let x,v;for(let N=0;N{b.columnFiltersMeta[C]=L})}if(c.length){for(let E=0;E{b.columnFiltersMeta[C]=L})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const R=N=>{for(let b=0;bn._autoResetPageIndex()))}function Ub(){return n=>X(()=>[n.getState().sorting,n.getPreSortedRowModel()],(o,r)=>{if(!r.rows.length||!(o!=null&&o.length))return r;const a=n.getState().sorting,l=[],c=a.filter(p=>{var x;return(x=n.getColumn(p.id))==null?void 0:x.getCanSort()}),d={};c.forEach(p=>{const x=n.getColumn(p.id);x&&(d[p.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const h=p=>{const x=p.map(v=>({...v}));return x.sort((v,R)=>{for(let b=0;b{var R;l.push(v),(R=v.subRows)!=null&&R.length&&(v.subRows=h(v.subRows))}),x};return{rows:h(r.rows),flatRows:l,rowsById:r.rowsById}},Z(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/** + * react-table + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Gi(n,o){return n?Gb(n)?T.createElement(n,o):n:null}function Gb(n){return Hb(n)||typeof n=="function"||Kb(n)}function Hb(n){return typeof n=="function"&&(()=>{const o=Object.getPrototypeOf(n);return o.prototype&&o.prototype.isReactComponent})()}function Kb(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Fd(n){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=T.useState(()=>({current:kb(o)})),[a,l]=T.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...a,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const Wb=({buttonText:n,title:o="",content:r,className:a=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${a}`,children:i.jsxs(ir,{children:[i.jsx(Ic,{asChild:!0,children:i.jsxs(U,{variant:"link",className:"inline-flex items-center font-medium group",children:[i.jsx("span",{className:"underline-offset-4 group-hover:underline",children:n}),i.jsx($_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(sr,{className:"sm:max-w-[425px]",children:[i.jsx(ar,{children:i.jsx(or,{children:o})}),i.jsxs(ao,{className:"grid gap-4 py-2",children:[r,i.jsx(lr,{children:i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",children:w("common.close")})})})]})]})]})});function Yb(n){let a=0;for(let v=0;v>v*8&255;l+=("00"+R.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),h=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(h*.7|0).toString(16).padStart(2,"0")}`,x=`#${Math.min(255,Math.floor(c+(255-c)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(d+(255-d)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(h+(255-h)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Id=({label:n,className:o})=>{const[r,a]=Yb(n);return i.jsx(oo,{className:o,style:o?{}:{backgroundColor:a,color:r},children:n})};function Dd({table:n,header:o,className:r}){return o.column.getCanSort()?i.jsx("div",{className:ge("flex items-center space-x-2",r),children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{"aria-label":o.column.getIsSorted()==="desc"?w("common.sort_desc_description"):o.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Gi(o.column.columnDef.header,o.getContext()),o.column.getIsSorted()==="desc"?i.jsx(xc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):o.column.getIsSorted()==="asc"?i.jsx(vc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(E0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(Xi,{align:"start",children:[o.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Or,{onClick:()=>o.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(vc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Or,{onClick:()=>o.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(xc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),o.column.getCanSort()&&o.column.getCanHide()&&i.jsx(lo,{}),o.column.getCanHide()&&i.jsxs(Or,{onClick:()=>o.column.toggleVisibility(!1),"aria-label":w("Hide"),children:[i.jsx(dd,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("Hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:ge("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:o.isPlaceholder?null:Gi(o.column.columnDef.header,o.getContext())}),!1]})}function Qb({table:n,className:o,enablePageSizeSelector:r=!0,visible:a="auto"}){const l=T.useMemo(()=>a===!0,[a]),c=T.useMemo(()=>a==="auto",[a]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:o,children:[i.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:n.getSelectedRowModel().rows.length>0&&i.jsx(i.Fragment,{children:w("common.rows_selected_of_total",{count:n.getFilteredSelectedRowModel().rows.length,total:n.getFilteredRowModel().rows.length})})}),i.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[r&&i.jsxs("div",{className:"flex items-center space-x-2 grow",children:[i.jsx("p",{className:"text-sm font-medium",children:w("common.rows_per_page")}),i.jsxs(Zi,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(Ji,{className:"h-8 w-[70px]",children:i.jsx(es,{placeholder:n.getState().pagination.pageSize})}),i.jsx(ts,{side:"top",children:z_.map(d=>i.jsx(Dn,{value:`${d}`,children:d},d))})]})]}),i.jsxs("div",{className:ge("flex space-x-2 flex-1",r?"justify-end":"justify-between"),children:[i.jsx("div",{className:"flex w-[150px] items-center justify-start",children:i.jsx("p",{className:"text-sm font-medium ",children:w("common.num_page_of_total",{count:n.getState().pagination.pageIndex+1,total:n.getPageCount()})})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs(U,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(V_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx(A0,{className:"w-4 h-4"})]}),i.jsxs(U,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.previousPage(),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_prev_page")}),i.jsx(B_,{className:"w-4 h-4"})]}),i.jsxs(U,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.nextPage(),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_next_page")}),i.jsx(U_,{className:"w-4 h-4"})]}),i.jsxs(U,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(n.getPageCount()+1),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_last_page")}),i.jsx(F0,{className:"w-4 h-4"})]})]})]})]})]})}function us({table:n,title:o,description:r,caption:a,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:h,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:R,onRowClick:N,activeRowIndex:b}){var C;const E=c==null?void 0:c.visible;return i.jsxs(Te,{className:h,children:[(o||r)&&i.jsxs(ct,{className:"pb-0",children:[i.jsx(Ve,{children:o}),i.jsx(He,{children:r})]}),i.jsxs(Oe,{className:ge("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(hn,{className:"my-4"})]}),i.jsxs(uo,{children:[typeof a<"u"&&i.jsx(G_,{children:a}),E&&n.getHeaderGroups().length&&i.jsx(co,{children:n.getHeaderGroups().map(L=>i.jsx(pn,{className:v,children:L.headers.map(I=>i.jsx(fo,{colSpan:I.colSpan,style:{width:I.getSize()===Number.MAX_SAFE_INTEGER?"auto":I.getSize()},children:i.jsx(Dd,{table:n,header:I})},I.id))},L.id))}),i.jsx(go,{children:(C=n.getRowModel().rows)!=null&&C.length?n.getRowModel().rows.map(L=>i.jsx(pn,{onClick:()=>{N&&N(L)},tabIndex:0,"data-state":L.getIsSelected()&&"selected",className:ge(L.getIsSelected()||b===L.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:L.getVisibleCells().map(I=>i.jsx(qr,{className:R,style:{width:I.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":I.column.getSize()},children:Gi(I.column.columnDef.cell,I.getContext())},I.id))},L.id)):i.jsx(pn,{className:v,children:i.jsx(qr,{className:ge("h-24 text-center",R),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Nt,{className:x,children:i.jsx(Qb,{className:"flex-1",table:n,...l})})]})}function Xb({actions:n,rowContext:o}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(L0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(Xi,{align:"end",children:[i.jsxs(Dc,{children:[w("common.actions")," "]}),n&&n(o).map((r,a)=>r.label==="-"?i.jsx(lo,{},a):i.jsxs(Or,{onClick:l=>r.onClick?r.onClick(o,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(H_,{children:r.shortcut})]},a))]})]})}function Zb(){return{id:"select",header:({table:n})=>i.jsx(Ui,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:o=>n.toggleAllPageRowsSelected(!!o),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Ui,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:o=>{n.toggleSelected(!!o)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function cs({columnCount:n,rowCount:o=10,searchableColumnCount:r=0,filterableColumnCount:a=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:h=!1,className:p,...x}){return i.jsxs("div",{className:ge("w-full space-y-2.5 overflow-auto",p),...x,children:[i.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[r>0?Array.from({length:r}).map((v,R)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},R)):null,a>0?Array.from({length:a}).map((v,R)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},R)):null]}),l?i.jsx(ut,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),i.jsx("div",{className:"border rounded-md",children:i.jsxs(uo,{children:[i.jsx(co,{children:Array.from({length:1}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((N,b)=>i.jsx(fo,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))}),i.jsx(go,{children:Array.from({length:o}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((N,b)=>i.jsx(qr,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))})]})}),d?i.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[i.jsx(ut,{className:"w-40 h-7 shrink-0"}),i.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"w-24 h-7"}),i.jsx(ut,{className:"h-7 w-[4.5rem]"})]}),i.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:i.jsx(ut,{className:"w-20 h-7"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"hidden size-7 lg:block"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const ds=({title:n="Esto está muy vacío",subtitle:o="Empieza solicitando la carga del catálogo",buttonText:r="Solicitar carga del catálogo",onButtonClick:a=()=>{},actions:l=()=>i.jsx(i.Fragment,{})})=>i.jsxs("div",{className:"text-center",children:[i.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),i.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:n}),i.jsx("p",{className:"mt-1 text-base text-slate-500",children:o}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(U,{className:"my-4",onClick:a,children:[i.jsx(yo,{}),r]})]})]}),Jb=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),Hi=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:N}=n,{control:b}=ur(),[E,C]=T.useState(""),L={input:I=>{if(typeof I!="object")return I;const q=$t.create(I);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(I,q,$)=>{const{value:te}=$??{value:null};C(te??"");const O=$t.createFromFormattedValue(te);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:o,disabled:h,rules:{max:100,min:0,...x},render:({field:I})=>{const q=L.input(I.value),$=h||I.disabled,te=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:ge(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:a,required:te}),i.jsx(xo,{children:i.jsx(Mc,{name:I.name,ref:I.ref,onBlur:I.onBlur,disabled:$,readOnly:v,className:ge(Jb({variant:N,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,K)=>I.onChange(L.output(O,k,K))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},ew=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),tw=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:N}=n,{control:b}=ur(),[E,C]=T.useState(""),L={input:I=>{if(typeof I!="object")return I;const q=xn.create(I);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(I,q,$)=>{const{value:te}=$??{value:null};C(te??"");const O=xn.createFromFormattedValue(te);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:o,disabled:h,rules:x,render:({field:I})=>{const q=L.input(I.value),$=h||I.disabled,te=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:ge(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:a,required:te}),i.jsx(xo,{children:i.jsx(Mc,{name:I.name,ref:I.ref,onBlur:I.onBlur,disabled:$,readOnly:v,className:ge(ew({variant:N,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,K)=>I.onChange(L.output(O,k,K))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},nw=vo("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),mn=n=>{const{name:o,label:r,hint:a,description:l,placeholder:c,className:d,disabled:h,rules:p,required:x,type:v,variant:R}=n,{control:N}=ur();return i.jsx(mo,{control:N,name:o,disabled:h,rules:{required:x,...p},render:({field:b,fieldState:E})=>{const C=!!((p==null?void 0:p.required)??x);return i.jsxs(ho,{className:ge(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:a,required:C}),i.jsx(xo,{className:"block",children:i.jsx(ns,{type:v,placeholder:c,className:ge(E.error?"border-destructive focus-visible:ring-destructive":"",nw({variant:R,className:d})),...b})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})};function rw(n=!1){const[o,r]=T.useState(n);return[o,()=>r(l=>!l)]}const Tn=()=>{const n=T.useContext(K_);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function fs({data:n,columns:o,pageCount:r,enableSorting:a=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:h,meta:p}){const{pagination:x,setPagination:v,sorting:R}=Tn(),[N,b]=Fn.useState({}),[E,C]=Fn.useState((d==null?void 0:d.columnVisibility)||{}),L=te=>{if(typeof te=="function"){const O=te(x);v(O)}h&&h(te)},I=te=>{},q=T.useCallback(()=>{const te=o;return c&&te.unshift(Zb()),te},[o,c]);return{table:Fd({data:n,columns:q(),pageCount:r??-1,meta:p,getCoreRowModel:Ed(),initialState:d,state:{pagination:x,sorting:R,columnVisibility:E,rowSelection:N},enableRowSelection:c,onRowSelectionChange:b,manualSorting:!0,enableSorting:a,getSortedRowModel:Ub(),onSortingChange:I,enableHiding:l,onColumnVisibilityChange:C,manualPagination:!0,onPaginationChange:L,manualFiltering:!0,getFilteredRowModel:Bb(),getFacetedRowModel:zb(),getFacetedUniqueValues:Vb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const iw=({setSize:n,setControllerCallback:o,setPercentageCallback:r,setErrorCallback:a})=>l=>{if(!l.ok)throw Error(`${l.status} ${l.type} ${l.statusText}`);if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.body,d=l.headers.get("content-encoding"),h=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(h||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(R){o(R);const N=c.getReader();async function b(){return N.read().then(({done:E,value:C})=>E?R.close():(x+=(C==null?void 0:C.byteLength)||0,C&&R.enqueue(C),r({loaded:x,total:p}),b())).catch(E=>(a(E),N.cancel("Cancelled"),R.error(E)))}return b()}});return new Response(v)},Cc=(n,o,r)=>{const a=[n],l=new Blob(a,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,o);const c=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),d=document.createElement("a");return d.style.display="none",d.href=c,d.setAttribute("download",o),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(c)},200)};function yc({customHandleDownload:n,...o}={}){var te;let r=!1;try{r=process?!!((te=process==null?void 0:process.env)!=null&&te.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[a,l]=T.useState(0),[c,d]=T.useState(0),[h,p]=T.useState(0),[x,v]=T.useState(null),[R,N]=T.useState(!1),b=T.useRef(null),E=T.useCallback(({loaded:O,total:k})=>{const K=Math.round(O/k*100);d(()=>K)},[]),C=T.useCallback(O=>{const k={"Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into an errored readable stream":"Download canceled","The user aborted a request.":"Download timed out"};v(()=>({errorMessage:k[O.message]?k[O.message]:O.message}))},[]),L=T.useCallback(O=>{b.current=O},[]),I=T.useCallback(()=>{b.current&&b.current.error()},[]),q=T.useCallback(()=>{L(null),l(()=>0),d(()=>0),p(()=>0),N(()=>!1)},[L]),$=T.useCallback(async(O,k,K=0,ne={})=>{if(R)return null;q(),v(()=>null),N(()=>!0);const B=setInterval(()=>l(Je=>Je+1),r?1:1e3),me=iw({setSize:p,setControllerCallback:L,setPercentageCallback:E,setErrorCallback:C}),_e=new AbortController,W=setTimeout(()=>{K>0&&_e.abort()},K),Re=n||Cc;try{const Je=await fetch(O,{method:"GET",...o,...ne,signal:_e.signal}),je=await me(Je).blob();Re(je,k),q()}catch(Je){q(),v(Y=>{const{message:je}=Je;return je!=="Failed to fetch"?{errorMessage:je}:Y}),clearTimeout(W)}finally{clearInterval(B)}},[R,q,r,L,E,C,o,n]);return T.useMemo(()=>({elapsed:a,percentage:c,size:h,download:$,cancel:I,error:x,isInProgress:R,jsDownload:Cc}),[a,c,h,$,I,x,R])}const sw=()=>{const{i18n:n}=rs();return Md({locale:n.language})},Md=n=>{const{locale:o}=n,r=T.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h,currency_code:p}=c;return new Intl.NumberFormat(o??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:h}).format(d===null?0:fc({amount:d,scale:h}))},[o]),a=T.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:h,useGrouping:!0}).format(d===null?0:fc({amount:d,scale:h}))},[o]),l=T.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat(o,{style:"decimal",minimumFractionDigits:h}).format(d===null?0:d)},[o]);return{formatCurrency:r,formatNumber:a,formatPercentage:l}};function Ld(n){const[o,r]=T.useState(!1);return T.useEffect(()=>{function a(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",a),r(l.matches),()=>l.removeEventListener("change",a)},[n]),o}const aw=()=>{const n=T.useContext(W_);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Io=({isDirty:n=!1,title:o=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:a=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:h="warning"})=>{const p=Y_(n),{show:x}=aw(),v=T.useCallback(()=>n?new Promise(R=>{x({title:o,subtitle:r,confirmText:a,cancelText:l,type:h,onConfirm:()=>{R(!0),c==null||c()},onCancel:()=>{R(!1),d==null||d()}})}):Promise.resolve(!0),[l,a,n,d,c,x,r,o,h]);return T.useEffect(()=>{p.state==="blocked"&&v().then(R=>{R?p.proceed():p.reset()})},[p,v]),T.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},Td=n=>{const{isSubmitting:o,isLoading:r,isValidating:a}=Q_();return i.jsx(wo,{disabled:o||r||a,...n})};Td.displayName="FormSubmitButton";const Od={"any.unknown":"{{#label}}: no está permitido","any.invalid":"{{#label}}: contiene un valor invalido","any.empty":"{{#label}}: no está permitido que sea vacío","any.required":"{{#label}}: es un campo requerido","any.allowOnly":"{{#label}}: debería ser uno de las siguientes variantes: {{valids}}","any.default":"emitió un error cuando se ejecutó el metodo default","alternatives.base":"{{#label}}: no coincide con ninguna de las alternativas permitidas","array.base":"{{#label}}: debe ser un array","array.includes":"{{#label}}: en la posición {{pos}} no coincide con ninguno de los tipos permitidos","array.includesSingle":'{{#label}}: el valor de "{{!key}}" no coincide con ninguno de los tipos permitidos',"array.includesOne":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.includesOneSingle":'{{#label}}: el valor "{{!key}}" falló porque {{reason}}',"array.includesRequiredUnknowns":"{{#label}}: no contiene valor/es requerido/s: {{unknownMisses}} ","array.includesRequiredKnowns":"{{#label}}: no contiene: {{knownMisses}}","array.includesRequiredBoth":"{{#label}}: no contiene {{knownMisses}} y {{unknownMisses}} otros valores requeridos","array.excludes":"{{#label}}: en la posición {{pos}} contiene un valor excluído","array.excludesSingle":'{{#label}}: el valor "{{!key}}" contiene un valor excluído',"array.min":"{{#label}}: debe contener al menos {{limit}} items","array.max":"{{#label}}: debe contener máximo {{limit}} items","array.length":"{{#label}}: debe contener exactamente {{limit}} items","array.ordered":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.orderedLength":"{{#label}}: en la posición {{pos}} falló porque el array debre contener como máximo {{limit}} items","array.sparse":"{{#label}}: no debe ser un array esparcido","array.unique":"{{#label}}: posición {{pos}} contiene un valor duplicado","boolean.base":"{{#label}}: debe ser un valor verdadero/falso o si/no","binary.base":"{{#label}}: debe ser un buffer o un string","binary.min":"{{#label}}: debe ser como mínimo de {{limit}} bytes","binary.max":"{{#label}}: debe ser como máximo de {{limit}} bytes","binary.length":"{{#label}}: debe tener exactamente {{limit}} bytes","date.base":"{{#label}}: debe ser una cantidad de milisegundos o una fecha en cadena de texto válida","date.min":'{{#label}}: debe ser mayor o igual a "{{limit}}"',"date.max":'{{#label}}: debe ser menor o igual que "{{limit}}"',"date.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601","date.ref":'referencia a "{{ref}}", que no es una fecha válida',"function.base":"{{#label}}: debe ser una función","object.base":"{{#label}}: debe ser un objeto","object.child":'hijo "{{!key}}" falló porque {{reason}}',"object.min":"{{#label}}: debe tener como mínimo {{limit}} hijo","object.max":"{{#label}}: debe tener menos o a lo sumo {{limit}} hijo","object.length":"{{#label}}: debe tener máximo {{limit}} hijo/s","object.allowUnknown":"no está permitido","object.with":'peer faltante: "{{peer}}"',"object.without":'conflicto con peer prohibido: "{{peer}}"',"object.missing":"{{#label}}: debe contener al menos uno de: {{peers}}","object.xor":"{{#label}}: contiene un conflicto con alguno de: {{peers}}","object.or":"{{#label}}: debe contener al menos uno de: {{peers}}","object.and":"contiene {{present}} sin el requerido: {{missing}}","object.nand":'!!"{{main}}" no debe existir simultáneamente con {{peers}}',"object.assert":'!!"{{ref}}" falló validacion porque "{{ref}}" falló a {{message}}',"object.rename.multiple":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque múltiples re-nombramientos estan deshabilitados y otra clave fue renombrada a "{{to}}"',"object.rename.override":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque la sobre escritura esta deshabilitada y el target "{{to}}" existe',"object.type":'{{#label}}: debe ser una instancia de "{{type}}"',"number.base":"{{#label}}: debe ser un número","number.min":"{{#label}}: debe ser mayor o igual que {{limit}}","number.max":"{{#label}}: debe ser menor o igual que {{limit}}","number.less":"{{#label}}: debe ser menor a {{limit}}","number.greater":"{{#label}}: debe ser mayor a {{limit}}","number.float":"{{#label}}: debe ser un numero flotante","number.integer":"{{#label}}: debe ser un número entero","number.negative":"{{#label}}: debe ser un número negativo","number.positive":"{{#label}}: debe ser un número positivo","number.precision":"{{#label}}: no debe tener mas de {{limit}} decimales","number.ref":'{{#label}}: referencia a "{{ref}}" que no es un número',"number.multiple":"{{#label}}: debe ser un múltiplo de {{multiple}}","string.base":"{{#label}}: debe ser una cadena de texto","string.empty":"{{#label}}: no está permitido que sea vacío","string.min":"{{#label}}: debe ser mínimo de {{limit}} caracteres de largo","string.max":"{{#label}}: debe ser de máximo {{limit}} caracteres de largo","string.length":"{{#label}}: debe ser exactamente de {{limit}} caracteres de largo","string.alphanum":"{{#label}}: debe contener solo letras y números","string.token":"{{#label}}: debe contener solo letras, números y guines bajos","string.regex.base":'{{#label}}: el valor "{{!value}}" no coincide con el pattern requerido: {{pattern}}',"string.regex.name":'{{#label}}: el valor "{{!value}}" no coincide con el nombre de pattern {{name}}',"string.email":"{{#label}}: debe ser un email válido","string.uri":"{{#label}}: debe sre una uri válida","string.uriCustomScheme":"{{#label}}: debe ser una uri válida con el esquema concidiente con el patrón {{scheme}}","string.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601 válida","string.guid":"{{#label}}: debe ser un GUID valido","string.hex":"{{#label}}: debe contener solo caracteres hexadecimales","string.hostname":"{{#label}}: deber ser un hostname válido","string.lowercase":"{{#label}}: solo debe contener minúsculas","string.uppercase":"{{#label}}: solo debe contener mayúsculas","string.trim":"{{#label}}: no debe tener espacios en blanco delante o atrás","string.creditCard":"{{#label}}: debe ser una tarjeta de crédito","string.ref":'Referencia "{{ref}}" que no es un número',"string.ip":"{{#label}}: debe ser una dirección ip válida con un CDIR {{cidr}}","string.ipVersion":"{{#label}}: debe ser una dirección ip válida de una de las siguientes versiones {{version}} con un CDIR {{cidr}}","object.unknown":"{{#label}}: es un campo no es permitido","luxon.lt":"{{#label}}: must be before {{#date}}","luxon.gt":"{{#label}}: must be after {{#date}}","luxon.lte":"{{#label}}: must be same as or before {{#date}}","luxon.gte":"{{#label}}: must be same as or after {{#date}}"},Vi=[{code:"en",name:"English",flag:()=>i.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>i.jsx("span",{className:"fi fi-es"})}],Ww=()=>{var R,N,b,E;const{t:n,i18n:o}=rs(),[r,a]=T.useState(o.language),l=zt(),{toast:c}=_n();T.useEffect(()=>{const C=navigator.language.split("-")[0],L=Vi.find(I=>I.code===C);L&&d(L.code)},[]);const d=C=>{o.changeLanguage(C),a(C)},{mutate:h,status:p}=R0({onSuccess:C=>{const{success:L,error:I}=C;!L&&I&&x.setError("root",I),L&&l("/quotes",{replace:!0})},onError:C=>{const{message:L}=C;c({description:L,title:"Error"}),console.log(C)}}),x=is({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Lc(In.object({email:In.string().email({tlds:{allow:!1}}).required(),password:In.string().min(4).alphanum().required()}),{messages:Od})}),v=async C=>{h({email:C.email,password:C.password},{})};return i.jsxs(X_,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[i.jsx("div",{className:"flex items-center justify-center py-12 ",children:i.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[i.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:(R=Vi.find(C=>C.code===r))==null?void 0:R.flag()}),(N=Vi.find(C=>C.code===r))==null?void 0:N.name,i.jsx(Tc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(Xi,{className:"w-[140px]",children:Vi.map(C=>i.jsxs(Or,{onSelect:()=>d(C.code),children:[i.jsx("span",{className:"mr-2",children:C.flag()}),C.name]},C.code))})]})}),i.jsxs(Te,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(ct,{children:[i.jsx(Z_,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ve,{children:i.jsx(se,{i18nKey:"login_page.title"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"login_page.description"})})]}),i.jsx(Oe,{children:i.jsx(ss,{...x,children:i.jsx("form",{onSubmit:x.handleSubmit(v),children:i.jsxs("div",{className:"grid items-start gap-6",children:[i.jsx("div",{className:"grid gap-6",children:i.jsx(mn,{required:!0,disabled:p==="pending",name:"email",label:n("login_page.email_label"),type:"email",placeholder:n("login_page.email_placeholder")})}),i.jsxs("div",{className:"grid gap-6",children:[i.jsx(mn,{required:!0,disabled:p==="pending",name:"password",label:n("login_page.password_label"),type:"password"}),i.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[i.jsx(se,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(gc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{i18nKey:"login_page.contact_us"})})]})]}),((b=x.formState.errors.root)==null?void 0:b.message)&&i.jsxs(Oc,{variant:"destructive",children:[i.jsx(ud,{className:"w-4 h-4"}),i.jsx(Pc,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(kc,{children:(E=x.formState.errors.root)==null?void 0:E.message})]}),i.jsx(Td,{className:"w-full",disabled:p==="pending"}),i.jsxs("div",{className:"mt-4 text-sm text-center",children:[i.jsx(se,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(gc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(se,{i18nKey:"login_page.contact_us"})}),i.jsx("br",{}),i.jsxs("p",{className:"mx-auto mt-4 -mb-6 text-xs text-muted-foreground/50",children:["v.","1.1.8"]})]})]})})})})]}),i.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),i.jsx("div",{className:"hidden bg-muted lg:block",children:i.jsx("img",{src:"/img/nara2.jpg",alt:"Image",width:"1920",height:"1080",className:"h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"})})]})},ow=n=>{const{onSuccess:o,onError:r,...a}=n||{},l=Jt(),c=Mn(),{logout:d}=Ec(),h=zt(),{toast:p}=_n();return en({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,R)=>{l.clear();const{success:N,redirectTo:b}=x;N&&b&&h(b||"/"),o&&o(x,v,R)},onError:(x,v,R)=>{const{message:N}=x;p({title:"Error",description:N,variant:"destructive"}),r&&r(x,v,R)},...a})},Yw=()=>{const{mutate:n}=ow({});return T.useEffect(()=>n(),[n]),i.jsx(Ln,{})},lw=T.createContext(null),uw=({children:n})=>{const[o,r]=qc();return i.jsx(lw.Provider,{value:{pagination:o,setPagination:r},children:n})},Qw=({children:n})=>i.jsx(as,{children:i.jsx(uw,{children:i.jsxs(zr,{className:"catalog-layout",children:[i.jsx(Vr,{}),i.jsx(Br,{children:n})]})})}),Pd=n=>{const o=$r(),r=Mn(),{pagination:a,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>o.getList({resource:"catalog",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})};function kd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=Fn.useRef(null),[x,v]=Fn.useState(""),R=Fn.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(C=>[...C,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(C=>C.slice(0,-1)))},[l,x]),N=Fn.useCallback(E=>{d(C=>C.filter(L=>L!==E))},[]),b=Fn.useCallback(()=>{var E;x.trim()&&(d(C=>[...C,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(J_,{children:i.jsxs("div",{className:"w-full space-y-2",...a,children:[i.jsxs("div",{className:ge("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",c?"border-primary":"border-input"),children:[i.jsx($c,{className:ge("w-4 h-4 text-gray-500")}),i.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[l&&l.map(E=>i.jsxs(oo,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[E,i.jsxs(U,{variant:"ghost",onClick:()=>N(E),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Wa,{className:"w-4 h-4"})}),i.jsx(Ye,{children:i.jsx("p",{children:w("catalog.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("catalog.filter.badget_remove_tooltip")})]})]},E)),i.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[i.jsx("input",{ref:p,value:x,onChange:E=>v(E.target.value),onKeyDown:R,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(nr,{children:[c&&i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Wa,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(Ye,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"default",size:"icon",disabled:!x,onClick:b,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(yo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(Ye,{children:i.jsx("p",{children:w("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("common.filter.help_text")})]})})}const cw=()=>{const n=zt(),{pagination:o,globalFilter:r,isFiltered:a}=Tn(),{data:l,isPending:c,isError:d,error:h}=Pd({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=T.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:v})=>i.jsx("div",{className:"text-right",children:v()})},{id:"retail_price",accessorKey:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:v})=>{const R=Lt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:R.toFormat()})}}],[]),{table:x}=fs({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1,initialState:{columnVisibility:{id:!1,id_article:!1,catalog_name:!1}}});return d?i.jsx(cr,{subtitle:h.message}):c?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ds,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(us,{table:x,paginationOptions:{visible:!0},children:i.jsx(kd,{table:x})})},Xw=()=>i.jsxs(rr,{children:[i.jsx("div",{className:"flex items-center justify-between space-y-2",children:i.jsx("div",{children:i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(se,{i18nKey:"catalog.list.title"})})})}),i.jsx(cw,{})]}),Zw=()=>{const{data:n,status:o}=e0();return i.jsxs(zr,{children:[i.jsx(Vr,{}),i.jsx(Br,{children:o==="success"?i.jsx("div",{className:"flex items-center",children:i.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${w("dashboard.welcome")}, ${n==null?void 0:n.name}`})}):i.jsx(ut,{className:"w-[100px] h-[20px] rounded-full"})})]})},Jw=({children:n})=>i.jsx(as,{children:i.jsxs(zr,{className:"dealers-layout",children:[i.jsx(Vr,{}),i.jsx(Br,{children:n})]})});function dw({table:n}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx($0,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),i.jsxs(Xi,{align:"end",className:"w-[150px]",children:[i.jsx(Dc,{children:"Columnas"}),i.jsx(lo,{}),n.getAllColumns().filter(o=>typeof o.accessorFn<"u"&&o.getCanHide()).map(o=>i.jsx(t0,{className:"capitalize",checked:o.getIsVisible(),onCheckedChange:r=>o.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:o.columnDef.header})},o.id))]})]})}function qd({table:n,className:o,children:r,...a}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=x=>{const v=String(x.target.value);v===""?h():d([v])};return i.jsxs("div",{className:ge("flex w-full items-center justify-between space-x-2 overflow-auto p-1",o),...a,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx($c,{className:"w-4 h-4 text-gray-500"}),i.jsx(ns,{placeholder:w("common.filter.input_placeholder"),value:l,onChange:p,className:ge("h-8 w-full transition-all")},"global-filter"),c&&i.jsxs(U,{variant:"outline",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Wa,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r,n.options.enableHiding&&i.jsx(dw,{table:n})]})]})}const fw=n=>{const o=$r(),r=Mn(),{pagination:a,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>o.getList({resource:"dealers",quickSearchTerm:l,pagination:a}),enabled:c,queryOptions:d})},gw=()=>{const n=zt(),{pagination:o,globalFilter:r,isFiltered:a}=Tn(),{data:l,isPending:c,isError:d,error:h}=fw({pagination:{pageIndex:o.pageIndex,pageSize:o.pageSize},searchTerm:r}),p=T.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=fs({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(cr,{subtitle:h.message}):c?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!a?i.jsx(ds,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(us,{table:x,paginationOptions:{visible:!0},children:i.jsx(qd,{table:x})})})},eS=()=>i.jsx(rr,{children:i.jsx(gw,{})}),tS=()=>i.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"max-w-md mx-auto text-center",children:[i.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),i.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),i.jsx("div",{className:"mt-6",children:i.jsx(U,{className:"inline-flex items-center px-4 py-2 text-sm font-medium transition-colors rounded-md shadow-sm bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:"Go to Homepage"})})]})}),$d=T.createContext({attributes:{role:"button",tabIndex:0,"aria-disabled":!1,"aria-pressed":void 0,"aria-roledescription":"sortable","aria-describedby":""},listeners:void 0,ref(){},isDragging:!1});function mw(n){return n.isSorting||n.wasDragging?r0(n):!0}function hw({id:n,children:o,isActive:r=!1,onActivate:a}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:h,setActivatorNodeRef:p,transform:x,transition:v}=n0({animateLayoutChanges:mw,id:n}),R={transform:Ya.Translate.toString(x),transition:v},N=T.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx($d.Provider,{value:N,children:i.jsx(pn,{id:String(n),className:ge(c?"opacity-60":"opacity-100",r?"border border-destructive/30 border-b-0 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5 focus-within:bg-destructive/5":"hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent","m-0"),ref:h,style:R,onClick:a,onFocusCapture:a,children:o},n)})}const pw=({className:n})=>{const{attributes:o,isDragging:r,listeners:a,ref:l}=T.useContext($d);return i.jsxs(U,{ref:l,onClick:c=>{c.preventDefault()},size:"icon",variant:"link",className:ge(r?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",n),...o,...a,children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function xw(n,o={}){const{enableDragHandleColumn:r=!1,enableSelectionColumn:a=!1,enableActionsColumn:l=!1,rowActionFn:c=void 0}=o;return T.useMemo(()=>(r&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(pw,{}),enableSorting:!1,enableHiding:!1,size:40}),a&&n.unshift({id:"select",header:({table:d})=>i.jsx(Ui,{id:"select-all",checked:d.getIsAllPageRowsSelected()||d.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:h=>d.toggleAllPageRowsSelected(!!h),"aria-label":"Seleccionar todo",className:"translate-y-[0px]"}),cell:({row:d})=>i.jsx(Ui,{id:`select-row-${d.id}`,checked:d.getIsSelected(),disabled:!d.getCanSelect(),onCheckedChange:d.getToggleSelectedHandler(),"aria-label":"Seleccionar fila",className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),l&&n.push({id:"row_actions",cell:d=>i.jsx(Xb,{rowContext:d,actions:c}),enableSorting:!1,enableHiding:!1,size:48}),n),[l,r,a])}var zd={exports:{}};(function(n,o){(function(r,a,l){n.exports=l(),n.exports.default=l()})("slugify",Zn,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),a=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function l(c,d){if(typeof c!="string")throw new Error("slugify: string argument expected");d=typeof d=="string"?{replacement:d}:d||{};var h=a[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(R,N){var b=h[N];return b===void 0&&(b=r[N]),b===void 0&&(b=N),b===p&&(b=" "),R+b.replace(d.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return d.strict&&(v=v.replace(/[^A-Za-z0-9\s]/g,"")),x&&(v=v.trim()),v=v.replace(/\s+/g,p),d.lower&&(v=v.toLowerCase()),v}return l.extend=function(c){Object.assign(r,c)},l})})(zd);var vw=zd.exports;const _w=i0(vw),Ur=()=>{const n=$r(),o=Mn(),r=T.useCallback(c=>`${n.getApiUrl()}/quotes/${c}/report`,[n]),a=T.useCallback(c=>`quote-${_w(c.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),l={useList:c=>{const d=$r(),h=Mn(),{pagination:p,status:x="draft",quickSearchTerm:v=void 0,enabled:R=!0,queryOptions:N}=c;return No({queryKey:h().data().resource("quotes").action("list").params(c).get(),queryFn:()=>d.getList({resource:"quotes",quickSearchTerm:v,filters:x!=="all"?[{field:"status",operator:"eq",value:x}]:[{field:"status",operator:"ne",value:"archived"}],pagination:p}),enabled:R,queryOptions:N})},useCreate:()=>{const c=Jt();return J0({mutationFn:d=>{const{date:h}=d,p=dn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...d,date:new Date(h).toISOString().slice(0,10),status:"draft",id:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:c=>{const d=Jt();return en({mutationKey:o().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>n.updateOne({resource:"quotes",id:c,data:h}),onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h,newStatus:p}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/setStatus`,method:"put",data:{newStatus:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/duplicate`,method:"post"})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:c=>{const d=Jt();return en({mutationKey:o().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>{const{sent_date:p}=h;return n.custom({url:`${n.getApiUrl()}/quotes/${c}/send`,method:"put",data:{sent_date:p}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(c,d)=>vd({queryKey:o().data().resource("quotes").action("one").id(c).params().get(),queryFn:()=>n.getOne({resource:"quotes",id:String(c)}),enabled:!!c,...d}),getQuotePDFDownloadURL:r,getQuotePDFFilename:a,useReport:()=>{const c=n.getApiAuthorization(),[d,h]=T.useState(void 0),{download:p,...x}=yc({headers:{Authorization:c},customHandleDownload:T.useCallback(R=>{const N=[R],b=new Blob(N,{type:"application/octet-stream"});return h(b),!0},[h])}),v=T.useCallback(R=>p(l.getQuotePDFDownloadURL(R),""),[p]);return{...x,preview:v,report:d}},useDownloader:()=>{const c=n.getApiAuthorization(),d=yc({headers:{Authorization:c}});return{...d,download:(p,x)=>{const v=l.getQuotePDFDownloadURL(p);return d.download(v,x)}}}};return l},nS=()=>{const n=zt(),{toast:o}=_n(),{useCreate:r}=Ur(),{mutate:a,isPending:l}=r(),c=T.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),d=is({mode:"onBlur",defaultValues:c,resolver:Lc(In.object({customer_reference:In.string(),date:In.date().required(),customer_information:In.string().required()}),{messages:{es:Od}})}),{formState:h,reset:p,getValues:x,handleSubmit:v}=d,{isSubmitting:R,isDirty:N}=h;Io({isDirty:N});const b=async E=>{try{a(E,{onError:C=>{console.debug(C),o({title:"Error",description:C.message,variant:"destructive"})},onSuccess:C=>{p(x()),o({title:"Cotización creada",variant:"default"}),n(`/quotes/edit/${C.id}`,{relative:"path"})}})}finally{}};return R?i.jsx(Ln,{title:"Guardando ajustes"}):l?i.jsx(Ln,{}):i.jsx(ss,{...d,children:i.jsx("form",{onSubmit:v(b),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(zc,{}),i.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:w("quotes.create.title")})]}),i.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:i.jsxs(Qa,{className:"md:col-span-4",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),footerActions:i.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[i.jsx(U,{size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(wo,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(mn,{required:!0,name:"customer_reference",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),placeholder:w("quotes.form_fields.customer_reference.placeholder")}),i.jsx(Vc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(hn,{}),i.jsx(qt,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),placeholder:w("quotes.form_fields.customer_information.placeholder")})]})})]})})})},Ka=(n,o=!1)=>{const{discount:r,tax:a,subtotal_price:l}=n||{},c=$t.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=$t.create(a||{amount:null,scale:2});if(h.isFailure)throw h.error;const p=h.object,x=Lt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=o?bw(n.items).convertScale(2):x.object,R=v.percentage(d.toNumber()).convertScale(2),N=v.subtract(R).convertScale(2),b=N.percentage(p.toNumber()).convertScale(2),E=N.add(b).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:R,before_tax_price:N,tax:p,tax_price:b,total_price:E}},bw=n=>{let o=Lt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const a=io(r);o=o.add(a.total_price)}),o},io=n=>{const{quantity:o,unit_price:r,discount:a}=n||{};if((!o||o&&o.amount===null)&&(!r||r&&r.amount===null)&&(!a||a&&a.amount===null))return{quantity:xn.create({amount:null,scale:0}).object,unit_price:Lt.create({amount:null,scale:2}).object,subtotal_price:Lt.create({amount:null,scale:2}).object,discount:$t.create({amount:null,scale:2}).object,total_price:Lt.create({amount:null,scale:2}).object};const l=xn.create(o);if(l.isFailure)throw l.error;const c=l.object,d=Lt.create(r);if(d.isFailure)throw d.error;const h=d.object,p=$t.create(a);if(p.isFailure)throw p.error;const x=p.object,v=h.multiply(c.toNumber()),R=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:h,subtotal_price:v,discount:x,total_price:R}},ww=()=>{const{id:n}=s0();return n};var Ki={exports:{}};/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */Ki.exports;(function(n,o){(function(){var r,a="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",h="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",x=500,v="__lodash_placeholder__",R=1,N=2,b=4,E=1,C=2,L=1,I=2,q=4,$=8,te=16,O=32,k=64,K=128,ne=256,B=512,me=30,_e="...",W=800,Re=16,Je=1,Y=2,je=3,De=1/0,G=9007199254740991,be=17976931348623157e292,et=NaN,it=4294967295,bn=it-1,Hd=it>>>1,Kd=[["ary",K],["bind",L],["bindKey",I],["curry",$],["curryRight",te],["flip",B],["partial",O],["partialRight",k],["rearg",ne]],On="[object Arguments]",Gr="[object Array]",Wd="[object AsyncFunction]",fr="[object Boolean]",gr="[object Date]",Yd="[object DOMException]",Hr="[object Error]",Kr="[object Function]",To="[object GeneratorFunction]",Et="[object Map]",mr="[object Number]",Qd="[object Null]",Vt="[object Object]",Oo="[object Promise]",Xd="[object Proxy]",hr="[object RegExp]",At="[object Set]",pr="[object String]",Wr="[object Symbol]",Zd="[object Undefined]",xr="[object WeakMap]",Jd="[object WeakSet]",vr="[object ArrayBuffer]",Pn="[object DataView]",gs="[object Float32Array]",ms="[object Float64Array]",hs="[object Int8Array]",ps="[object Int16Array]",xs="[object Int32Array]",vs="[object Uint8Array]",_s="[object Uint8ClampedArray]",bs="[object Uint16Array]",ws="[object Uint32Array]",ef=/\b__p \+= '';/g,tf=/\b(__p \+=) '' \+/g,nf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Po=/&(?:amp|lt|gt|quot|#39);/g,ko=/[&<>"']/g,rf=RegExp(Po.source),sf=RegExp(ko.source),af=/<%-([\s\S]+?)%>/g,of=/<%([\s\S]+?)%>/g,qo=/<%=([\s\S]+?)%>/g,lf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uf=/^\w*$/,cf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ss=/[\\^$.*+?()[\]{}|]/g,df=RegExp(Ss.source),js=/^\s+/,ff=/\s/,gf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mf=/\{\n\/\* \[wrapped with (.+)\] \*/,hf=/,? & /,pf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xf=/[()=,{}\[\]\/\s]/,vf=/\\(\\)?/g,_f=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$o=/\w*$/,bf=/^[-+]0x[0-9a-f]+$/i,wf=/^0b[01]+$/i,Sf=/^\[object .+?Constructor\]$/,jf=/^0o[0-7]+$/i,Cf=/^(?:0|[1-9]\d*)$/,yf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yr=/($^)/,Nf=/['\n\r\u2028\u2029\\]/g,Qr="\\ud800-\\udfff",Rf="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",Af="\\u20d0-\\u20ff",zo=Rf+Ef+Af,Vo="\\u2700-\\u27bf",Bo="a-z\\xdf-\\xf6\\xf8-\\xff",Ff="\\xac\\xb1\\xd7\\xf7",If="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Df="\\u2000-\\u206f",Mf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Uo="A-Z\\xc0-\\xd6\\xd8-\\xde",Go="\\ufe0e\\ufe0f",Ho=Ff+If+Df+Mf,Cs="['’]",Lf="["+Qr+"]",Ko="["+Ho+"]",Xr="["+zo+"]",Wo="\\d+",Tf="["+Vo+"]",Yo="["+Bo+"]",Qo="[^"+Qr+Ho+Wo+Vo+Bo+Uo+"]",ys="\\ud83c[\\udffb-\\udfff]",Of="(?:"+Xr+"|"+ys+")",Xo="[^"+Qr+"]",Ns="(?:\\ud83c[\\udde6-\\uddff]){2}",Rs="[\\ud800-\\udbff][\\udc00-\\udfff]",kn="["+Uo+"]",Zo="\\u200d",Jo="(?:"+Yo+"|"+Qo+")",Pf="(?:"+kn+"|"+Qo+")",el="(?:"+Cs+"(?:d|ll|m|re|s|t|ve))?",tl="(?:"+Cs+"(?:D|LL|M|RE|S|T|VE))?",nl=Of+"?",rl="["+Go+"]?",kf="(?:"+Zo+"(?:"+[Xo,Ns,Rs].join("|")+")"+rl+nl+")*",qf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$f="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",il=rl+nl+kf,zf="(?:"+[Tf,Ns,Rs].join("|")+")"+il,Vf="(?:"+[Xo+Xr+"?",Xr,Ns,Rs,Lf].join("|")+")",Bf=RegExp(Cs,"g"),Uf=RegExp(Xr,"g"),Es=RegExp(ys+"(?="+ys+")|"+Vf+il,"g"),Gf=RegExp([kn+"?"+Yo+"+"+el+"(?="+[Ko,kn,"$"].join("|")+")",Pf+"+"+tl+"(?="+[Ko,kn+Jo,"$"].join("|")+")",kn+"?"+Jo+"+"+el,kn+"+"+tl,$f,qf,Wo,zf].join("|"),"g"),Hf=RegExp("["+Zo+Qr+zo+Go+"]"),Kf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Yf=-1,ye={};ye[gs]=ye[ms]=ye[hs]=ye[ps]=ye[xs]=ye[vs]=ye[_s]=ye[bs]=ye[ws]=!0,ye[On]=ye[Gr]=ye[vr]=ye[fr]=ye[Pn]=ye[gr]=ye[Hr]=ye[Kr]=ye[Et]=ye[mr]=ye[Vt]=ye[hr]=ye[At]=ye[pr]=ye[xr]=!1;var Ce={};Ce[On]=Ce[Gr]=Ce[vr]=Ce[Pn]=Ce[fr]=Ce[gr]=Ce[gs]=Ce[ms]=Ce[hs]=Ce[ps]=Ce[xs]=Ce[Et]=Ce[mr]=Ce[Vt]=Ce[hr]=Ce[At]=Ce[pr]=Ce[Wr]=Ce[vs]=Ce[_s]=Ce[bs]=Ce[ws]=!0,Ce[Hr]=Ce[Kr]=Ce[xr]=!1;var Qf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Xf={"&":"&","<":"<",">":">",'"':""","'":"'"},Zf={"&":"&","<":"<",">":">",""":'"',"'":"'"},Jf={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eg=parseFloat,tg=parseInt,sl=typeof Zn=="object"&&Zn&&Zn.Object===Object&&Zn,ng=typeof self=="object"&&self&&self.Object===Object&&self,Be=sl||ng||Function("return this")(),As=o&&!o.nodeType&&o,wn=As&&!0&&n&&!n.nodeType&&n,al=wn&&wn.exports===As,Fs=al&&sl.process,vt=function(){try{var j=wn&&wn.require&&wn.require("util").types;return j||Fs&&Fs.binding&&Fs.binding("util")}catch{}}(),ol=vt&&vt.isArrayBuffer,ll=vt&&vt.isDate,ul=vt&&vt.isMap,cl=vt&&vt.isRegExp,dl=vt&&vt.isSet,fl=vt&&vt.isTypedArray;function dt(j,F,A){switch(A.length){case 0:return j.call(F);case 1:return j.call(F,A[0]);case 2:return j.call(F,A[0],A[1]);case 3:return j.call(F,A[0],A[1],A[2])}return j.apply(F,A)}function rg(j,F,A,V){for(var re=-1,fe=j==null?0:j.length;++re-1}function Is(j,F,A){for(var V=-1,re=j==null?0:j.length;++V-1;);return A}function bl(j,F){for(var A=j.length;A--&&qn(F,j[A],0)>-1;);return A}function fg(j,F){for(var A=j.length,V=0;A--;)j[A]===F&&++V;return V}var gg=Ts(Qf),mg=Ts(Xf);function hg(j){return"\\"+Jf[j]}function pg(j,F){return j==null?r:j[F]}function $n(j){return Hf.test(j)}function xg(j){return Kf.test(j)}function vg(j){for(var F,A=[];!(F=j.next()).done;)A.push(F.value);return A}function qs(j){var F=-1,A=Array(j.size);return j.forEach(function(V,re){A[++F]=[re,V]}),A}function wl(j,F){return function(A){return j(F(A))}}function rn(j,F){for(var A=-1,V=j.length,re=0,fe=[];++A-1}function sm(e,t){var s=this.__data__,u=hi(s,e);return u<0?(++this.size,s.push([e,t])):s[u][1]=t,this}Bt.prototype.clear=tm,Bt.prototype.delete=nm,Bt.prototype.get=rm,Bt.prototype.has=im,Bt.prototype.set=sm;function Ut(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function St(e,t,s,u,f,m){var _,S=t&R,y=t&N,D=t&b;if(s&&(_=f?s(e,u,f,m):s(e)),_!==r)return _;if(!Ae(e))return e;var M=ie(e);if(M){if(_=uh(e),!S)return st(e,_)}else{var P=Xe(e),z=P==Kr||P==To;if(cn(e))return ru(e,S);if(P==Vt||P==On||z&&!f){if(_=y||z?{}:Su(e),!S)return y?Zm(e,wm(_,e)):Xm(e,Ml(_,e))}else{if(!Ce[P])return f?e:{};_=ch(e,P,S)}}m||(m=new It);var H=m.get(e);if(H)return H;m.set(e,_),Xu(e)?e.forEach(function(ee){_.add(St(ee,t,s,ee,e,m))}):Yu(e)&&e.forEach(function(ee,ue){_.set(ue,St(ee,t,s,ue,e,m))});var J=D?y?da:ca:y?ot:ze,oe=M?r:J(e);return _t(oe||e,function(ee,ue){oe&&(ue=ee,ee=e[ue]),yr(_,ue,St(ee,t,s,ue,e,m))}),_}function Sm(e){var t=ze(e);return function(s){return Ll(s,e,t)}}function Ll(e,t,s){var u=s.length;if(e==null)return!u;for(e=we(e);u--;){var f=s[u],m=t[f],_=e[f];if(_===r&&!(f in e)||!m(_))return!1}return!0}function Tl(e,t,s){if(typeof e!="function")throw new bt(d);return Dr(function(){e.apply(r,s)},t)}function Nr(e,t,s,u){var f=-1,m=Zr,_=!0,S=e.length,y=[],D=t.length;if(!S)return y;s&&(t=Ee(t,ft(s))),u?(m=Is,_=!1):t.length>=l&&(m=_r,_=!1,t=new Cn(t));e:for(;++ff?0:f+s),u=u===r||u>f?f:ae(u),u<0&&(u+=f),u=s>u?0:Ju(u);s0&&s(S)?t>1?Ue(S,t-1,s,u,f):nn(f,S):u||(f[f.length]=S)}return f}var Hs=uu(),kl=uu(!0);function Ot(e,t){return e&&Hs(e,t,ze)}function Ks(e,t){return e&&kl(e,t,ze)}function xi(e,t){return tn(t,function(s){return Yt(e[s])})}function Nn(e,t){t=ln(t,e);for(var s=0,u=t.length;e!=null&&st}function ym(e,t){return e!=null&&pe.call(e,t)}function Nm(e,t){return e!=null&&t in we(e)}function Rm(e,t,s){return e>=Qe(t,s)&&e<$e(t,s)}function Ys(e,t,s){for(var u=s?Is:Zr,f=e[0].length,m=e.length,_=m,S=A(m),y=1/0,D=[];_--;){var M=e[_];_&&t&&(M=Ee(M,ft(t))),y=Qe(M.length,y),S[_]=!s&&(t||f>=120&&M.length>=120)?new Cn(_&&M):r}M=e[0];var P=-1,z=S[0];e:for(;++P-1;)S!==e&&li.call(S,y,1),li.call(e,y,1);return e}function Yl(e,t){for(var s=e?t.length:0,u=s-1;s--;){var f=t[s];if(s==u||f!==m){var m=f;Wt(f)?li.call(e,f,1):ra(e,f)}}return e}function ea(e,t){return e+di(Al()*(t-e+1))}function $m(e,t,s,u){for(var f=-1,m=$e(ci((t-e)/(s||1)),0),_=A(m);m--;)_[u?m:++f]=e,e+=s;return _}function ta(e,t){var s="";if(!e||t<1||t>G)return s;do t%2&&(s+=e),t=di(t/2),t&&(e+=e);while(t);return s}function le(e,t){return va(yu(e,t,lt),e+"")}function zm(e){return Dl(Xn(e))}function Vm(e,t){var s=Xn(e);return Ei(s,yn(t,0,s.length))}function Ar(e,t,s,u){if(!Ae(e))return e;t=ln(t,e);for(var f=-1,m=t.length,_=m-1,S=e;S!=null&&++ff?0:f+t),s=s>f?f:s,s<0&&(s+=f),f=t>s?0:s-t>>>0,t>>>=0;for(var m=A(f);++u>>1,_=e[m];_!==null&&!mt(_)&&(s?_<=t:_=l){var D=t?null:nh(e);if(D)return ei(D);_=!1,f=_r,y=new Cn}else y=t?[]:S;e:for(;++u=u?e:jt(e,t,s)}var nu=Mg||function(e){return Be.clearTimeout(e)};function ru(e,t){if(t)return e.slice();var s=e.length,u=Cl?Cl(s):new e.constructor(s);return e.copy(u),u}function oa(e){var t=new e.constructor(e.byteLength);return new ai(t).set(new ai(e)),t}function Km(e,t){var s=t?oa(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Wm(e){var t=new e.constructor(e.source,$o.exec(e));return t.lastIndex=e.lastIndex,t}function Ym(e){return Cr?we(Cr.call(e)):{}}function iu(e,t){var s=t?oa(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function su(e,t){if(e!==t){var s=e!==r,u=e===null,f=e===e,m=mt(e),_=t!==r,S=t===null,y=t===t,D=mt(t);if(!S&&!D&&!m&&e>t||m&&_&&y&&!S&&!D||u&&_&&y||!s&&y||!f)return 1;if(!u&&!m&&!D&&e=S)return y;var D=s[u];return y*(D=="desc"?-1:1)}}return e.index-t.index}function au(e,t,s,u){for(var f=-1,m=e.length,_=s.length,S=-1,y=t.length,D=$e(m-_,0),M=A(y+D),P=!u;++S1?s[f-1]:r,_=f>2?s[2]:r;for(m=e.length>3&&typeof m=="function"?(f--,m):r,_&&nt(s[0],s[1],_)&&(m=f<3?r:m,f=1),t=we(t);++u-1?f[m?t[_]:_]:r}}function fu(e){return Kt(function(t){var s=t.length,u=s,f=wt.prototype.thru;for(e&&t.reverse();u--;){var m=t[u];if(typeof m!="function")throw new bt(d);if(f&&!_&&Ni(m)=="wrapper")var _=new wt([],!0)}for(u=_?u:s;++u1&&de.reverse(),M&&yS))return!1;var D=m.get(e),M=m.get(t);if(D&&M)return D==t&&M==e;var P=-1,z=!0,H=s&C?new Cn:r;for(m.set(e,t),m.set(t,e);++P1?"& ":"")+t[u],t=t.join(s>2?", ":" "),e.replace(gf,`{ +/* [wrapped with `+t+`] */ +`)}function fh(e){return ie(e)||An(e)||!!(Rl&&e&&e[Rl])}function Wt(e,t){var s=typeof e;return t=t??G,!!t&&(s=="number"||s!="symbol"&&Cf.test(e))&&e>-1&&e%1==0&&e0){if(++t>=W)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ei(e,t){var s=-1,u=e.length,f=u-1;for(t=t===r?u:t;++s1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,Pu(e,s)});function ku(e){var t=g(e);return t.__chain__=!0,t}function jp(e,t){return t(e),e}function Ai(e,t){return t(e)}var Cp=Kt(function(e){var t=e.length,s=t?e[0]:0,u=this.__wrapped__,f=function(m){return Gs(m,e)};return t>1||this.__actions__.length||!(u instanceof ce)||!Wt(s)?this.thru(f):(u=u.slice(s,+s+(t?1:0)),u.__actions__.push({func:Ai,args:[f],thisArg:r}),new wt(u,this.__chain__).thru(function(m){return t&&!m.length&&m.push(r),m}))});function yp(){return ku(this)}function Np(){return new wt(this.value(),this.__chain__)}function Rp(){this.__values__===r&&(this.__values__=Zu(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Ep(){return this}function Ap(e){for(var t,s=this;s instanceof mi;){var u=Iu(s);u.__index__=0,u.__values__=r,t?f.__wrapped__=u:t=u;var f=u;s=s.__wrapped__}return f.__wrapped__=e,t}function Fp(){var e=this.__wrapped__;if(e instanceof ce){var t=e;return this.__actions__.length&&(t=new ce(this)),t=t.reverse(),t.__actions__.push({func:Ai,args:[_a],thisArg:r}),new wt(t,this.__chain__)}return this.thru(_a)}function Ip(){return eu(this.__wrapped__,this.__actions__)}var Dp=wi(function(e,t,s){pe.call(e,s)?++e[s]:Gt(e,s,1)});function Mp(e,t,s){var u=ie(e)?gl:jm;return s&&nt(e,t,s)&&(t=r),u(e,Q(t,3))}function Lp(e,t){var s=ie(e)?tn:Pl;return s(e,Q(t,3))}var Tp=du(Du),Op=du(Mu);function Pp(e,t){return Ue(Fi(e,t),1)}function kp(e,t){return Ue(Fi(e,t),De)}function qp(e,t,s){return s=s===r?1:ae(s),Ue(Fi(e,t),s)}function qu(e,t){var s=ie(e)?_t:an;return s(e,Q(t,3))}function $u(e,t){var s=ie(e)?ig:Ol;return s(e,Q(t,3))}var $p=wi(function(e,t,s){pe.call(e,s)?e[s].push(t):Gt(e,s,[t])});function zp(e,t,s,u){e=at(e)?e:Xn(e),s=s&&!u?ae(s):0;var f=e.length;return s<0&&(s=$e(f+s,0)),Ti(e)?s<=f&&e.indexOf(t,s)>-1:!!f&&qn(e,t,s)>-1}var Vp=le(function(e,t,s){var u=-1,f=typeof t=="function",m=at(e)?A(e.length):[];return an(e,function(_){m[++u]=f?dt(t,_,s):Rr(_,t,s)}),m}),Bp=wi(function(e,t,s){Gt(e,s,t)});function Fi(e,t){var s=ie(e)?Ee:Bl;return s(e,Q(t,3))}function Up(e,t,s,u){return e==null?[]:(ie(t)||(t=t==null?[]:[t]),s=u?r:s,ie(s)||(s=s==null?[]:[s]),Kl(e,t,s))}var Gp=wi(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Hp(e,t,s){var u=ie(e)?Ds:xl,f=arguments.length<3;return u(e,Q(t,4),s,f,an)}function Kp(e,t,s){var u=ie(e)?sg:xl,f=arguments.length<3;return u(e,Q(t,4),s,f,Ol)}function Wp(e,t){var s=ie(e)?tn:Pl;return s(e,Mi(Q(t,3)))}function Yp(e){var t=ie(e)?Dl:zm;return t(e)}function Qp(e,t,s){(s?nt(e,t,s):t===r)?t=1:t=ae(t);var u=ie(e)?vm:Vm;return u(e,t)}function Xp(e){var t=ie(e)?_m:Um;return t(e)}function Zp(e){if(e==null)return 0;if(at(e))return Ti(e)?zn(e):e.length;var t=Xe(e);return t==Et||t==At?e.size:Xs(e).length}function Jp(e,t,s){var u=ie(e)?Ms:Gm;return s&&nt(e,t,s)&&(t=r),u(e,Q(t,3))}var ex=le(function(e,t){if(e==null)return[];var s=t.length;return s>1&&nt(e,t[0],t[1])?t=[]:s>2&&nt(t[0],t[1],t[2])&&(t=[t[0]]),Kl(e,Ue(t,1),[])}),Ii=Lg||function(){return Be.Date.now()};function tx(e,t){if(typeof t!="function")throw new bt(d);return e=ae(e),function(){if(--e<1)return t.apply(this,arguments)}}function zu(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Ht(e,K,r,r,r,r,t)}function Vu(e,t){var s;if(typeof t!="function")throw new bt(d);return e=ae(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var wa=le(function(e,t,s){var u=L;if(s.length){var f=rn(s,Yn(wa));u|=O}return Ht(e,u,t,s,f)}),Bu=le(function(e,t,s){var u=L|I;if(s.length){var f=rn(s,Yn(Bu));u|=O}return Ht(t,u,e,s,f)});function Uu(e,t,s){t=s?r:t;var u=Ht(e,$,r,r,r,r,r,t);return u.placeholder=Uu.placeholder,u}function Gu(e,t,s){t=s?r:t;var u=Ht(e,te,r,r,r,r,r,t);return u.placeholder=Gu.placeholder,u}function Hu(e,t,s){var u,f,m,_,S,y,D=0,M=!1,P=!1,z=!0;if(typeof e!="function")throw new bt(d);t=yt(t)||0,Ae(s)&&(M=!!s.leading,P="maxWait"in s,m=P?$e(yt(s.maxWait)||0,t):m,z="trailing"in s?!!s.trailing:z);function H(Le){var Mt=u,Xt=f;return u=f=r,D=Le,_=e.apply(Xt,Mt),_}function J(Le){return D=Le,S=Dr(ue,t),M?H(Le):_}function oe(Le){var Mt=Le-y,Xt=Le-D,dc=t-Mt;return P?Qe(dc,m-Xt):dc}function ee(Le){var Mt=Le-y,Xt=Le-D;return y===r||Mt>=t||Mt<0||P&&Xt>=m}function ue(){var Le=Ii();if(ee(Le))return de(Le);S=Dr(ue,oe(Le))}function de(Le){return S=r,z&&u?H(Le):(u=f=r,_)}function ht(){S!==r&&nu(S),D=0,u=y=f=S=r}function rt(){return S===r?_:de(Ii())}function pt(){var Le=Ii(),Mt=ee(Le);if(u=arguments,f=this,y=Le,Mt){if(S===r)return J(y);if(P)return nu(S),S=Dr(ue,t),H(y)}return S===r&&(S=Dr(ue,t)),_}return pt.cancel=ht,pt.flush=rt,pt}var nx=le(function(e,t){return Tl(e,1,t)}),rx=le(function(e,t,s){return Tl(e,yt(t)||0,s)});function ix(e){return Ht(e,B)}function Di(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new bt(d);var s=function(){var u=arguments,f=t?t.apply(this,u):u[0],m=s.cache;if(m.has(f))return m.get(f);var _=e.apply(this,u);return s.cache=m.set(f,_)||m,_};return s.cache=new(Di.Cache||Ut),s}Di.Cache=Ut;function Mi(e){if(typeof e!="function")throw new bt(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function sx(e){return Vu(2,e)}var ax=Hm(function(e,t){t=t.length==1&&ie(t[0])?Ee(t[0],ft(Q())):Ee(Ue(t,1),ft(Q()));var s=t.length;return le(function(u){for(var f=-1,m=Qe(u.length,s);++f=t}),An=$l(function(){return arguments}())?$l:function(e){return Fe(e)&&pe.call(e,"callee")&&!Nl.call(e,"callee")},ie=A.isArray,wx=ol?ft(ol):Am;function at(e){return e!=null&&Li(e.length)&&!Yt(e)}function Me(e){return Fe(e)&&at(e)}function Sx(e){return e===!0||e===!1||Fe(e)&&tt(e)==fr}var cn=Og||Ma,jx=ll?ft(ll):Fm;function Cx(e){return Fe(e)&&e.nodeType===1&&!Mr(e)}function yx(e){if(e==null)return!0;if(at(e)&&(ie(e)||typeof e=="string"||typeof e.splice=="function"||cn(e)||Qn(e)||An(e)))return!e.length;var t=Xe(e);if(t==Et||t==At)return!e.size;if(Ir(e))return!Xs(e).length;for(var s in e)if(pe.call(e,s))return!1;return!0}function Nx(e,t){return Er(e,t)}function Rx(e,t,s){s=typeof s=="function"?s:r;var u=s?s(e,t):r;return u===r?Er(e,t,r,s):!!u}function ja(e){if(!Fe(e))return!1;var t=tt(e);return t==Hr||t==Yd||typeof e.message=="string"&&typeof e.name=="string"&&!Mr(e)}function Ex(e){return typeof e=="number"&&El(e)}function Yt(e){if(!Ae(e))return!1;var t=tt(e);return t==Kr||t==To||t==Wd||t==Xd}function Wu(e){return typeof e=="number"&&e==ae(e)}function Li(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=G}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Fe(e){return e!=null&&typeof e=="object"}var Yu=ul?ft(ul):Dm;function Ax(e,t){return e===t||Qs(e,t,ga(t))}function Fx(e,t,s){return s=typeof s=="function"?s:r,Qs(e,t,ga(t),s)}function Ix(e){return Qu(e)&&e!=+e}function Dx(e){if(hh(e))throw new re(c);return zl(e)}function Mx(e){return e===null}function Lx(e){return e==null}function Qu(e){return typeof e=="number"||Fe(e)&&tt(e)==mr}function Mr(e){if(!Fe(e)||tt(e)!=Vt)return!1;var t=oi(e);if(t===null)return!0;var s=pe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&ri.call(s)==Fg}var Ca=cl?ft(cl):Mm;function Tx(e){return Wu(e)&&e>=-9007199254740991&&e<=G}var Xu=dl?ft(dl):Lm;function Ti(e){return typeof e=="string"||!ie(e)&&Fe(e)&&tt(e)==pr}function mt(e){return typeof e=="symbol"||Fe(e)&&tt(e)==Wr}var Qn=fl?ft(fl):Tm;function Ox(e){return e===r}function Px(e){return Fe(e)&&Xe(e)==xr}function kx(e){return Fe(e)&&tt(e)==Jd}var qx=yi(Zs),$x=yi(function(e,t){return e<=t});function Zu(e){if(!e)return[];if(at(e))return Ti(e)?Ft(e):st(e);if(br&&e[br])return vg(e[br]());var t=Xe(e),s=t==Et?qs:t==At?ei:Xn;return s(e)}function Qt(e){if(!e)return e===0?e:0;if(e=yt(e),e===De||e===-1/0){var t=e<0?-1:1;return t*be}return e===e?e:0}function ae(e){var t=Qt(e),s=t%1;return t===t?s?t-s:t:0}function Ju(e){return e?yn(ae(e),0,it):0}function yt(e){if(typeof e=="number")return e;if(mt(e))return et;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=vl(e);var s=wf.test(e);return s||jf.test(e)?tg(e.slice(2),s?2:8):bf.test(e)?et:+e}function ec(e){return Pt(e,ot(e))}function zx(e){return e?yn(ae(e),-9007199254740991,G):e===0?e:0}function he(e){return e==null?"":gt(e)}var Vx=Kn(function(e,t){if(Ir(t)||at(t)){Pt(t,ze(t),e);return}for(var s in t)pe.call(t,s)&&yr(e,s,t[s])}),tc=Kn(function(e,t){Pt(t,ot(t),e)}),Oi=Kn(function(e,t,s,u){Pt(t,ot(t),e,u)}),Bx=Kn(function(e,t,s,u){Pt(t,ze(t),e,u)}),Ux=Kt(Gs);function Gx(e,t){var s=Hn(e);return t==null?s:Ml(s,t)}var Hx=le(function(e,t){e=we(e);var s=-1,u=t.length,f=u>2?t[2]:r;for(f&&nt(t[0],t[1],f)&&(u=1);++s1),m}),Pt(e,da(e),s),u&&(s=St(s,R|N|b,rh));for(var f=t.length;f--;)ra(s,t[f]);return s});function cv(e,t){return rc(e,Mi(Q(t)))}var dv=Kt(function(e,t){return e==null?{}:km(e,t)});function rc(e,t){if(e==null)return{};var s=Ee(da(e),function(u){return[u]});return t=Q(t),Wl(e,s,function(u,f){return t(u,f[0])})}function fv(e,t,s){t=ln(t,e);var u=-1,f=t.length;for(f||(f=1,e=r);++ut){var u=e;e=t,t=u}if(s||e%1||t%1){var f=Al();return Qe(e+f*(t-e+eg("1e-"+((f+"").length-1))),t)}return ea(e,t)}var jv=Wn(function(e,t,s){return t=t.toLowerCase(),e+(s?ac(t):t)});function ac(e){return Ra(he(e).toLowerCase())}function oc(e){return e=he(e),e&&e.replace(yf,gg).replace(Uf,"")}function Cv(e,t,s){e=he(e),t=gt(t);var u=e.length;s=s===r?u:yn(ae(s),0,u);var f=s;return s-=t.length,s>=0&&e.slice(s,f)==t}function yv(e){return e=he(e),e&&sf.test(e)?e.replace(ko,mg):e}function Nv(e){return e=he(e),e&&df.test(e)?e.replace(Ss,"\\$&"):e}var Rv=Wn(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Ev=Wn(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Av=cu("toLowerCase");function Fv(e,t,s){e=he(e),t=ae(t);var u=t?zn(e):0;if(!t||u>=t)return e;var f=(t-u)/2;return Ci(di(f),s)+e+Ci(ci(f),s)}function Iv(e,t,s){e=he(e),t=ae(t);var u=t?zn(e):0;return t&&u>>0,s?(e=he(e),e&&(typeof t=="string"||t!=null&&!Ca(t))&&(t=gt(t),!t&&$n(e))?un(Ft(e),0,s):e.split(t,s)):[]}var kv=Wn(function(e,t,s){return e+(s?" ":"")+Ra(t)});function qv(e,t,s){return e=he(e),s=s==null?0:yn(ae(s),0,e.length),t=gt(t),e.slice(s,s+t.length)==t}function $v(e,t,s){var u=g.templateSettings;s&&nt(e,t,s)&&(t=r),e=he(e),t=Oi({},t,u,xu);var f=Oi({},t.imports,u.imports,xu),m=ze(f),_=ks(f,m),S,y,D=0,M=t.interpolate||Yr,P="__p += '",z=$s((t.escape||Yr).source+"|"+M.source+"|"+(M===qo?_f:Yr).source+"|"+(t.evaluate||Yr).source+"|$","g"),H="//# sourceURL="+(pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Yf+"]")+` +`;e.replace(z,function(ee,ue,de,ht,rt,pt){return de||(de=ht),P+=e.slice(D,pt).replace(Nf,hg),ue&&(S=!0,P+=`' + +__e(`+ue+`) + +'`),rt&&(y=!0,P+=`'; +`+rt+`; +__p += '`),de&&(P+=`' + +((__t = (`+de+`)) == null ? '' : __t) + +'`),D=pt+ee.length,ee}),P+=`'; +`;var J=pe.call(t,"variable")&&t.variable;if(!J)P=`with (obj) { +`+P+` +} +`;else if(xf.test(J))throw new re(h);P=(y?P.replace(ef,""):P).replace(tf,"$1").replace(nf,"$1;"),P="function("+(J||"obj")+`) { +`+(J?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(y?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+P+`return __p +}`;var oe=uc(function(){return fe(m,H+"return "+P).apply(r,_)});if(oe.source=P,ja(oe))throw oe;return oe}function zv(e){return he(e).toLowerCase()}function Vv(e){return he(e).toUpperCase()}function Bv(e,t,s){if(e=he(e),e&&(s||t===r))return vl(e);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Ft(t),m=_l(u,f),_=bl(u,f)+1;return un(u,m,_).join("")}function Uv(e,t,s){if(e=he(e),e&&(s||t===r))return e.slice(0,Sl(e)+1);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=bl(u,Ft(t))+1;return un(u,0,f).join("")}function Gv(e,t,s){if(e=he(e),e&&(s||t===r))return e.replace(js,"");if(!e||!(t=gt(t)))return e;var u=Ft(e),f=_l(u,Ft(t));return un(u,f).join("")}function Hv(e,t){var s=me,u=_e;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?gt(t.omission):u}e=he(e);var m=e.length;if($n(e)){var _=Ft(e);m=_.length}if(s>=m)return e;var S=s-zn(u);if(S<1)return u;var y=_?un(_,0,S).join(""):e.slice(0,S);if(f===r)return y+u;if(_&&(S+=y.length-S),Ca(f)){if(e.slice(S).search(f)){var D,M=y;for(f.global||(f=$s(f.source,he($o.exec(f))+"g")),f.lastIndex=0;D=f.exec(M);)var P=D.index;y=y.slice(0,P===r?S:P)}}else if(e.indexOf(gt(f),S)!=S){var z=y.lastIndexOf(f);z>-1&&(y=y.slice(0,z))}return y+u}function Kv(e){return e=he(e),e&&rf.test(e)?e.replace(Po,Sg):e}var Wv=Wn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ra=cu("toUpperCase");function lc(e,t,s){return e=he(e),t=s?r:t,t===r?xg(e)?yg(e):lg(e):e.match(t)||[]}var uc=le(function(e,t){try{return dt(e,r,t)}catch(s){return ja(s)?s:new re(s)}}),Yv=Kt(function(e,t){return _t(t,function(s){s=kt(s),Gt(e,s,wa(e[s],e))}),e});function Qv(e){var t=e==null?0:e.length,s=Q();return e=t?Ee(e,function(u){if(typeof u[1]!="function")throw new bt(d);return[s(u[0]),u[1]]}):[],le(function(u){for(var f=-1;++fG)return[];var s=it,u=Qe(e,it);t=Q(t),e-=it;for(var f=Ps(u,t);++s0||t<0)?new ce(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=ae(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},ce.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},ce.prototype.toArray=function(){return this.take(it)},Ot(ce.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),f=g[u?"take"+(t=="last"?"Right":""):t],m=u||/^find/.test(t);f&&(g.prototype[t]=function(){var _=this.__wrapped__,S=u?[1]:arguments,y=_ instanceof ce,D=S[0],M=y||ie(_),P=function(ue){var de=f.apply(g,nn([ue],S));return u&&z?de[0]:de};M&&s&&typeof D=="function"&&D.length!=1&&(y=M=!1);var z=this.__chain__,H=!!this.__actions__.length,J=m&&!z,oe=y&&!H;if(!m&&M){_=oe?_:new ce(this);var ee=e.apply(_,S);return ee.__actions__.push({func:Ai,args:[P],thisArg:r}),new wt(ee,z)}return J&&oe?e.apply(this,S):(ee=this.thru(P),J?u?ee.value()[0]:ee.value():ee)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=ti[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);g.prototype[e]=function(){var f=arguments;if(u&&!this.__chain__){var m=this.value();return t.apply(ie(m)?m:[],f)}return this[s](function(_){return t.apply(ie(_)?_:[],f)})}}),Ot(ce.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";pe.call(Gn,u)||(Gn[u]=[]),Gn[u].push({name:t,func:s})}}),Gn[Si(r,I).name]=[{name:"wrapper",func:r}],ce.prototype.clone=Kg,ce.prototype.reverse=Wg,ce.prototype.value=Yg,g.prototype.at=Cp,g.prototype.chain=yp,g.prototype.commit=Np,g.prototype.next=Rp,g.prototype.plant=Ap,g.prototype.reverse=Fp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Ip,g.prototype.first=g.prototype.head,br&&(g.prototype[br]=Ep),g},Vn=Ng();wn?((wn.exports=Vn)._=Vn,As._=Vn):Be._=Vn}).call(Zn)})(Ki,Ki.exports);var Ie=Ki.exports;const Sw=n=>{console.debug("calculateQuoteTotals",n);const o=$t.create(n[1]||{amount:null,scale:2});if(o.isFailure)throw o.error;const r=o.object,a=$t.create(n[2]||{amount:null,scale:2});if(a.isFailure)throw a.error;const l=a.object,c=Lt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(h).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:h.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},jw=({currency:n})=>{const{formState:o,control:r}=ur(),{formatNumber:a}=sw(),l=mc({control:r,name:["subtotal_price","discount","tax"]}),c=mc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=Sw(l),h=a(d.subtotalPrice),p=a(d.discountPrice),x=a(d.taxesPrice),v=a(d.totalPrice),R=T.useMemo(()=>n.symbol||"",[n]);return i.jsx(Te,{className:"w-full bg-muted",children:i.jsxs(Oe,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[i.jsx(He,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[h,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(He,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(Hi,{scale:2,disabled:o.disabled,placeholder:w("quotes.form_fields.discount.placeholder"),name:"discount",onChange:N=>{console.log("discount",N)}})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(He,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})]}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(He,{className:"text-sm",children:c}),i.jsx(Hi,{scale:2,disabled:o.disabled,placeholder:w("quotes.form_fields.tax.placeholder"),name:"tax"})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(He,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:""})}),i.jsxs(Ve,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[x,i.jsx("span",{className:"text-base font-medium tracking-normal",children:R})]})]})]})," ",i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-0",children:[i.jsx(He,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ve,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[v,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})})]})})},Vd=n=>{const{percentage:o,cancel:r,error:a,isInProgress:l,onFinishDownload:c}=n,d=T.useId();return T.useEffect(()=>{l&&!a&&o===100&&c&&c()},[o,l,a,c]),i.jsx(ir,{open:l,children:i.jsxs(sr,{className:"sm:max-w-md",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.downloading_dialog.title")}),i.jsx(os,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(dr,{children:w("quotes.downloading_dialog.progress.label",{status:w(l?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),i.jsx(Bc,{value:o,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),a&&i.jsxs("p",{children:["Error: ",JSON.stringify(a)]})]}),i.jsx(lr,{className:"sm:justify-end",children:i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},Cw=({isInProgress:n,percentage:o,elapsed:r,cancel:a,error:l,className:c})=>{const[d,h]=T.useState(10);return T.useEffect(()=>{if(n&&o>0){const p=r/o*100;h(Math.max(0,Math.round(p-r)))}},[n,o,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Te,{className:ge("overflow-hidden",c),children:[i.jsx(ct,{children:i.jsxs(Ve,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?"Error en la generación del PDF":"Generando PDF",n&&i.jsx(P0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(D0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(Oe,{children:l!=null&&l.errorMessage?i.jsx("div",{className:"text-destructive",children:l==null?void 0:l.errorMessage}):i.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[i.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[i.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${o}%`}}),i.jsx(O0,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),i.jsx(Bc,{value:o,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsxs("p",{children:["Progreso: ",o,"%"]}),i.jsxs("div",{className:"hidden",children:[i.jsxs("p",{children:["Tiempo transcurrido: ",r," segundos"]}),d>0&&i.jsxs("p",{children:["Tiempo estimado restante: ",d," segundos"]})]})]}),i.jsx(U,{variant:"destructive",onClick:a,className:"hidden",children:"Cancelar generación"})]})})]})},Bd=({quote:n,className:o})=>{const{useReport:r,getQuotePDFFilename:a,useDownloader:l}=Ur(),{download:c}=l(),{report:d,preview:h,isInProgress:p,...x}=r(),[v,R]=T.useState(void 0),N=T.useCallback(()=>{n&&c(n.id,a(n))},[n]);return T.useEffect(()=>{const b=setTimeout(()=>{n&&n.id&&h(n.id)},200);return()=>clearTimeout(b)},[n]),T.useEffect(()=>{if(!p&&d){const b=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return R(b),()=>{R(void 0),window.URL.revokeObjectURL(b)}}},[d,p]),n?p?i.jsx(Cw,{isInProgress:p,...x}):i.jsx(a0,{file:v,className:"object-contain",onThumbnailClick:N}):i.jsx(Te,{className:ge("overflow-hidden",o),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};Bd.whyDidYouRender=!0;const Tr=eb();function yw({row:n,table:o}){var l;const r=(l=o.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const a=r.quantities[n.index]??1;return i.jsx(ns,{type:"number",name:"quantity",min:1,className:"w-24",value:a,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function Nw({row:n,table:o}){var a;const r=(a=o.options.meta)==null?void 0:a.catalogPicker;return i.jsxs(U,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:l=>{l.preventDefault(),r==null||r.selectArticle(n.original,n.index)},children:[i.jsx(Co,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:w("common.add")})]})}const so=({onSelect:n})=>{const o=zt(),{pagination:r,globalFilter:a,isFiltered:l}=Tn(),[c,d]=T.useState([]),h=T.useCallback((L,I)=>{d(q=>{const $=[...q];return $[L]=I,$})},[]),p=()=>{d([])},{data:x,isPending:v,isError:R,error:N}=Pd({pagination:{pageIndex:r.pageIndex,pageSize:r.pageSize},searchTerm:a});T.useEffect(()=>{p()},[r,a,l]);const b=T.useMemo(()=>({catalogPicker:{quantities:c,setQuantity:h,selectArticle:(L,I)=>n(L,c[I]===""?1:c[I]??1)}}),[h,n,c]),E=T.useMemo(()=>[Tr.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})}),Tr.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:L})=>i.jsx("div",{className:"text-right",children:L()})}),Tr.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:L})=>{const I=Lt.create(L.original.retail_price).object;return i.jsx("div",{className:"text-right",children:I.toFormat()})}}),Tr.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:w("catalog.list.columns.quantity")}),cell:yw}),Tr.display({id:"row-actions",header:()=>null,cell:Nw})],[]),{table:C}=fs({data:[...(x==null?void 0:x.items)||[]],columns:E,pageCount:(x==null?void 0:x.total_pages)??-1,meta:b});return R?i.jsx(cr,{subtitle:N.message}):v?i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(x==null?void 0:x.total_items)===0&&!l?i.jsx(ds,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>o("/catalog/add")}):i.jsx(us,{className:"bg-transparent border-0 shadow-none",table:C,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(kd,{table:C})})},Do=T.forwardRef(({label:n=w("common.append_block"),className:o,...r},a)=>i.jsxs(U,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Do.displayName="AppendBlockRowButton";const Mo=T.forwardRef(({label:n=w("common.append_article"),className:o,...r},a)=>i.jsxs(U,{type:"button",variant:"outline",ref:a,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Mo.displayName="AppendCatalogArticleRowButton";const Lo=T.forwardRef(({label:n=w("common.append_empty_row"),className:o,...r},a)=>i.jsxs(U,{type:"button",variant:"outline",ref:a,...r,children:[i.jsx(I0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Lo.displayName="AppendEmptyRowButton";const Rw=({table:n,showLineDiscountColumn:o,hasLineDiscounts:r,onShowLineDiscountColumnChange:a})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=T.useState(!1),h=x=>{if(!x&&o&&r){d(!0);return}a(x)},p=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsxs("div",{className:"grid gap-0.5",children:[i.jsx(dr,{htmlFor:"show-line-discount-column",className:"text-sm font-medium",children:w("quotes.discount_column.label")}),i.jsx("p",{className:"text-xs font-normal text-muted-foreground",children:w("quotes.discount_column.description")})]}),i.jsx(So,{id:"show-line-discount-column",checked:o,onCheckedChange:h})]}),i.jsx(ir,{open:c,onOpenChange:d,children:i.jsxs(sr,{children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(os,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(lr,{children:[i.jsx(U,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(U,{type:"button",onClick:()=>{a(!1),d(!1)},children:w("quotes.discount_column.confirmation.confirm")})]})]})})]});return l?i.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.duplicateItems()},children:[i.jsx(M0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.duplicate_selected_rows")})]})}),i.jsx(Ye,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.deleteItems()},children:[i.jsx(md,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.remove_selected_rows")})]})}),i.jsx(Ye,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(k0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.reset_selected_rows")})]})}),i.jsx(Ye,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(hn,{orientation:"vertical",className:"h-6 ml-1 mr-4"}),i.jsx("p",{className:"text-sm font-normal",children:w("common.rows_selected",{count:l})}),p]})}):i.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Lo,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(Ye,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Mo,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(Ye,{children:w("common.append_article_tooltip")})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsx(Do,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickBlock&&((x=n.options.meta)==null||x.pickBlock())}})}),i.jsx(Ye,{children:w("common.append_block_tooltip")})]})]}),p]})},Ew=({row:n,table:o,onDelete:r})=>{const a=()=>{var l;(l=o.options.meta)==null||l.deleteItems(n.index),r()};return i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(o0,{className:"w-4 h-4 mr-2"}),w("common.insert_row_above")]}),i.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(Tc,{className:"w-4 h-4 mr-2"}),w("common.insert_row_below")]}),i.jsxs(U,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=o.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(jo,{className:"w-4 h-4 mr-2"}),w("common.duplicate_row")]}),i.jsxs(Uc,{children:[i.jsx(Gc,{asChild:!0,children:i.jsxs(U,{type:"button",variant:"destructive",size:"sm",children:[i.jsx(md,{className:"w-4 h-4 mr-2"}),w("common.remove_row")]})}),i.jsxs(Hc,{children:[i.jsxs(Kc,{children:[i.jsx(Wc,{children:w("quotes.inline_row_actions.delete_confirmation.title")}),i.jsx(Yc,{children:w("quotes.inline_row_actions.delete_confirmation.description")})]}),i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("common.cancel")}),i.jsx(Zc,{asChild:!0,children:i.jsx(U,{type:"button",variant:"destructive",onClick:a,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Aw={droppable:{strategy:d0.Always}},Fw={keyframes({transform:n}){return[{opacity:1,transform:Ya.Transform.toString(n.initial)},{opacity:0,transform:Ya.Transform.toString({...n.final,x:n.final.x+5,y:n.final.y+5})}]},easing:"ease-out",sideEffects({active:n}){n.node.animate([{opacity:0},{opacity:1}],{duration:hc.duration,easing:hc.easing})}};function Nc({columns:n,data:o,defaultValues:r,initialState:a,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h}){const[p,x]=T.useState({}),[v,R]=T.useState(),[N,b]=T.useState(null),E=T.useMemo(()=>o.map(O=>O.id),[o]),C=Fd({data:o,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:a,state:{rowSelection:p,columnVisibility:{...a==null?void 0:a.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Ed(),getRowId:O=>O==null?void 0:O.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(O,k)=>{l.insert(O,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:O=>{l.append(O||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:O=>{var k;if(O!=null){const K=((k=l.getItem)==null?void 0:k.call(l,O))??C.getRowModel().rows[O].original;l.insert(O+1,{...K,id:void 0},{shouldFocus:!0})}else if(C.getSelectedRowModel().rows.length){const K=C.getSelectedRowModel().rows[C.getSelectedRowModel().rows.length-1].index,ne=C.getSelectedRowModel().rows.map(B=>({...B.original,id:void 0}));C.getRowModel().rows.length{if(O!=null)l.remove(O);else if(C.getSelectedRowModel().rows.length>0){let k=C.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const K=E.indexOf(String(C.getSelectedRowModel().rows[k].id));l.remove(K),E.splice(K,1)}C.resetRowSelection()}else l.remove()},updateItem:(O,k,K,ne)=>{l.update(O,{...k,[`${K}`]:ne})}}}),L=l0(Pi(_0,{}),Pi(v0,{}),Pi(x0,{}),Pi(p0,{}));function I(O){var ne;let k=O.active.id,K=(ne=O.over)==null?void 0:ne.id;if(K!==void 0&&k!==K){let B=E.indexOf(String(K));if(C.getSelectedRowModel().rows.length>1)C.getSelectedRowModel().rows.forEach((me,_e)=>{const W=E.indexOf(String(me.id));_e>0&&(k=me.id,B=E.indexOf(String(K)),B{const K=typeof k=="string"?k:k.id;return K===v||!C.getSelectedRowModel().rowsById[K]}):O}return i.jsx(u0,{measuring:Aw,sensors:L,onDragEnd:I,onDragStart:q,onDragCancel:$,collisionDetection:c0,children:i.jsxs(Te,{children:[i.jsx(ct,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ve,{children:i.jsx(Rw,{table:C,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h})})}),i.jsxs(Oe,{children:[i.jsxs(uo,{className:"table-fixed",children:[i.jsx(co,{className:"sticky top-0 z-10 bg-background",children:C.getHeaderGroups().map(O=>i.jsx(pn,{className:"hover:bg-transparent",children:O.headers.map(k=>i.jsx(fo,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Dd,{table:C,header:k})},k.id))},O.id))}),i.jsx(go,{children:i.jsx(g0,{items:te(E),strategy:m0,children:te(C.getRowModel().rows).map(O=>{const k=O,K=k.id===N;return i.jsxs(T.Fragment,{children:[i.jsx(hw,{id:k.id,isActive:K,onActivate:()=>b(k.id),children:k.getVisibleCells().map(ne=>i.jsx(qr,{className:"px-2 py-2 align-top",style:{width:ne.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":ne.column.getSize()},children:Gi(ne.column.columnDef.cell,ne.getContext())},ne.id))}),K&&i.jsx(pn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(qr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(Ew,{row:k,table:C,onDelete:()=>b(null)})})})]},k.id)})})})]}),f0.createPortal(i.jsx(h0,{dropAnimation:Fw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:C.getSelectedRowModel().rows.length?i.jsx(oo,{variant:"destructive",className:"absolute z-50 flex items-center justify-center w-2 h-2 p-3 rounded-full top left -left-2 -top-2",children:C.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Nt,{children:i.jsxs(nr,{children:[i.jsx(Lo,{onClick:()=>{var O;return(O=C.options.meta)==null?void 0:O.appendItem()}}),i.jsx(Mo,{onClick:()=>{var O;C.options.meta&&C.options.meta.pickCatalogArticle&&((O=C.options.meta)==null||O.pickCatalogArticle())}}),i.jsx(Do,{onClick:()=>{var O;C.options.meta&&C.options.meta.pickBlock&&((O=C.options.meta)==null||O.pickBlock())}})]})})]})})}const Iw={en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r +Hanging rods: CHROME/ BLACK\r +Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r +Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r +Shoe rack door: YES/NO / Profile finish: BLACK LACQUER / SILVER MATTE\r +Shoe cabinet door glass finish: FLOAT BRONZE C-424\r +Composed of:`},{id:2000000084,code:"CAP_FRE_ARM_ABATIBLE_EN",title:"CHARACTERISTICS OF THE FRONT OF THE HINGED WARDROBE",body:`Size of opening: 2275x1390 mm.\r +Model: ARGO / Finish: LACQUER / Colour: TO BE DETERMINED\r +Door thickness: 22 or 19 mm\r +Door finish: SMOOTH \r +Handle: KNOB TO BE DETERMINED\r +Hardware finish: CHROME OR ANTHRACITE\r +Perimetral doorposts: VISIBLE, REMETED OR COMBI TO BE DETERMINED.\r +Number of doors: 2 \r +Composed of:`},{id:2000000089,code:"CAP_FRE_ARM_CORREDERA_EN",title:"Size of opening: 2440x5180mm. ",body:`Model: PANORAMIC P.O. / Finish: LACQUER / Colour: WHITE\r +No. of listers: NO LISTELS / Panels finish: LACQUERED PANEL \r +Handle: \r +Perimeter frame: \r +Nº of doors: \r +INCORPORATED HYDRAULIC BRAKE (not available in lower doors of 650 mm.) OR INCORPORATED MAGNETIC BRAKE. \r +Composed of:`},{id:2000000092,code:"CAP_INT_ARM_FORRADO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r +Hanging rods: CHROME/ BLACK\r +Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r +Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r +Composed of:`},{id:2000000109,code:"CAP_INT_EST_CRISTAL_EN",title:"Frames finish: BLACK ANODIZED",body:`Side frame panel finish: BRONZE FLOAT BRONZE GLASS C-424\r +Rear panel finish: BRONZE FLOAT GLASS C-424\r +Complements finish: MELAMIN / Colour: DENBER OAK M-242\r +Thickness of accessories: 25 mm.\r +Hanging bars: BLACK\r +Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r +Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r +Composed of:`},{id:2000000095,code:"CAP_SEP_AMBIENTES_EN",title:"CHARACTERISTICS SEPARATION OF ROOMS",body:`Size of opening: 2450x3000 mm.\r +Model: LYN / Finish: ANODISED / Colour: BLACK\r +No. of crosspieces: 2 HORIZONTAL CROSSBARS\r +Panel finish: TRANSPARENT TEMPLARED \r +Handle: DOUBLE PER DOOR\r +Brake: DOUBLE PER DOOR (OPENING AND CLOSING)\r +Guide: VISTA (DOUBLE EMBELLECEDOR)\r +Number of panels: 2 SLIDING + 2 FIXED`}],es:[{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado vestidor: MELAMINA / color: A DETERMINAR",body:`Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r +Barras de colgar: CROMO/ NEGRA/ BRONCE\r +Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r +Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r +Baldas deslizantes: X DE 145 MM. A DETERMINAR\r +Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r +Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r +Grosor hoja: 22 o 19 mm\r +Acabado de hojas: LISAS\r +Tirador: UÑERO A DETERMINAR\r +Acabado herrajes: CROMADO O ANTRACITA\r +Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r +Nº de hojas: 2\r +Compuesto por:`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO CORREDERA",body:`Medida de Hueco:2440x5180mm.\r +Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r +Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r +Tirador:\r +Cerco perimetral: \r +Nº de hojas:\r +FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r +Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r +Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r +Barras de colgar: CROMO/ NEGRA/ BRONCE\r +Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r +Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r +Baldas deslizantes: X DE 145 MM. A DETERMINAR\r +Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r +Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r +Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r +Espesor complementos: 25 mm.\r +Barras de colgar: NEGRA\r +Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r +Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r +Compuesto por:`},{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r +Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r +Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r +Acabado paneles: TRANSPARENTE TEMPLADO \r +Tirador: DOBLE POR PUERTA\r +Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r +Guía: VISTA (DOBLE EMBELLECEDOR)\r +Nº de hojas: 2 CORREDERAS + 2 FIJOS`}]},Rc=({onSelect:n})=>{const{i18n:o}=rs(),[r]=T.useState(o.resolvedLanguage||"es"),[a]=T.useState(Iw[r.toLowerCase()]);return console.log(r),i.jsx(ao,{className:"h-96",children:i.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:a&&a.sort((l,c)=>l.title.localeCompare(c.title)).map((l,c)=>i.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>n&&n(l,1),children:i.jsxs("div",{className:"flex flex-col w-full gap-1",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("div",{className:"font-semibold",children:l.title})})}),i.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:i.jsx("p",{dangerouslySetInnerHTML:{__html:l.body.substring(0,300).replace(`\r +`,"
")}})})]})},l.id))})})},Dw=({isOpen:n,onOpenChange:o,onSelect:r})=>Ld("(min-width: 768px)")?i.jsx(ir,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(sr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(os,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Rc,{onSelect:r}),i.jsx(lr,{children:i.jsx(U,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(Jc,{open:n,onOpenChange:o,children:i.jsxs(ed,{children:[i.jsxs(td,{className:"text-left",children:[i.jsx(nd,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(rd,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Rc,{onSelect:r}),i.jsx(id,{className:"pt-2",children:i.jsx(sd,{asChild:!0,children:i.jsx(U,{variant:"outline",children:w("common.close")})})})]})}),Mw=({isOpen:n,onOpenChange:o,onSelect:r})=>Ld("(min-width: 768px)")?i.jsx(ir,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(sr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(os,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(rr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(so,{onSelect:r})}),i.jsx(lr,{children:i.jsx(U,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(Jc,{open:n,onOpenChange:o,children:i.jsxs(ed,{children:[i.jsxs(td,{className:"text-left",children:[i.jsx(nd,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(rd,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(rr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(so,{onSelect:r})}),i.jsx(id,{className:"pt-2",children:i.jsx(sd,{asChild:!0,children:i.jsx(U,{variant:"outline",children:w("common.close")})})})]})}),Lw=({currency:n,language:o,defaultValues:r})=>{var ne;const{toast:a}=_n(),{control:l,getValues:c,setValue:d,watch:h}=ur(),p=h("show_line_discount_column")??!0,x=!!((ne=c("items"))!=null&&ne.some(B=>{var me;return Number((me=B.discount)==null?void 0:me.amount)>0})),[v]=T.useState("dialog"),[R,N]=T.useState(!1),[b,E]=T.useState(!1),{fields:C,...L}=b0({control:l,name:"items"}),I=xw([{id:"description",accessorKey:"description",header:w("quotes.form_fields.items.description.label"),cell:({row:{index:B,original:me}})=>i.jsx(qt,{readOnly:me==null?void 0:me.id_article,autoSize:!0,name:`items.${B}.description`}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.quantity.label")}),cell:({row:{index:B}})=>i.jsx(tw,{scale:0,className:"text-right",name:`items.${B}.quantity`}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{currency:n,language:o,scale:2,className:"text-right",name:`items.${B}.unit_price`}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"text-right",name:`items.${B}.subtotal_price`}),size:150},{id:"discount",accessorKey:"discount",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.discount.label")}),cell:({row:{index:B}})=>i.jsx(Hi,{scale:2,className:"text-right",name:`items.${B}.discount`}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.total_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"font-semibold text-right",name:`items.${B}.total_price`}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0}),q=T.useCallback((B,me=1)=>{L.append({...B,quantity:{amount:100*me,scale:xn.DEFAULT_SCALE},unit_price:B.retail_price,discount:{amount:null,scale:2}}),a({title:w("quotes.catalog_picker_dialog.toast_article_added"),description:B.description})},[L]),$=T.useCallback(B=>{L.append({description:`${B.title} +${B.body}`,quantity:{amount:null,scale:xn.DEFAULT_SCALE},unit_price:{amount:null,scale:Y0.DEFAULT_SCALE},discount:{amount:null,scale:2}}),a({title:w("quotes.blocks_picker_dialog.toast_article_added"),description:B.title})},[L]),[te,O]=T.useState(!1),k=[265,440,655],K=4;return v==="dialog"?i.jsxs("div",{className:"relative",children:[i.jsx(Nc,{actions:{...L,getItem:B=>c(`items.${B}`),pickCatalogArticle:()=>N(!0),pickBlock:()=>E(!0)},columns:I,data:C,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})}),i.jsx(Mw,{onSelect:q,isOpen:R,onOpenChange:N}),i.jsx(Dw,{onSelect:$,isOpen:b,onOpenChange:E})]}):i.jsxs(z0,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[i.jsx(_c,{defaultSize:k[0],collapsedSize:K,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{O(!0)},onExpand:()=>{O(!1)},className:ge(te&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:i.jsx(Nc,{actions:{...L,getItem:B=>c(`items.${B}`)},columns:I,data:C,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})})}),i.jsx(V0,{withHandle:!0,className:"mx-3"}),i.jsx(_c,{defaultSize:k[1],minSize:10,children:i.jsx(rr,{syncWithLocation:!1,children:i.jsx(so,{onSelect:q})})})]})},Tw=()=>{const{formState:n}=ur();return i.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[i.jsxs(Qa,{className:"md:col-span-6",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),children:[i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(mn,{required:!0,className:"col-span-2",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_reference.placeholder"),name:"customer_reference"}),i.jsx(Vc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(mn,{label:w("quotes.form_fields.validity.label"),description:w("quotes.form_fields.validity.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.validity.placeholder"),name:"validity"}),i.jsx(qt,{className:"col-span-2",label:w("quotes.form_fields.payment_method.label"),description:w("quotes.form_fields.payment_method.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.payment_method.placeholder"),name:"payment_method"})]}),i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(qt,{className:"col-span-3",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_information.placeholder"),name:"customer_information",errors:n.errors}),i.jsx(qt,{className:"col-span-3",label:w("quotes.form_fields.notes.label"),description:w("quotes.form_fields.notes.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.notes.placeholder"),name:"notes"})]})]}),i.jsx(Qa,{className:"hidden md:col-span-2",title:w("quotes.create.form_groups.status.title"),description:w("quotes.create.form_groups.status.desc"),children:i.jsxs("div",{className:"grid gap-6",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx(dr,{htmlFor:"status",children:"Status"}),i.jsxs(Zi,{children:[i.jsx(Ji,{id:"status","aria-label":"Select status",children:i.jsx(es,{placeholder:"Select status"})}),i.jsxs(ts,{children:[i.jsx(Dn,{value:"draft",children:"Draft"}),i.jsx(Dn,{value:"published",children:"Active"}),i.jsx(Dn,{value:"archived",children:"Archived"})]})]})]}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.lang_code.label"),description:w("quotes.form_fields.lang_code.desc"),placeholder:w("quotes.form_fields.lang_code.placeholder"),name:"lang_code"}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.currency_code.label"),description:w("quotes.form_fields.currency_code.desc"),placeholder:w("quotes.form_fields.currency_code.placeholder"),name:"currency_code"})]})})]})},Ud=({id:n,onSentTo:o,disabled:r})=>{const a=()=>{o(n)};return i.jsxs(Uc,{children:[i.jsx(Gc,{asChild:!0,disabled:r,children:i.jsxs(U,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[i.jsx(q0,{className:"w-4 h-4"}),w("quotes.quote_sent_to_editor.trigger_button")]})}),i.jsxs(Hc,{children:[i.jsxs(Kc,{children:[i.jsx(Wc,{children:w("quotes.quote_sent_to_editor.title")}),i.jsx(Yc,{children:w("quotes.quote_sent_to_editor.description")})]}),i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("common.cancel")}),i.jsx(Zc,{asChild:!0,children:i.jsx(U,{onClick:a,children:w("common.continue")})})]})]})]})},Ow=["draft","ready","delivered","accepted","rejected","archived"],Pw={draft:["draft","ready","archived"],ready:["ready","delivered","archived"],delivered:["delivered","accepted","rejected","archived"],accepted:["accepted","rejected","archived"],rejected:["rejected","accepted","archived"],archived:["archived","draft","ready","delivered","accepted","rejected"]},Gd=({type:n="button",status:o,onChangeStatus:r})=>{const[a,l]=T.useState(o),c=h=>l(h);T.useEffect(()=>{o&&l(o)},[o]);const d=()=>{a!==o&&r(a,o)};return i.jsxs(ir,{children:[i.jsx(Ic,{asChild:!0,children:n==="button"?i.jsxs(U,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[i.jsx(w0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:w("quotes.quote_status_editor.trigger_button")})]}):i.jsx(S0,{status:o,isEditable:!0})}),i.jsxs(sr,{children:[i.jsx(ar,{children:i.jsx(or,{children:w("quotes.quote_status_editor.title")})}),i.jsx(j0,{}),i.jsx("div",{className:"grid gap-4 py-4",children:Ow.map(h=>{const p=!Pw[o].includes(h);return i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx(So,{id:h,checked:a===h,onCheckedChange:()=>c(h),disabled:p}),i.jsxs("div",{className:"grid gap-1.5 leading-none",children:[i.jsx(dr,{htmlFor:h,className:ge("font-medium",p?"text-input":"text-foreground"),children:w(`quotes.quote_status_editor.status.${h}.title`)}),i.jsx("p",{className:ge("text-sm",p?"text-input":"text-muted-foreground"),children:w(`quotes.quote_status_editor.status.${h}.description`)})]})]},h)})}),i.jsxs(lr,{className:"pt-6 border-t",children:[i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",variant:"secondary",children:w("common.cancel")})}),i.jsx(Bi,{asChild:!0,children:i.jsx(U,{onClick:d,disabled:a===o,children:w("quotes.quote_status_editor.submit_button")})})]})]})]})},kw=({quoteId:n,className:o})=>{const r=zt(),{toast:a}=_n(),{useOne:l,useSetStatus:c,useSentTo:d,useDownloader:h,useDuplicate:p,getQuotePDFFilename:x}=Ur(),{data:v,status:R}=l(n),{mutate:N}=c(),{mutate:b}=d(n),{mutate:E}=p(),{download:C,...L}=h(),{formatCurrency:I,formatNumber:q}=Md({locale:(v==null?void 0:v.lang_code)||"ES"}),$=T.useMemo(()=>v?{subtotal_price:I(v.subtotal_price),discount:q(v.discount),discount_price:I(v.discount_price),tax:q(v.tax),tax_price:I(v.tax_price),total_price:I(v.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[v]),te=T.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!(v!=null&&v.date_sent),[v]),O=T.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!!(v!=null&&v.date_sent),[v]),k=W=>{N({id:v.id,newStatus:W},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},K=W=>{b({sent_date:C0(new Date)},{onSuccess:()=>{a({description:w("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},ne=T.useCallback(()=>{a({description:w("quotes.downloading_dialog.toast_success"),variant:"success"})},[a]),B=T.useCallback(()=>{v&&C(v.id,x(v))},[v]);if(R==="error"||R!=="success")return null;if(!v)return i.jsx(Te,{className:ge("overflow-hidden",o),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})});const me=W=>{E({id:W},{onSuccess(Re){a({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${Re.id}`,{relative:"path"})}})},_e=W=>{N({id:W,newStatus:"archived"},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})};return i.jsxs(i.Fragment,{children:[i.jsx(Vd,{...L,onFinishDownload:ne}),i.jsx(ad,{defaultValue:"resume",children:i.jsxs(Te,{className:"w-[390px] overflow-hidden",children:[i.jsxs(ct,{className:"gap-3 border-b bg-accent",children:[i.jsxs(Ve,{className:"flex items-center justify-between text-lg",children:[i.jsx("span",{children:w("quotes.list.resume.title")}),i.jsx(Gd,{status:v.status,onChangeStatus:k,type:"badge"})]}),i.jsx("div",{className:"flex w-full mr-auto text-foreground",children:i.jsxs("div",{className:"flex justify-between w-full",children:[i.jsxs(nr,{className:"gap-0",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",disabled:O,onClick:W=>{W.preventDefault(),r(`/quotes/edit/${v.id}`,{relative:"path"})},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",onClick:W=>{W.preventDefault(),me(v.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",onClick:B,children:[i.jsx(cd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"outline",size:"icon",disabled:O,onClick:W=>{W.preventDefault(),_e(v.id)},children:[i.jsx(ld,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(nr,{children:i.jsx(Ud,{disabled:O||!te,id:v.id,onSentTo:K})})]})})]}),i.jsxs(Oe,{className:"p-6 text-sm",children:[i.jsxs(od,{className:"grid w-full grid-cols-2",children:[i.jsx(Xa,{value:"resume",children:w("quotes.list.resume.tabs.resume")}),i.jsx(Xa,{value:"preview",children:w("quotes.list.resume.tabs.preview")})]}),i.jsx(Za,{value:"resume",className:"pt-4",children:i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.quote_information")}),i.jsxs("dl",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.reference.label")}),i.jsx("dd",{className:"font-medium",children:v.reference})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.date.label")}),i.jsx("dd",{className:"font-medium",children:new Date(v.date).toLocaleDateString()})]}),i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:w("quotes.form_fields.customer_reference.label")}),i.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:v.customer_reference})]})]})]}),i.jsx(hn,{className:"my-4"}),i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.customer_information")}),i.jsx("div",{children:v.customer_information})]}),i.jsx(hn,{className:"my-4"}),i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.price_information")}),i.jsxs("ul",{className:"grid gap-3",children:[i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.subtotal_price.label")}),i.jsx("span",{children:$.subtotal_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.discount_value.label",{value:$.discount})}),i.jsx("span",{children:$.discount_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.tax_value.label",{label:v.tax_label,value:$.tax})}),i.jsx("span",{children:$.tax_price})]}),i.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsx("span",{children:$.total_price})]})]})]})}),i.jsx(Za,{value:"preview",children:i.jsx(Bd,{quote:v})})]}),i.jsx(Nt,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:i.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},qw=({status:n="all",preview:o=!1})=>{const r=zt(),{toast:a}=_n(),l=T.useId(),c=T.useId(),{pagination:d,globalFilter:h,isFiltered:p}=Tn(),[x,v]=T.useState(void 0),{useList:R,useDownloader:N,useSetStatus:b,useDuplicate:E,getQuotePDFFilename:C}=Ur(),{mutate:L}=b(),{mutate:I}=E(),{data:q,isPending:$,isError:te,error:O}=R({pagination:{pageIndex:d.pageIndex,pageSize:d.pageSize},status:n,quickSearchTerm:h}),{download:k,...K}=N(),ne=je=>{v(je)},B=T.useCallback(()=>{a({description:w("quotes.downloading_dialog.toast_success")})},[a]),me=T.useCallback(je=>{r(`/quotes/edit/${je.id}`,{relative:"path"})},[r,a]),_e=je=>{I({id:je},{onSuccess(De){a({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${De.id}`,{relative:"path"})}})},W=je=>{L({id:je,newStatus:"archived"},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})},Re=(je,De)=>{L({id:je,newStatus:De},{onSuccess:()=>{a({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w(`quotes.status.${De}`)}),variant:"success"})}})},Je=T.useMemo(()=>{const je=[{id:"reference",accessorKey:"reference",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.reference")}),cell:({row:{original:G},renderValue:be})=>{const et=!!((G==null?void 0:G.status)==="accepted"&&(G!=null&&G.date_sent));return i.jsx(U,{size:"sm",variant:"link",disabled:et,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:it=>{it.preventDefault(),me(G)},children:i.jsx("div",{className:"",children:be()})})}},{id:"status",accessorKey:"status",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.status")}),cell:({row:{original:G}})=>i.jsx(Gd,{type:"badge",status:G.status,onChangeStatus:be=>Re(G.id,be)})},{id:"date_sent",accessor:"date_sent",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:w("quotes.list.columns.date_sent")}),cell:({row:{original:G}})=>{const be=Jn.create(G.date_sent),et=be.isSuccess&&!be.object.isEmpty();return i.jsx("div",{className:"text-left text-ellipsis",children:et?i.jsx(Id,{label:be.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):i.jsx(i.Fragment,{})})}},{id:"date",accessor:"date",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:w("quotes.list.columns.date")}),cell:({row:{original:G}})=>{const be=Jn.create(G.date);return i.jsx("div",{className:"text-left text-ellipsis",children:be.isSuccess?be.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.customer_reference")}),cell:({renderValue:G})=>i.jsx("div",{className:"text-left text-ellipsis",children:G()})},{id:"customer_information",accessorKey:"customer_information",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.customer_information")}),cell:({row:{original:G}})=>i.jsx("div",{className:"text-left text-ellipsis",children:G.customer_information.split(` +`).map((be,et)=>i.jsxs("span",{className:et===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[be,i.jsx("br",{})]},et))}),size:500}],De=[{id:"row-actions",header:()=>null,cell:({row:{original:G}})=>{const be=(G==null?void 0:G.status)==="accepted"&&!(G!=null&&G.date_sent),et=(G==null?void 0:G.status)==="accepted"&&!!(G!=null&&G.date_sent),it=(G==null?void 0:G.status)==="archived";return i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(nr,{className:"gap-0",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",disabled:et,onClick:bn=>{bn.preventDefault(),me(G)},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",onClick:bn=>{bn.preventDefault(),_e(G.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",onClick:()=>{k(G.id,C(G))},children:[i.jsx(cd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",disabled:it||et,onClick:bn=>{bn.preventDefault(),W(G.id)},children:[i.jsx(ld,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(nr,{children:i.jsx(Ud,{id:G.id,onSentTo:()=>null,disabled:et||!be})})]})}}];return o?je:[...je,...De]},[o]),{table:Y}=fs({data:(q==null?void 0:q.items)??[],columns:Je,pageCount:(q==null?void 0:q.total_pages)??-1});return T.useEffect(()=>{Y&&q&&(q==null?void 0:q.total_pages)>0&&v(Y.getRowModel().rows[0])},[q,Y]),te?i.jsx(cr,{subtitle:O.message}):$?i.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[i.jsx(Te,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),i.jsx("div",{})]}):(q==null?void 0:q.total_items)===0&&!p?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(ds,{subtitle:"Empieza creando alguna cotización",buttonText:w("quotes.create.title"),onButtonClick:()=>r("add",{relative:"path"})})})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[i.jsx("div",{id:l,className:"flex items-stretch flex-1",children:i.jsx(us,{table:Y,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:ne,activeRowIndex:x==null?void 0:x.index,children:i.jsx(qd,{table:Y})})}),o&&i.jsx("div",{id:c,className:"flex items-stretch ",children:i.jsx(kw,{quoteId:x==null?void 0:x.original.id})})]}),i.jsx(Vd,{...K,onFinishDownload:B})]})},rS=()=>{const n=zt(),o=ww(),{toast:r}=_n(),[a,l]=T.useState(Oa.createDefaultCode().object),[c,d]=T.useState(Pr.createDefaultCode().object),h=T.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",show_line_discount_column:!0,subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_label:"% IVA",tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:a.code},subtotal_price:{amount:null,scale:2,currency_code:a.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:a.code}}]}),[a.code]),{useOne:p,useUpdate:x}=Ur(),{data:v,status:R,error:N}=p(o),{mutate:b,isPending:E}=x(String(o)),C=is({mode:"onBlur",defaultValues:h}),{getValues:L,reset:I,handleSubmit:q,formState:$,control:te,watch:O,setValue:k}=C,{isSubmitting:K,isDirty:ne}=$;Io({isDirty:ne}),T.useEffect(()=>{if(!ne)return;const{unsubscribe:_e}=O((W,{name:Re,type:Je})=>{if(Re==="items"){W.items&&W.items.map((je,De)=>{if(je){const G=io(je);Ie.isEqual(G.subtotal_price.toObject(),je.subtotal_price)||k(`items.${De}.subtotal_price`,G.subtotal_price.toObject()),Ie.isEqual(G.total_price.toObject(),je.total_price)||k(`items.${De}.total_price`,G.total_price.toObject())}});const Y=Ka(W,!0);Ie.isEqual(Y.subtotal_price.toObject(),W.total_price)||k("subtotal_price",Y.subtotal_price.toObject()),Ie.isEqual(Y.discount_price.toObject(),W.total_price)||k("discount_price",Y.discount_price.toObject()),Ie.isEqual(Y.before_tax_price.toObject(),W.before_tax_price)||k("before_tax_price",Y.before_tax_price.toObject()),Ie.isEqual(Y.tax_price.toObject(),W.tax_price)||k("tax_price",Y.tax_price.toObject()),Ie.isEqual(Y.total_price.toObject(),W.total_price)||k("total_price",Y.total_price.toObject())}else if(Re&&Je==="change"){if(Re==="currency_code"){const Y=Oa.createFromCode(W.currency_code??Oa.DEFAULT_CURRENCY_CODE);if(Y.isFailure)throw console.error(Y.error),Y.error;l(Y.object)}if(Re==="lang_code"){const Y=Pr.createFromCode(W.lang_code??Pr.DEFAULT_LANGUAGE_CODE);if(Y.isFailure)throw console.error(Y.error),Y.error;d(Y.object)}if(["discount","tax"].includes(Re)){const Y=Ka(W,!0);Ie.isEqual(Y.subtotal_price.toObject(),W.total_price)||k("subtotal_price",Y.subtotal_price.toObject()),Ie.isEqual(Y.discount_price.toObject(),W.total_price)||k("discount_price",Y.discount_price.toObject()),Ie.isEqual(Y.before_tax_price.toObject(),W.before_tax_price)||k("before_tax_price",Y.before_tax_price.toObject()),Ie.isEqual(Y.tax_price.toObject(),W.tax_price)||k("tax_price",Y.tax_price.toObject()),Ie.isEqual(Y.total_price.toObject(),W.total_price)||k("total_price",Y.total_price.toObject())}if(Re!=null&&Re.startsWith("items")){const Y=Number(Re.split(".")[1]),je=Re.split(".")[2];if(["quantity","unit_price","discount"].includes(je)&&W.items&&W.items[Y]){const De=W.items[Y],G=io(De);Ie.isEqual(G.quantity.toObject(),De.quantity)||k(`items.${Y}.quantity`,G.quantity.toObject()),Ie.isEqual(G.unit_price.toObject(),De.unit_price)||k(`items.${Y}.unit_price`,G.unit_price.toObject()),Ie.isEqual(G.discount.toObject(),De.discount)||k(`items.${Y}.discount`,G.discount.toObject()),Ie.isEqual(G.subtotal_price.toObject(),De.subtotal_price)||k(`items.${Y}.subtotal_price`,G.subtotal_price.toObject()),Ie.isEqual(G.total_price.toObject(),De.total_price)||k(`items.${Y}.total_price`,G.total_price.toObject());const be=Ka(W,!0);Ie.isEqual(be.subtotal_price.toObject(),W.total_price)||k("subtotal_price",be.subtotal_price.toObject()),Ie.isEqual(be.discount_price.toObject(),W.total_price)||k("discount_price",be.discount_price.toObject()),Ie.isEqual(be.before_tax_price.toObject(),W.before_tax_price)||k("before_tax_price",be.before_tax_price.toObject()),Ie.isEqual(be.tax_price.toObject(),W.tax_price)||k("tax_price",be.tax_price.toObject()),Ie.isEqual(be.total_price.toObject(),W.total_price)||k("total_price",be.total_price.toObject())}}}});return()=>_e()},[O,ne,k]);const B=async(_e,W)=>{b(_e,{onError:Re=>{console.error(Re),r({title:"Error",description:Re.message,variant:"destructive"})},onSuccess:()=>{I(L()),r({title:"Cotización guardada",variant:"success"}),W&&n("/quotes")}})},me=T.useCallback(()=>{n("/quotes",{state:{id:o}})},[n,o]);return T.useEffect(()=>{R==="success"&&v&&I(v)},[R,v,I]),R==="error"?i.jsx(cr,{errorMessage:N.message}):R!=="success"?i.jsx(Ln,{}):i.jsxs(i.Fragment,{children:[(K||E)&&i.jsx(Ln,{title:"Guardando cotización"}),i.jsx(ss,{...C,children:i.jsx("form",{onSubmit:q(_e=>B(_e,!1)),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(zc,{}),i.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[w("quotes.edit.title")," ",v.reference]}),i.jsx(Id,{label:w(`quotes.status.${v.status}`),className:"ml-auto sm:ml-0"}),i.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[i.jsx(y0,{label:w("common.close"),variant:"secondary",size:"sm",onClick:me}),i.jsx(wo,{label:w("common.save"),size:"sm",disabled:$.isSubmitting||$.isLoading||$.isValidating}),i.jsx(U,{size:"sm",disabled:$.isSubmitting||$.isLoading||$.isValidating,onClick:q(_e=>B(_e,!0)),children:w("common.save_close")})]})]}),i.jsx(Tw,{}),i.jsx(jw,{currency:a}),i.jsx(Lw,{currency:a,language:c,defaultValues:h}),i.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[i.jsx(U,{variant:"outline",size:"sm",children:w("common.discard")}),i.jsx(U,{onClick:q(_e=>B(_e,!1)),size:"sm",children:w("quotes.edit.buttons.save_quote")})]})]})})}),!1]})},$w=T.createContext(null),zw=({children:n})=>{const[o,r]=qc();return i.jsx($w.Provider,{value:{pagination:o,setPagination:r},children:n})},iS=({children:n})=>i.jsx(as,{children:i.jsx(zw,{children:i.jsxs(zr,{className:"quotes-layout",children:[i.jsx(Vr,{}),i.jsx(Br,{children:n})]})})}),sS=()=>{const n=zt(),[o,r]=T.useState("all"),[a,l]=rw(!0),c=[{value:"all",label:w("quotes.list.tabs.all")},{value:"draft",label:w("quotes.list.tabs.draft")},{value:"ready",label:w("quotes.list.tabs.ready")},{value:"delivered",label:w("quotes.list.tabs.delivered")},{value:"accepted",label:w("quotes.list.tabs.accepted")},{value:"rejected",label:w("quotes.list.tabs.rejected")},{value:"archived",label:w("quotes.list.tabs.archived")}];return i.jsxs(rr,{children:[i.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(se,{i18nKey:"quotes.list.title"})}),i.jsx("p",{className:"text-muted-foreground",children:i.jsx(se,{i18nKey:"quotes.list.subtitle"})})]}),i.jsx("div",{className:"flex items-center space-x-2",children:i.jsxs(U,{onClick:()=>n("/quotes/add"),children:[i.jsx(yo,{className:"w-4 h-4 mr-2"}),w("quotes.create.title")]})})]}),i.jsxs(ad,{value:o,onValueChange:r,children:[i.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[i.jsx(od,{className:"hidden sm:flex",children:c.map(d=>i.jsx(Xa,{value:d.value,children:d.label},d.value))}),i.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[i.jsx(dr,{children:w("quotes.list.tabs_title")}),i.jsxs(Zi,{value:o,onValueChange:r,children:[i.jsx(Ji,{children:i.jsx(es,{placeholder:"Seleccionar estado"})}),i.jsx(ts,{children:c.map(d=>i.jsx(Dn,{value:d.value,children:d.label},d.value))})]})]})]}),i.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:i.jsx(Wb,{buttonText:"Ayuda",title:"Ayuda sobre el Estado de Cotizaciones",content:Vw})}),i.jsx("div",{className:"flex items-center gap-2 ml-auto",children:i.jsx(N0,{"aria-label":"Show quote preview",variant:"outline",defaultPressed:!1,pressed:a,onPressedChange:l,children:a?i.jsxs(i.Fragment,{children:[i.jsx(dd,{className:"w-4 h-4 mr-2"}),w("common.disable_preview")]}):i.jsxs(i.Fragment,{children:[i.jsx(T0,{className:"w-4 h-4 mr-2"}),w("common.enable_preview")]})})})]}),c.map(d=>i.jsx(Za,{value:d.value,children:i.jsx(qw,{status:d.value,preview:a})},d.value))]})]})},Vw=i.jsxs(ao,{className:"grid gap-4 py-4",children:[i.jsx("p",{children:"El estado de una cotización indica su posición actual en el proceso de negocio."}),i.jsx("p",{children:"Los estados posibles son:"}),i.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Borrador:"})," La cotización está en proceso de creación o edición."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Preparado:"})," La cotización está lista para ser enviada al cliente."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Entregado:"})," La cotización ha sido enviada al cliente."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Aceptado:"})," El cliente ha aprobado la cotización."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Rechazado:"})," El cliente no ha aceptado la cotización."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Arcivado:"})," La cotización ha sido guardada para referencia futura y ya no está activa."]})]}),i.jsxs("p",{children:["Utiliza estos estados para hacer un seguimiento eficiente de tus cotizaciones y optimizar tu proceso de ventas. El estado ",i.jsx("strong",{children:"Archivado"})," es útil para mantener un historial de cotizaciones pasadas sin que interfieran con las cotizaciones activas."]})]}),Bw=n=>{const o=$r(),r=Mn(),a=r().data().resource("settings").action("one").id("me").params().get(),l=r().auth().action("profile").get();return{useOne:()=>vd({queryKey:a,queryFn:()=>o.getOne({resource:"profile",id:""}),...n}),useUpdate:()=>{const c=Jt();return en({mutationKey:a,mutationFn:d=>o.updateOne({resource:"profile",data:d,id:""}),onSuccess:(d,h)=>{const p=x=>x&&{...x,lang_code:h.lang_code??x.lang_code,dealer:{...x.dealer,...d}};return c.setQueryData(a,p),c.setQueryData(l,p),Promise.all([c.invalidateQueries({queryKey:a}),c.invalidateQueries({queryKey:l})])}})},useUploadLogo:()=>{const c=Jt(),{mutate:d,mutateAsync:h,...p}=en({mutationKey:["data","default","settings"],mutationFn:x=>o.uploadFile({path:"profile/logo",file:x,key:"logo"}),onError:()=>c.invalidateQueries({queryKey:["data","default","settings"]}),onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","settings"]})}});return{upload:d,uploadAsync:h,...p}}}},aS=()=>{var k,K;const[n,o]=T.useState("profile"),{useOne:r,useUpdate:a,useUploadLogo:l}=Bw(),{toast:c}=_n(),{i18n:d}=rs(),{data:h,status:p,error:x}=r(),v=T.useMemo(()=>({lang_code:"es",contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_show_line_discount_column:!0,default_tax:{amount:void 0,scale:2},default_tax_label:"% IVA"}),[]),{mutate:R}=a(),{upload:N}=l(),b=is({mode:"onBlur",values:h?{...h.dealer,lang_code:h.lang_code}:void 0,defaultValues:v}),{formState:E,reset:C,getValues:L,handleSubmit:I}=b,{isSubmitting:q,isDirty:$}=E,te=ne=>{var me;const B=(me=ne.target.files)==null?void 0:me[0];if(B){if(B.type!=="image/png"&&B.type!=="image/jpeg"){alert(w("settings.form_fields.logo.invalid_format"));return}const _e=new FileReader;_e.onloadend=()=>{const W=new Image;W.onload=()=>{const Re=W.width,Je=W.height,Y=Re/Je===2;Re<200||Je<100||!Y?alert(w("settings.form_fields.logo.invalid_dimensions")):N(B)},W.src=_e.result},_e.readAsDataURL(B)}};Io({isDirty:$});const O=async ne=>{R(ne,{onError:B=>{console.debug(B),c({title:"Error",description:B.message,variant:"destructive"})},onSuccess:()=>{d.language!==ne.lang_code&&d.changeLanguage(ne.lang_code??"es"),C(L()),c({description:"Ajustes guardados",variant:"success"})}})};return q?i.jsx(Ln,{title:"Guardando ajustes"}):p==="error"?i.jsx(cr,{errorMessage:x.message}):p!=="success"?i.jsx(Ln,{}):i.jsx(ss,{...b,children:i.jsx("form",{onSubmit:I(O),children:i.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]",children:[((k=b.formState.errors.root)==null?void 0:k.message)&&i.jsxs(Oc,{variant:"destructive",children:[i.jsx(ud,{className:"w-4 h-4"}),i.jsx(Pc,{children:i.jsx(se,{i18nKey:"common.error"})}),i.jsx(kc,{children:(K=b.formState.errors.root)==null?void 0:K.message})]}),i.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[i.jsx("a",{onClick:()=>o("profile"),className:n==="profile"?"font-semibold text-primary":"cursor-pointer",children:i.jsx(se,{i18nKey:"settings.edit.tabs.profile"})}),i.jsx("a",{onClick:()=>o("quotes"),className:n==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.quotes"})}),i.jsx("a",{onClick:()=>o("legal"),className:n==="legal"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(se,{i18nKey:"settings.edit.tabs.legal"})})]}),i.jsxs("div",{className:ge("grid gap-6",n==="profile"?"visible":"hidden"),children:[i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.language.desc"})})]}),i.jsx(Oe,{children:i.jsx(pc,{control:b.control,name:"lang_code",render:({field:ne})=>i.jsxs(Zi,{value:ne.value,onValueChange:ne.onChange,children:[i.jsx(Ji,{"aria-label":w("settings.form_fields.language.label"),children:i.jsx(es,{placeholder:w("settings.form_fields.language.placeholder")})}),i.jsxs(ts,{children:[i.jsx(Dn,{value:"es",children:"Español"}),i.jsx(Dn,{value:"en",children:"English"})]})]})})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{rows:8,placeholder:w("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.logo.desc"})})]}),i.jsx(Oe,{children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:h.dealer.logo?h.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),i.jsx("div",{children:i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),i.jsxs(Nt,{className:"px-6 py-4 border-t",children:[i.jsx(dr,{htmlFor:"logo-upload",className:"inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors rounded-md cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:i.jsx(se,{i18nKey:"settings.form_fields.logo.upload"})}),i.jsx(ns,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:te,className:"hidden"})]})]})]}),i.jsxs("div",{className:ge("grid gap-6",n==="quotes"?"visible":"hidden"),children:[i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_show_line_discount_column.desc"})})]}),i.jsx(Oe,{children:i.jsx(pc,{control:b.control,name:"default_show_line_discount_column",render:({field:ne})=>i.jsx(So,{checked:ne.value??!0,onCheckedChange:ne.onChange})})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),i.jsxs(Oe,{children:[i.jsx(mn,{maxLength:32,placeholder:w("settings.form_fields.default_tax_label.placeholder"),name:"default_tax_label",required:!0,description:w("settings.form_fields.default_tax_label.desc")}),i.jsx("br",{}),i.jsx(Hi,{scale:2,disabled:E.disabled,placeholder:w("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0,description:w("settings.form_fields.default_tax.desc")})]}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:b.formState.errors})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]}),i.jsxs(Te,{children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]})]}),i.jsx("div",{className:ge("grid gap-6",n==="legal"?"visible":"hidden"),children:i.jsxs(Te,{className:"h-",children:[i.jsxs(ct,{children:[i.jsx(Ve,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),i.jsx(He,{children:i.jsx(se,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{rows:25,placeholder:w("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),i.jsx(Nt,{className:"px-6 py-4 border-t",children:i.jsx(U,{children:i.jsx(se,{i18nKey:"common.save"})})})]})})]})})})},Uw=T.createContext(null),Gw=({children:n})=>i.jsx(Uw.Provider,{value:{},children:n}),oS=({children:n})=>i.jsx(as,{children:i.jsx(Gw,{children:i.jsxs(zr,{className:"settings-layout",children:[i.jsx(Vr,{}),i.jsxs(Br,{children:[i.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:i.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:i.jsx(se,{i18nKey:"settings.edit.title"})})}),n]})]})})});export{Qw as CatalogLayout,Xw as CatalogList,Zw as DashboardPage,Jw as DealerLayout,eS as DealersList,tS as ErrorPage,Ww as LoginPageWithLanguageSelector,Yw as LogoutPage,nS as QuoteCreate,rS as QuoteEdit,iS as QuotesLayout,sS as QuotesList,aS as SettingsEditor,oS as SettingsLayout}; diff --git a/dist/client/assets/index-CCfX-UYJ.js b/dist/client/assets/index-CCfX-UYJ.js deleted file mode 100644 index ab11f4b..0000000 --- a/dist/client/assets/index-CCfX-UYJ.js +++ /dev/null @@ -1,254 +0,0 @@ -var k_=Object.defineProperty;var q_=(n,a,r)=>a in n?k_(n,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[a]=r;var Se=(n,a,r)=>q_(n,typeof a!="symbol"?a+"":a,r);import{u as Fc,a as Jt,b as en,c as Mn,d as Ne,j as i,P as $_,e as z_,f as he,g as B_,N as Wi,R as Pe,J as Nt,h as ke,i as Jn,D as er,l as Aa,M as Tt,V as V_,r as M,k as Mc,m as Dc,n as rr,o as Tc,B as G,C as U_,p as ir,q as sr,s as ar,S as no,t as or,v as Vi,w,x as ro,y as Yi,z as Qi,A as Xi,E as Lr,F as io,G as so,H as ao,I as oo,K as lo,L as G_,O as Or,Q as H_,T as K_,U as W_,W as Le,X as pt,Y as Ge,Z as Ze,_ as Oe,$ as hn,a0 as uo,a1 as Y_,a2 as co,a3 as pn,a4 as fo,a5 as go,a6 as qr,a7 as Dt,a8 as Lc,a9 as Q_,aa as Ui,ab as lr,ac as mo,ad as ho,ae as po,af as xo,ag as Oc,ah as vo,ai as _o,aj as bo,ak as Zi,al as X_,am as Z_,an as J_,ao as gc,ap as e0,aq as t0,ar as mc,as as hc,at as Ia,au as n0,av as r0,aw as In,ax as pc,ay as i0,az as s0,aA as a0,aB as wo,aC as zt,aD as _n,aE as Ji,aF as Pc,aG as Fn,aH as o0,aI as kc,aJ as l0,aK as le,aL as es,aM as xc,aN as qc,aO as $c,aP as zc,aQ as Dn,aR as Bc,aS as ts,aT as zr,aU as Br,aV as Vr,aW as $r,aX as u0,aY as Vc,aZ as He,a_ as Ke,a$ as Ua,b0 as We,b1 as tr,b2 as ur,b3 as nr,b4 as c0,b5 as d0,b6 as f0,b7 as Ga,b8 as g0,b9 as m0,ba as Xn,bb as Uc,bc as Ha,bd as Gc,be as qt,bf as h0,bg as vc,bh as ns,bi as cr,bj as Hc,bk as p0,bl as So,bm as x0,bn as Kc,bo as Wc,bp as Yc,bq as Qc,br as Xc,bs as Zc,bt as Jc,bu as ed,bv as td,bw as v0,bx as Pi,by as _0,bz as b0,bA as w0,bB as S0,bC as j0,bD as C0,bE as y0,bF as N0,bG as R0,bH as E0,bI as A0,bJ as _c,bK as nd,bL as rd,bM as id,bN as sd,bO as ad,bP as od,bQ as ld,bR as I0,bS as Fa,bT as F0,bU as M0,bV as D0,bW as ud,bX as cd,bY as Ka,bZ as Wa,b_ as T0,b$ as Ma,c0 as L0,c1 as O0,c2 as P0}from"./index-CJmQk4ZY.js";const k0=n=>{const{onSuccess:a,...r}=n||{},o=Mn(),{login:l}=Fc(),c=Jt();return en({mutationKey:o().auth().action("login").get(),mutationFn:l,onSuccess:async(d,h,p)=>{d.success&&c.removeQueries({queryKey:o().auth().get()}),await(a==null?void 0:a(d,h,p))},...r})};/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dd=Ne("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q0=Ne("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bc=Ne("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wc=Ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $0=Ne("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z0=Ne("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fd=Ne("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B0=Ne("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const V0=Ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const U0=Ne("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jo=Ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gd=Ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G0=Ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const md=Ne("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H0=Ne("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K0=Ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hd=Ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W0=Ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Co=Ne("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yo=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y0=Ne("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Q0=Ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X0=Ne("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pd=Ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** - * @license lucide-react v0.427.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xd=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Z0=({className:n,...a})=>i.jsx(z_,{className:he("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),...a}),Sc=$_,J0=({withHandle:n,className:a,...r})=>i.jsx(B_,{className:he("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",a),...r,children:n&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(hd,{className:"h-2.5 w-2.5"})})});function ut({className:n,...a}){return i.jsx("div",{className:he("animate-pulse rounded-md bg-muted",n),...a})}const eb=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("total_items");let ki;const tb=new Uint8Array(16);function nb(){if(!ki&&(ki=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ki))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ki(tb)}const Ue=[];for(let n=0;n<256;++n)Ue.push((n+256).toString(16).slice(1));function rb(n,a=0){return Ue[n[a+0]]+Ue[n[a+1]]+Ue[n[a+2]]+Ue[n[a+3]]+"-"+Ue[n[a+4]]+Ue[n[a+5]]+"-"+Ue[n[a+6]]+Ue[n[a+7]]+"-"+Ue[n[a+8]]+Ue[n[a+9]]+"-"+Ue[n[a+10]]+Ue[n[a+11]]+Ue[n[a+12]]+Ue[n[a+13]]+Ue[n[a+14]]+Ue[n[a+15]]}const ib=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),jc={randomUUID:ib};function sb(n,a,r){if(jc.randomUUID&&!n)return jc.randomUUID();n=n||{};const o=n.random||(n.rng||nb)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,rb(o)}class dn extends Wi{static validate(a,r){const o=Pe.RULE_ALLOW_EMPTY.default(""),l=Nt.string().guid({version:["uuidv4"]}).label(r.label?r.label:"id"),c=Nt.alternatives(o,l);return Pe.validate(c,a)}static sanitize(a){return a.trim()}static create(a,r={}){const o={label:"id",generateOnEmpty:!1,...r};if(!a&&!o.generateOnEmpty)return ke.fail(Jn(er.INVALID_INPUT_DATA,"ID is null or empty"));if(a){const l=dn.validate(a,o);return l.isFailure?ke.fail(Jn(er.INVALID_INPUT_DATA,l.error.message,o)):ke.ok(new dn(dn.sanitize(l.object)))}return o.generateOnEmpty?dn.generateNewID():ke.ok(new dn(null))}static generateNewID(){return ke.ok(new dn(sb()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}const Da={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian",nativeName:"bosanski jezik"},ca:{name:"Catalan",nativeName:"Català"},ce:{name:"Chechen",nativeName:"нохчийн мотт"},ch:{name:"Chamorro",nativeName:"Chamoru"},co:{name:"Corsican",nativeName:"corsu"},cr:{name:"Cree",nativeName:"ᓀᐦᐃᔭᐍᐏᐣ"},cs:{name:"Czech",nativeName:"čeština"},cu:{name:"Old Church Slavonic",nativeName:"ѩзыкъ словѣньскъ"},cv:{name:"Chuvash",nativeName:"чӑваш чӗлхи"},cy:{name:"Welsh",nativeName:"Cymraeg"},da:{name:"Danish",nativeName:"dansk"},de:{name:"German",nativeName:"Deutsch"},dv:{name:"Divehi",nativeName:"ދިވެހި"},dz:{name:"Dzongkha",nativeName:"རྫོང་ཁ"},ee:{name:"Ewe",nativeName:"Eʋegbe"},el:{name:"Greek",nativeName:"Ελληνικά"},en:{name:"English",nativeName:"English"},eo:{name:"Esperanto",nativeName:"Esperanto"},es:{name:"Spanish",nativeName:"Español"},et:{name:"Estonian",nativeName:"eesti"},eu:{name:"Basque",nativeName:"euskara"},fa:{name:"Persian",nativeName:"فارسی"},ff:{name:"Fula",nativeName:"Fulfulde"},fi:{name:"Finnish",nativeName:"suomi"},fj:{name:"Fijian",nativeName:"vosa Vakaviti"},fo:{name:"Faroese",nativeName:"føroyskt"},fr:{name:"French",nativeName:"Français"},fy:{name:"Western Frisian",nativeName:"Frysk"},ga:{name:"Irish",nativeName:"Gaeilge"},gd:{name:"Scottish Gaelic",nativeName:"Gàidhlig"},gl:{name:"Galician",nativeName:"galego"},gn:{name:"Guaraní",nativeName:"Avañe'ẽ"},gu:{name:"Gujarati",nativeName:"ગુજરાતી"},gv:{name:"Manx",nativeName:"Gaelg"},ha:{name:"Hausa",nativeName:"هَوُسَ"},he:{name:"Hebrew",nativeName:"עברית"},hi:{name:"Hindi",nativeName:"हिन्दी"},ho:{name:"Hiri Motu",nativeName:"Hiri Motu"},hr:{name:"Croatian",nativeName:"Hrvatski"},ht:{name:"Haitian",nativeName:"Kreyòl ayisyen"},hu:{name:"Hungarian",nativeName:"magyar"},hy:{name:"Armenian",nativeName:"Հայերեն"},hz:{name:"Herero",nativeName:"Otjiherero"},ia:{name:"Interlingua",nativeName:"Interlingua"},id:{name:"Indonesian",nativeName:"Bahasa Indonesia"},ie:{name:"Interlingue",nativeName:"Interlingue"},ig:{name:"Igbo",nativeName:"Asụsụ Igbo"},ii:{name:"Nuosu",nativeName:"ꆈꌠ꒿ Nuosuhxop"},ik:{name:"Inupiaq",nativeName:"Iñupiaq"},io:{name:"Ido",nativeName:"Ido"},is:{name:"Icelandic",nativeName:"Íslenska"},it:{name:"Italian",nativeName:"Italiano"},iu:{name:"Inuktitut",nativeName:"ᐃᓄᒃᑎᑐᑦ"},ja:{name:"Japanese",nativeName:"日本語"},jv:{name:"Javanese",nativeName:"basa Jawa"},ka:{name:"Georgian",nativeName:"ქართული"},kg:{name:"Kongo",nativeName:"Kikongo"},ki:{name:"Kikuyu",nativeName:"Gĩkũyũ"},kj:{name:"Kwanyama",nativeName:"Kuanyama"},kk:{name:"Kazakh",nativeName:"қазақ тілі"},kl:{name:"Kalaallisut",nativeName:"kalaallisut"},km:{name:"Khmer",nativeName:"ខេមរភាសា"},kn:{name:"Kannada",nativeName:"ಕನ್ನಡ"},ko:{name:"Korean",nativeName:"한국어"},kr:{name:"Kanuri",nativeName:"Kanuri"},ks:{name:"Kashmiri",nativeName:"कश्मीरी"},ku:{name:"Kurdish",nativeName:"Kurdî"},kv:{name:"Komi",nativeName:"коми кыв"},kw:{name:"Cornish",nativeName:"Kernewek"},ky:{name:"Kyrgyz",nativeName:"Кыргызча"},la:{name:"Latin",nativeName:"latine"},lb:{name:"Luxembourgish",nativeName:"Lëtzebuergesch"},lg:{name:"Ganda",nativeName:"Luganda"},li:{name:"Limburgish",nativeName:"Limburgs"},ln:{name:"Lingala",nativeName:"Lingála"},lo:{name:"Lao",nativeName:"ພາສາລາວ"},lt:{name:"Lithuanian",nativeName:"lietuvių kalba"},lu:{name:"Luba-Katanga",nativeName:"Kiluba"},lv:{name:"Latvian",nativeName:"latviešu valoda"},mg:{name:"Malagasy",nativeName:"fiteny malagasy"},mh:{name:"Marshallese",nativeName:"Kajin M̧ajeļ"},mi:{name:"Māori",nativeName:"te reo Māori"},mk:{name:"Macedonian",nativeName:"македонски јазик"},ml:{name:"Malayalam",nativeName:"മലയാളം"},mn:{name:"Mongolian",nativeName:"Монгол хэл"},mr:{name:"Marathi",nativeName:"मराठी"},ms:{name:"Malay",nativeName:"Bahasa Melayu"},mt:{name:"Maltese",nativeName:"Malti"},my:{name:"Burmese",nativeName:"ဗမာစာ"},na:{name:"Nauru",nativeName:"Dorerin Naoero"},nb:{name:"Norwegian Bokmål",nativeName:"Norsk bokmål"},nd:{name:"Northern Ndebele",nativeName:"isiNdebele"},ne:{name:"Nepali",nativeName:"नेपाली"},ng:{name:"Ndonga",nativeName:"Owambo"},nl:{name:"Dutch",nativeName:"Nederlands"},nn:{name:"Norwegian Nynorsk",nativeName:"Norsk nynorsk"},no:{name:"Norwegian",nativeName:"Norsk"},nr:{name:"Southern Ndebele",nativeName:"isiNdebele"},nv:{name:"Navajo",nativeName:"Diné bizaad"},ny:{name:"Chichewa",nativeName:"chiCheŵa"},oc:{name:"Occitan",nativeName:"occitan"},oj:{name:"Ojibwe",nativeName:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},om:{name:"Oromo",nativeName:"Afaan Oromoo"},or:{name:"Oriya",nativeName:"ଓଡ଼ିଆ"},os:{name:"Ossetian",nativeName:"ирон æвзаг"},pa:{name:"Panjabi",nativeName:"ਪੰਜਾਬੀ"},pi:{name:"Pāli",nativeName:"पाऴि"},pl:{name:"Polish",nativeName:"Polski"},ps:{name:"Pashto",nativeName:"پښتو"},pt:{name:"Portuguese",nativeName:"Português"},qu:{name:"Quechua",nativeName:"Runa Simi"},rm:{name:"Romansh",nativeName:"rumantsch grischun"},rn:{name:"Kirundi",nativeName:"Ikirundi"},ro:{name:"Romanian",nativeName:"Română"},ru:{name:"Russian",nativeName:"Русский"},rw:{name:"Kinyarwanda",nativeName:"Ikinyarwanda"},sa:{name:"Sanskrit",nativeName:"संस्कृतम्"},sc:{name:"Sardinian",nativeName:"sardu"},sd:{name:"Sindhi",nativeName:"सिन्धी"},se:{name:"Northern Sami",nativeName:"Davvisámegiella"},sg:{name:"Sango",nativeName:"yângâ tî sängö"},si:{name:"Sinhala",nativeName:"සිංහල"},sk:{name:"Slovak",nativeName:"slovenčina"},sl:{name:"Slovenian",nativeName:"slovenščina"},sm:{name:"Samoan",nativeName:"gagana fa'a Samoa"},sn:{name:"Shona",nativeName:"chiShona"},so:{name:"Somali",nativeName:"Soomaaliga"},sq:{name:"Albanian",nativeName:"Shqip"},sr:{name:"Serbian",nativeName:"српски језик"},ss:{name:"Swati",nativeName:"SiSwati"},st:{name:"Southern Sotho",nativeName:"Sesotho"},su:{name:"Sundanese",nativeName:"Basa Sunda"},sv:{name:"Swedish",nativeName:"Svenska"},sw:{name:"Swahili",nativeName:"Kiswahili"},ta:{name:"Tamil",nativeName:"தமிழ்"},te:{name:"Telugu",nativeName:"తెలుగు"},tg:{name:"Tajik",nativeName:"тоҷикӣ"},th:{name:"Thai",nativeName:"ไทย"},ti:{name:"Tigrinya",nativeName:"ትግርኛ"},tk:{name:"Turkmen",nativeName:"Türkmençe"},tl:{name:"Tagalog",nativeName:"Wikang Tagalog"},tn:{name:"Tswana",nativeName:"Setswana"},to:{name:"Tonga",nativeName:"faka Tonga"},tr:{name:"Turkish",nativeName:"Türkçe"},ts:{name:"Tsonga",nativeName:"Xitsonga"},tt:{name:"Tatar",nativeName:"татар теле"},tw:{name:"Twi",nativeName:"Twi"},ty:{name:"Tahitian",nativeName:"Reo Tahiti"},ug:{name:"Uyghur",nativeName:"ئۇيغۇرچە‎"},uk:{name:"Ukrainian",nativeName:"Українська"},ur:{name:"Urdu",nativeName:"اردو"},uz:{name:"Uzbek",nativeName:"Ўзбек"},ve:{name:"Venda",nativeName:"Tshivenḓa"},vi:{name:"Vietnamese",nativeName:"Tiếng Việt"},vo:{name:"Volapük",nativeName:"Volapük"},wa:{name:"Walloon",nativeName:"walon"},wo:{name:"Wolof",nativeName:"Wollof"},xh:{name:"Xhosa",nativeName:"isiXhosa"},yi:{name:"Yiddish",nativeName:"ייִדיש"},yo:{name:"Yoruba",nativeName:"Yorùbá"},za:{name:"Zhuang",nativeName:"Saɯ cueŋƅ"},zh:{name:"Chinese",nativeName:"中文"},zu:{name:"Zulu",nativeName:"isiZulu"}},fn=class fn extends Wi{constructor(){super(...arguments);Se(this,"toString",()=>this.code)}static validate(r,o){const l=Nt.alternatives(Pe.RULE_ALLOW_EMPTY.default(""),Nt.string().lowercase().valid(...Object.keys(Da)).label(String(o.label)));return Pe.validate(l,r)}static sanitize(r){return r?String(r).toLowerCase():void 0}static createFromCode(r,o={}){const l={...o,label:o.label?o.label:"lang_code"},c=fn.validate(r,l);if(c.isFailure)return ke.fail(Jn(er.INVALID_INPUT_DATA,c.error.message,l));const d=fn.sanitize(c.object),h=d?{...Da[c.object],code:d}:void 0;return ke.ok(new fn(h))}static createDefaultCode(){return fn.createFromCode(this.DEFAULT_LANGUAGE_CODE)}get name(){return this.props?String(this.props.name):""}get nativeName(){return this.props?String(this.props.nativeName):""}get code(){return this.props?String(this.props.code):""}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};Se(fn,"DEFAULT_LANGUAGE_CODE","es"),Se(fn,"LANGUAGES",Da);let Pr=fn;class vd{constructor(a){Se(this,"_collection",[]);this._collection=a??[]}add(a){this._collection.push(a)}reset(){this._collection=[]}hasSomeFaultyResult(){return this._collection.some(a=>a.isFailure)}getFirstFaultyResult(){return this._collection.find(a=>a.isFailure)}getAllFaultyResults(){return this._collection.filter(a=>a.isFailure)}get objects(){return this._collection.filter(a=>a.isSuccess).map(a=>a.object)}get errors(){return this._collection.filter(a=>a.isFailure).map(a=>a.error)}}const _d=2,Ta={amount:0,scale:_d},ve=class ve extends Wi{constructor(r,o,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(o),this._options=Object.freeze(l)}static validate(r,o,l){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,h=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Nt.number().min(ve.MIN_SCALE).max(ve.MAX_SCALE).label(l.label?l.label:"scale"),v=new vd([Pe.validate(Nt.alternatives(c,d,h,p),r),Pe.validate(Nt.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),o)]);if(v.hasSomeFaultyResult())return v.getFirstFaultyResult();let R=typeof r=="string"?parseInt(r,10):Number(r),y=Aa.isNull(o)?ve.DEFAULT_SCALE:Number(o);const b=R/Math.pow(10,y);return bve.MAX_VALUE?ke.fail(new Error(`Value with scale is out of range: ${b}`)):ke.ok()}static create(r=Ta,o={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=Ta.amount,scale:c=Ta.scale}=r,d={label:"percentage",...o},h=ve.validate(l,c,d);if(h.isFailure)return ke.fail(Jn(er.INVALID_INPUT_DATA,h.error.message,d));let p=ve._sanitize(l);const x={amount:Aa.isNull(p)?0:p,scale:c};return ke.ok(new this(x,Aa.isNull(p),o))}static createFromFormattedValue(r,o={}){if(r===null||r==="")return ve.create({amount:null,scale:ve.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let h=c,p=2;return d===void 0?p=0:(d===""&&(h=c+d.padEnd(1,"0"),p=1),d.length===1?(h=c+d.padEnd(1,"0"),p=1):d.length===2&&(h=c+d.padEnd(2,"0"),p=2)),ve.create({amount:h,scale:p},o)}static _sanitize(r){let o=null;return typeof r=="string"?o=parseInt(r,10):o=r,o}static _toString(r,o){if(r===null)return"";const l=Math.pow(10,o);return(Number(r)/l).toFixed(o)}static _isWithinRange(r,o){const l=Number(ve._toString(r,o));return l>=ve.MIN_VALUE&&l<=ve.MAX_VALUE}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return ve._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==ve.DEFAULT_SCALE?this.convertScale(ve.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(rve.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new ve({amount:null,scale:r},!0,this._options);const o=Math.pow(10,this.scale),l=Number(this.amount)/o,c=Math.pow(10,r),d=Math.round(l*c);if(!ve._isWithinRange(d,r))throw new Error(`Value out of range after conversion: ${d} ${r}`);return new ve({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}isWithinRange(){return ve._isWithinRange(this.amount,this.scale)}};Se(ve,"DEFAULT_SCALE",_d),Se(ve,"MIN_VALUE",0),Se(ve,"MAX_VALUE",100),Se(ve,"MIN_SCALE",0),Se(ve,"MAX_SCALE",2);let $t=ve;const bd=2,La={amount:0,scale:bd},_e=class _e extends Wi{constructor(r,o,l){super(r);Se(this,"_isNull");Se(this,"_options");Se(this,"isEmpty",()=>this.isNull());Se(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(o),this._options=Object.freeze(l)}static validate(r,o,l={}){const c=Pe.RULE_ALLOW_NULL_OR_UNDEFINED,d=Pe.RULE_ALLOW_EMPTY,h=Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"amount"),p=Pe.RULE_IS_TYPE_STRING.regex(/^[-]?\d+$/).label(l.label?l.label:"amount"),x=Nt.number().min(_e.MIN_SCALE).max(_e.MAX_SCALE).label(l.label?l.label:"scale"),v=new vd([Pe.validate(Nt.alternatives(c,d,h,p),r),Pe.validate(Nt.alternatives(Pe.RULE_IS_TYPE_NUMBER.label(l.label?l.label:"scale"),x),o)]);return v.hasSomeFaultyResult()?v.getFirstFaultyResult():ke.ok()}static create(r=La,o={}){if(r===null)throw new Error("InvalidParams: props params is missing");const{amount:l=La.amount,scale:c=La.scale}=r,d={label:"quantity",...o},h=_e.validate(l,c,d);if(h.isFailure)return ke.fail(Jn(er.INVALID_INPUT_DATA,h.error.message,d));let p=_e._sanitize(l);const x={amount:p===null?0:p,scale:c};return ke.ok(new _e(x,p===null,o))}static createFromFormattedValue(r,o={}){if(r===null||r==="")return _e.create({amount:null,scale:_e.DEFAULT_SCALE});const l=String(r),[c,d]=l.split(",");let h=c,p=2;return d===void 0?p=0:(d===""&&(h=c+d.padEnd(1,"0"),p=1),d.length===1?(h=c+d.padEnd(1,"0"),p=1):d.length===2&&(h=c+d.padEnd(2,"0"),p=2)),_e.create({amount:h,scale:p},o)}static _sanitize(r){let o=null;return typeof r=="string"?o=parseInt(r,10):o=r,o}static _toString(r,o){if(r===null)return"";const l=Math.pow(10,o);return(Number(r)/l).toFixed(o)}get amount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}get scale(){var r;return Number((r=this.props)==null?void 0:r.scale)}getAmount(){var r;return this.isNull()?null:Number((r=this.props)==null?void 0:r.amount)}getScale(){var r;return this.isNull()?0:Number((r=this.props)==null?void 0:r.scale)}toString(){return _e._toString(this.amount,this.scale)}toNumber(){return this.isNull()?0:Number(this.toString())}toFormat(){return this._isNull?"":Intl.NumberFormat("es-ES",{maximumFractionDigits:2}).format(this.toNumber())}toPrimitive(){return this.scale!==_e.DEFAULT_SCALE?this.convertScale(_e.DEFAULT_SCALE).toPrimitive():this.amount}toPrimitives(){return this.toObject()}toObject(){return{amount:this.amount,scale:this.scale}}convertScale(r){if(r<_e.MIN_SCALE||r>_e.MAX_SCALE)throw new Error(`Scale out of range: ${r}`);if(this.isNull())return new _e({amount:null,scale:r},!0,this._options);const o=Math.pow(10,this.scale),l=Number(this.amount)/o,c=Math.pow(10,r),d=Math.round(l*c);return new _e({amount:d,scale:r},!1,this._options)}hasSameScale(r){return this.scale===r.scale}increment(r){return this.isNull()?r?_e.create(r.toObject()):_e.create():r?this.hasSameScale(r)?_e.create({amount:Number(this.amount)+Number(r.amount),scale:this.scale},this._options):ke.fail(Error("No se pueden sumar cantidades con diferentes escalas.")):_e.create({amount:Number(this.amount)+1,scale:this.scale},this._options)}decrement(r){return this.isNull()?r?_e.create(r.toObject()):_e.create():r?this.hasSameScale(r)?_e.create({amount:Number(this.amount)-Number(r.amount),scale:this.scale},this._options):ke.fail(Error("No se pueden restar cantidades con diferentes escalas.")):_e.create({amount:Number(this.amount)-1,scale:this.scale},this._options)}};Se(_e,"DEFAULT_SCALE",bd),Se(_e,"MIN_SCALE",0),Se(_e,"MAX_SCALE",2);let xn=_e;const Cc=2;class ab extends Tt{static create(a){const{amount:r,currencyCode:o,scale:l=Cc}=a,c=Tt.create({amount:r,currencyCode:o,scale:l});if(c.isFailure)return c;const d=c.object.convertScale(Cc);return ke.ok(d)}}class Zn extends V_{constructor(){super(...arguments);Se(this,"isValid",()=>!isNaN(this.props.valueOf())&&this.props.valueOf()!==0);Se(this,"isEmpty",()=>!this.isValid());Se(this,"toISO8601",()=>this.isValid()?this.props.toISOString():"");Se(this,"toDateString",()=>this.isValid()?this.props.toDateString():"");Se(this,"toLocaleDateString",(r,o)=>this.isValid()?this.props.toLocaleDateString(r,o):"");Se(this,"toLocaleTimeString",()=>this.isValid()?this.props.toLocaleTimeString():"")}static validate(r,o){const l=Pe.RULE_ALLOW_EMPTY.default(0),c=Nt.date().label(String(o.label)),d=Nt.alternatives(l,c);return Pe.validate(d,r)}static createCurrentDate(){return ke.ok(new Zn(new Date))}static create(r,o={}){const l={...o,dateFormat:o.dateFormat?o.dateFormat:"YYYY-MM-DD",label:o.label?o.label:"date"},c=Zn.validate(r,l);return c.isFailure?ke.fail(Jn(er.INVALID_INPUT_DATA,c.error.message,l)):ke.ok(new Zn(new Date(c.object)))}toString(){if(!this.isEmpty()){const r=this.props.getFullYear(),o=String(this.props.getMonth()+1).padStart(2,"0"),l=String(this.props.getDate()).padStart(2,"0");return`${r}-${o}-${l}`}return""}toPrimitive(){return this.toISO8601()}}const ob=({isPending:n,interval:a=1e3,onInterval:r})=>{const[o,l]=M.useState(void 0);return M.useEffect(()=>{let c;return n&&(c=setInterval(()=>{l(d=>d===void 0?a:d+a)},a)),()=>{clearInterval(c),l(void 0)}},[n,a]),M.useEffect(()=>{r&&o&&r(o)},[o]),{elapsedTime:o}},lb=2*60*1e3,ub=60*1e3,No=({queryKey:n,queryFn:a,enabled:r,select:o,queryOptions:l={},overtimeOptions:c})=>{const[d,h]=M.useState(!1),p=Mc({queryKey:n,queryFn:a,placeholderData:Dc,staleTime:ub,refetchInterval:lb,refetchOnWindowFocus:!0,enabled:r&&!!a,select:o,...l});M.useEffect(()=>{p.isSuccess&&eb(p.data)&&h(p.data.total_items===0)},[p]);const{elapsedTime:x}=ob({isPending:p.isFetching,interval:c==null?void 0:c.interval,onInterval:c==null?void 0:c.onInterval});return{...p,overtime:{elapsedTime:x},isEmpty:d}},wd=n=>Mc({placeholderData:Dc,...n});function cb(n){return en({...n})}/** - * table-core - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function db(){return{accessor:(n,a)=>typeof n=="function"?{...a,accessorFn:n}:{...a,accessorKey:n},display:n=>n,group:n=>n}}function gn(n,a){return typeof n=="function"?n(a):n}function xt(n,a){return r=>{a.setState(o=>({...o,[n]:gn(r,o[n])}))}}function rs(n){return n instanceof Function}function fb(n){return Array.isArray(n)&&n.every(a=>typeof a=="number")}function gb(n,a){const r=[],o=l=>{l.forEach(c=>{r.push(c);const d=a(c);d!=null&&d.length&&o(d)})};return o(n),r}function Z(n,a,r){let o=[],l;return c=>{let d;r.key&&r.debug&&(d=Date.now());const h=n(c);if(!(h.length!==o.length||h.some((v,R)=>o[R]!==v)))return l;o=h;let x;if(r.key&&r.debug&&(x=Date.now()),l=a(...h),r==null||r.onChange==null||r.onChange(l),r.key&&r.debug&&r!=null&&r.debug()){const v=Math.round((Date.now()-d)*100)/100,R=Math.round((Date.now()-x)*100)/100,y=R/16,b=(E,j)=>{for(E=String(E);E.length{var l;return(l=n==null?void 0:n.debugAll)!=null?l:n[a]},key:!1,onChange:o}}function mb(n,a,r,o){const l=()=>{var d;return(d=c.getValue())!=null?d:n.options.renderFallbackValue},c={id:`${a.id}_${r.id}`,row:a,column:r,getValue:()=>a.getValue(o),renderValue:l,getContext:Z(()=>[n,r,a,c],(d,h,p,x)=>({table:d,column:h,row:p,cell:x,getValue:x.getValue,renderValue:x.renderValue}),J(n.options,"debugCells"))};return n._features.forEach(d=>{d.createCell==null||d.createCell(c,r,a,n)},{}),c}function hb(n,a,r,o){var l,c;const h={...n._getDefaultColumnDef(),...a},p=h.accessorKey;let x=(l=(c=h.id)!=null?c:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?l:typeof h.header=="string"?h.header:void 0,v;if(h.accessorFn?v=h.accessorFn:p&&(p.includes(".")?v=y=>{let b=y;for(const j of p.split(".")){var E;b=(E=b)==null?void 0:E[j]}return b}:v=y=>y[h.accessorKey]),!x)throw new Error;let R={id:`${String(x)}`,accessorFn:v,parent:o,depth:r,columnDef:h,columns:[],getFlatColumns:Z(()=>[!0],()=>{var y;return[R,...(y=R.columns)==null?void 0:y.flatMap(b=>b.getFlatColumns())]},J(n.options,"debugColumns")),getLeafColumns:Z(()=>[n._getOrderColumnsFn()],y=>{var b;if((b=R.columns)!=null&&b.length){let E=R.columns.flatMap(j=>j.getLeafColumns());return y(E)}return[R]},J(n.options,"debugColumns"))};for(const y of n._features)y.createColumn==null||y.createColumn(R,n);return R}const Xe="debugHeaders";function yc(n,a,r){var o;let c={id:(o=r.id)!=null?o:a.id,column:a,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const d=[],h=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(h),d.push(p)};return h(c),d},getContext:()=>({table:n,header:c,column:a})};return n._features.forEach(d=>{d.createHeader==null||d.createHeader(c,n)}),c}const pb={createTable:n=>{n.getHeaderGroups=Z(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(a,r,o,l)=>{var c,d;const h=(c=o==null?void 0:o.map(R=>r.find(y=>y.id===R)).filter(Boolean))!=null?c:[],p=(d=l==null?void 0:l.map(R=>r.find(y=>y.id===R)).filter(Boolean))!=null?d:[],x=r.filter(R=>!(o!=null&&o.includes(R.id))&&!(l!=null&&l.includes(R.id)));return qi(a,[...h,...x,...p],n)},J(n.options,Xe)),n.getCenterHeaderGroups=Z(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(a,r,o,l)=>(r=r.filter(c=>!(o!=null&&o.includes(c.id))&&!(l!=null&&l.includes(c.id))),qi(a,r,n,"center")),J(n.options,Xe)),n.getLeftHeaderGroups=Z(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(a,r,o)=>{var l;const c=(l=o==null?void 0:o.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(a,c,n,"left")},J(n.options,Xe)),n.getRightHeaderGroups=Z(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(a,r,o)=>{var l;const c=(l=o==null?void 0:o.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(a,c,n,"right")},J(n.options,Xe)),n.getFooterGroups=Z(()=>[n.getHeaderGroups()],a=>[...a].reverse(),J(n.options,Xe)),n.getLeftFooterGroups=Z(()=>[n.getLeftHeaderGroups()],a=>[...a].reverse(),J(n.options,Xe)),n.getCenterFooterGroups=Z(()=>[n.getCenterHeaderGroups()],a=>[...a].reverse(),J(n.options,Xe)),n.getRightFooterGroups=Z(()=>[n.getRightHeaderGroups()],a=>[...a].reverse(),J(n.options,Xe)),n.getFlatHeaders=Z(()=>[n.getHeaderGroups()],a=>a.map(r=>r.headers).flat(),J(n.options,Xe)),n.getLeftFlatHeaders=Z(()=>[n.getLeftHeaderGroups()],a=>a.map(r=>r.headers).flat(),J(n.options,Xe)),n.getCenterFlatHeaders=Z(()=>[n.getCenterHeaderGroups()],a=>a.map(r=>r.headers).flat(),J(n.options,Xe)),n.getRightFlatHeaders=Z(()=>[n.getRightHeaderGroups()],a=>a.map(r=>r.headers).flat(),J(n.options,Xe)),n.getCenterLeafHeaders=Z(()=>[n.getCenterFlatHeaders()],a=>a.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),J(n.options,Xe)),n.getLeftLeafHeaders=Z(()=>[n.getLeftFlatHeaders()],a=>a.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),J(n.options,Xe)),n.getRightLeafHeaders=Z(()=>[n.getRightFlatHeaders()],a=>a.filter(r=>{var o;return!((o=r.subHeaders)!=null&&o.length)}),J(n.options,Xe)),n.getLeafHeaders=Z(()=>[n.getLeftHeaderGroups(),n.getCenterHeaderGroups(),n.getRightHeaderGroups()],(a,r,o)=>{var l,c,d,h,p,x;return[...(l=(c=a[0])==null?void 0:c.headers)!=null?l:[],...(d=(h=r[0])==null?void 0:h.headers)!=null?d:[],...(p=(x=o[0])==null?void 0:x.headers)!=null?p:[]].map(v=>v.getLeafHeaders()).flat()},J(n.options,Xe))}};function qi(n,a,r,o){var l,c;let d=0;const h=function(y,b){b===void 0&&(b=1),d=Math.max(d,b),y.filter(E=>E.getIsVisible()).forEach(E=>{var j;(j=E.columns)!=null&&j.length&&h(E.columns,b+1)},0)};h(n);let p=[];const x=(y,b)=>{const E={depth:b,id:[o,`${b}`].filter(Boolean).join("_"),headers:[]},j=[];y.forEach(D=>{const F=[...j].reverse()[0],q=D.column.depth===E.depth;let $,Q=!1;if(q&&D.column.parent?$=D.column.parent:($=D.column,Q=!0),F&&(F==null?void 0:F.column)===$)F.subHeaders.push(D);else{const O=yc(r,$,{id:[o,b,$.id,D==null?void 0:D.id].filter(Boolean).join("_"),isPlaceholder:Q,placeholderId:Q?`${j.filter(k=>k.column===$).length}`:void 0,depth:b,index:j.length});O.subHeaders.push(D),j.push(O)}E.headers.push(D),D.headerGroup=E}),p.push(E),b>0&&x(j,b-1)},v=a.map((y,b)=>yc(r,y,{depth:d,index:b}));x(v,d-1),p.reverse();const R=y=>y.filter(E=>E.column.getIsVisible()).map(E=>{let j=0,D=0,F=[0];E.subHeaders&&E.subHeaders.length?(F=[],R(E.subHeaders).forEach($=>{let{colSpan:Q,rowSpan:O}=$;j+=Q,F.push(O)})):j=1;const q=Math.min(...F);return D=D+q,E.colSpan=j,E.rowSpan=D,{colSpan:j,rowSpan:D}});return R((l=(c=p[0])==null?void 0:c.headers)!=null?l:[]),p}const Ro=(n,a,r,o,l,c,d)=>{let h={id:a,index:o,original:r,depth:l,parentId:d,_valuesCache:{},_uniqueValuesCache:{},getValue:p=>{if(h._valuesCache.hasOwnProperty(p))return h._valuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return h._valuesCache[p]=x.accessorFn(h.original,o),h._valuesCache[p]},getUniqueValues:p=>{if(h._uniqueValuesCache.hasOwnProperty(p))return h._uniqueValuesCache[p];const x=n.getColumn(p);if(x!=null&&x.accessorFn)return x.columnDef.getUniqueValues?(h._uniqueValuesCache[p]=x.columnDef.getUniqueValues(h.original,o),h._uniqueValuesCache[p]):(h._uniqueValuesCache[p]=[h.getValue(p)],h._uniqueValuesCache[p])},renderValue:p=>{var x;return(x=h.getValue(p))!=null?x:n.options.renderFallbackValue},subRows:[],getLeafRows:()=>gb(h.subRows,p=>p.subRows),getParentRow:()=>h.parentId?n.getRow(h.parentId,!0):void 0,getParentRows:()=>{let p=[],x=h;for(;;){const v=x.getParentRow();if(!v)break;p.push(v),x=v}return p.reverse()},getAllCells:Z(()=>[n.getAllLeafColumns()],p=>p.map(x=>mb(n,h,x,x.id)),J(n.options,"debugRows")),_getAllCellsByColumnId:Z(()=>[h.getAllCells()],p=>p.reduce((x,v)=>(x[v.column.id]=v,x),{}),J(n.options,"debugRows"))};for(let p=0;p{n._getFacetedRowModel=a.options.getFacetedRowModel&&a.options.getFacetedRowModel(a,n.id),n.getFacetedRowModel=()=>n._getFacetedRowModel?n._getFacetedRowModel():a.getPreFilteredRowModel(),n._getFacetedUniqueValues=a.options.getFacetedUniqueValues&&a.options.getFacetedUniqueValues(a,n.id),n.getFacetedUniqueValues=()=>n._getFacetedUniqueValues?n._getFacetedUniqueValues():new Map,n._getFacetedMinMaxValues=a.options.getFacetedMinMaxValues&&a.options.getFacetedMinMaxValues(a,n.id),n.getFacetedMinMaxValues=()=>{if(n._getFacetedMinMaxValues)return n._getFacetedMinMaxValues()}}},Sd=(n,a,r)=>{var o,l;const c=r==null||(o=r.toString())==null?void 0:o.toLowerCase();return!!(!((l=n.getValue(a))==null||(l=l.toString())==null||(l=l.toLowerCase())==null)&&l.includes(c))};Sd.autoRemove=n=>Lt(n);const jd=(n,a,r)=>{var o;return!!(!((o=n.getValue(a))==null||(o=o.toString())==null)&&o.includes(r))};jd.autoRemove=n=>Lt(n);const Cd=(n,a,r)=>{var o;return((o=n.getValue(a))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(r==null?void 0:r.toLowerCase())};Cd.autoRemove=n=>Lt(n);const yd=(n,a,r)=>{var o;return(o=n.getValue(a))==null?void 0:o.includes(r)};yd.autoRemove=n=>Lt(n);const Nd=(n,a,r)=>!r.some(o=>{var l;return!((l=n.getValue(a))!=null&&l.includes(o))});Nd.autoRemove=n=>Lt(n)||!(n!=null&&n.length);const Rd=(n,a,r)=>r.some(o=>{var l;return(l=n.getValue(a))==null?void 0:l.includes(o)});Rd.autoRemove=n=>Lt(n)||!(n!=null&&n.length);const Ed=(n,a,r)=>n.getValue(a)===r;Ed.autoRemove=n=>Lt(n);const Ad=(n,a,r)=>n.getValue(a)==r;Ad.autoRemove=n=>Lt(n);const Eo=(n,a,r)=>{let[o,l]=r;const c=n.getValue(a);return c>=o&&c<=l};Eo.resolveFilterValue=n=>{let[a,r]=n,o=typeof a!="number"?parseFloat(a):a,l=typeof r!="number"?parseFloat(r):r,c=a===null||Number.isNaN(o)?-1/0:o,d=r===null||Number.isNaN(l)?1/0:l;if(c>d){const h=c;c=d,d=h}return[c,d]};Eo.autoRemove=n=>Lt(n)||Lt(n[0])&&Lt(n[1]);const Zt={includesString:Sd,includesStringSensitive:jd,equalsString:Cd,arrIncludes:yd,arrIncludesAll:Nd,arrIncludesSome:Rd,equals:Ed,weakEquals:Ad,inNumberRange:Eo};function Lt(n){return n==null||n===""}const vb={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:n=>({columnFilters:[],...n}),getDefaultOptions:n=>({onColumnFiltersChange:xt("columnFilters",n),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(n,a)=>{n.getAutoFilterFn=()=>{const r=a.getCoreRowModel().flatRows[0],o=r==null?void 0:r.getValue(n.id);return typeof o=="string"?Zt.includesString:typeof o=="number"?Zt.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Zt.equals:Array.isArray(o)?Zt.arrIncludes:Zt.weakEquals},n.getFilterFn=()=>{var r,o;return rs(n.columnDef.filterFn)?n.columnDef.filterFn:n.columnDef.filterFn==="auto"?n.getAutoFilterFn():(r=(o=a.options.filterFns)==null?void 0:o[n.columnDef.filterFn])!=null?r:Zt[n.columnDef.filterFn]},n.getCanFilter=()=>{var r,o,l;return((r=n.columnDef.enableColumnFilter)!=null?r:!0)&&((o=a.options.enableColumnFilters)!=null?o:!0)&&((l=a.options.enableFilters)!=null?l:!0)&&!!n.accessorFn},n.getIsFiltered=()=>n.getFilterIndex()>-1,n.getFilterValue=()=>{var r;return(r=a.getState().columnFilters)==null||(r=r.find(o=>o.id===n.id))==null?void 0:r.value},n.getFilterIndex=()=>{var r,o;return(r=(o=a.getState().columnFilters)==null?void 0:o.findIndex(l=>l.id===n.id))!=null?r:-1},n.setFilterValue=r=>{a.setColumnFilters(o=>{const l=n.getFilterFn(),c=o==null?void 0:o.find(v=>v.id===n.id),d=gn(r,c?c.value:void 0);if(Nc(l,d,n)){var h;return(h=o==null?void 0:o.filter(v=>v.id!==n.id))!=null?h:[]}const p={id:n.id,value:d};if(c){var x;return(x=o==null?void 0:o.map(v=>v.id===n.id?p:v))!=null?x:[]}return o!=null&&o.length?[...o,p]:[p]})}},createRow:(n,a)=>{n.columnFilters={},n.columnFiltersMeta={}},createTable:n=>{n.setColumnFilters=a=>{const r=n.getAllLeafColumns(),o=l=>{var c;return(c=gn(a,l))==null?void 0:c.filter(d=>{const h=r.find(p=>p.id===d.id);if(h){const p=h.getFilterFn();if(Nc(p,d.value,h))return!1}return!0})};n.options.onColumnFiltersChange==null||n.options.onColumnFiltersChange(o)},n.resetColumnFilters=a=>{var r,o;n.setColumnFilters(a?[]:(r=(o=n.initialState)==null?void 0:o.columnFilters)!=null?r:[])},n.getPreFilteredRowModel=()=>n.getCoreRowModel(),n.getFilteredRowModel=()=>(!n._getFilteredRowModel&&n.options.getFilteredRowModel&&(n._getFilteredRowModel=n.options.getFilteredRowModel(n)),n.options.manualFiltering||!n._getFilteredRowModel?n.getPreFilteredRowModel():n._getFilteredRowModel())}};function Nc(n,a,r){return(n&&n.autoRemove?n.autoRemove(a,r):!1)||typeof a>"u"||typeof a=="string"&&!a}const _b=(n,a,r)=>r.reduce((o,l)=>{const c=l.getValue(n);return o+(typeof c=="number"?c:0)},0),bb=(n,a,r)=>{let o;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(o>c||o===void 0&&c>=c)&&(o=c)}),o},wb=(n,a,r)=>{let o;return r.forEach(l=>{const c=l.getValue(n);c!=null&&(o=c)&&(o=c)}),o},Sb=(n,a,r)=>{let o,l;return r.forEach(c=>{const d=c.getValue(n);d!=null&&(o===void 0?d>=d&&(o=l=d):(o>d&&(o=d),l{let r=0,o=0;if(a.forEach(l=>{let c=l.getValue(n);c!=null&&(c=+c)>=c&&(++r,o+=c)}),r)return o/r},Cb=(n,a)=>{if(!a.length)return;const r=a.map(c=>c.getValue(n));if(!fb(r))return;if(r.length===1)return r[0];const o=Math.floor(r.length/2),l=r.sort((c,d)=>c-d);return r.length%2!==0?l[o]:(l[o-1]+l[o])/2},yb=(n,a)=>Array.from(new Set(a.map(r=>r.getValue(n))).values()),Nb=(n,a)=>new Set(a.map(r=>r.getValue(n))).size,Rb=(n,a)=>a.length,Oa={sum:_b,min:bb,max:wb,extent:Sb,mean:jb,median:Cb,unique:yb,uniqueCount:Nb,count:Rb},Eb={getDefaultColumnDef:()=>({aggregatedCell:n=>{var a,r;return(a=(r=n.getValue())==null||r.toString==null?void 0:r.toString())!=null?a:null},aggregationFn:"auto"}),getInitialState:n=>({grouping:[],...n}),getDefaultOptions:n=>({onGroupingChange:xt("grouping",n),groupedColumnMode:"reorder"}),createColumn:(n,a)=>{n.toggleGrouping=()=>{a.setGrouping(r=>r!=null&&r.includes(n.id)?r.filter(o=>o!==n.id):[...r??[],n.id])},n.getCanGroup=()=>{var r,o;return((r=n.columnDef.enableGrouping)!=null?r:!0)&&((o=a.options.enableGrouping)!=null?o:!0)&&(!!n.accessorFn||!!n.columnDef.getGroupingValue)},n.getIsGrouped=()=>{var r;return(r=a.getState().grouping)==null?void 0:r.includes(n.id)},n.getGroupedIndex=()=>{var r;return(r=a.getState().grouping)==null?void 0:r.indexOf(n.id)},n.getToggleGroupingHandler=()=>{const r=n.getCanGroup();return()=>{r&&n.toggleGrouping()}},n.getAutoAggregationFn=()=>{const r=a.getCoreRowModel().flatRows[0],o=r==null?void 0:r.getValue(n.id);if(typeof o=="number")return Oa.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Oa.extent},n.getAggregationFn=()=>{var r,o;if(!n)throw new Error;return rs(n.columnDef.aggregationFn)?n.columnDef.aggregationFn:n.columnDef.aggregationFn==="auto"?n.getAutoAggregationFn():(r=(o=a.options.aggregationFns)==null?void 0:o[n.columnDef.aggregationFn])!=null?r:Oa[n.columnDef.aggregationFn]}},createTable:n=>{n.setGrouping=a=>n.options.onGroupingChange==null?void 0:n.options.onGroupingChange(a),n.resetGrouping=a=>{var r,o;n.setGrouping(a?[]:(r=(o=n.initialState)==null?void 0:o.grouping)!=null?r:[])},n.getPreGroupedRowModel=()=>n.getFilteredRowModel(),n.getGroupedRowModel=()=>(!n._getGroupedRowModel&&n.options.getGroupedRowModel&&(n._getGroupedRowModel=n.options.getGroupedRowModel(n)),n.options.manualGrouping||!n._getGroupedRowModel?n.getPreGroupedRowModel():n._getGroupedRowModel())},createRow:(n,a)=>{n.getIsGrouped=()=>!!n.groupingColumnId,n.getGroupingValue=r=>{if(n._groupingValuesCache.hasOwnProperty(r))return n._groupingValuesCache[r];const o=a.getColumn(r);return o!=null&&o.columnDef.getGroupingValue?(n._groupingValuesCache[r]=o.columnDef.getGroupingValue(n.original),n._groupingValuesCache[r]):n.getValue(r)},n._groupingValuesCache={}},createCell:(n,a,r,o)=>{n.getIsGrouped=()=>a.getIsGrouped()&&a.id===r.groupingColumnId,n.getIsPlaceholder=()=>!n.getIsGrouped()&&a.getIsGrouped(),n.getIsAggregated=()=>{var l;return!n.getIsGrouped()&&!n.getIsPlaceholder()&&!!((l=r.subRows)!=null&&l.length)}}};function Ab(n,a,r){if(!(a!=null&&a.length)||!r)return n;const o=n.filter(c=>!a.includes(c.id));return r==="remove"?o:[...a.map(c=>n.find(d=>d.id===c)).filter(Boolean),...o]}const Ib={getInitialState:n=>({columnOrder:[],...n}),getDefaultOptions:n=>({onColumnOrderChange:xt("columnOrder",n)}),createColumn:(n,a)=>{n.getIndex=Z(r=>[kr(a,r)],r=>r.findIndex(o=>o.id===n.id),J(a.options,"debugColumns")),n.getIsFirstColumn=r=>{var o;return((o=kr(a,r)[0])==null?void 0:o.id)===n.id},n.getIsLastColumn=r=>{var o;const l=kr(a,r);return((o=l[l.length-1])==null?void 0:o.id)===n.id}},createTable:n=>{n.setColumnOrder=a=>n.options.onColumnOrderChange==null?void 0:n.options.onColumnOrderChange(a),n.resetColumnOrder=a=>{var r;n.setColumnOrder(a?[]:(r=n.initialState.columnOrder)!=null?r:[])},n._getOrderColumnsFn=Z(()=>[n.getState().columnOrder,n.getState().grouping,n.options.groupedColumnMode],(a,r,o)=>l=>{let c=[];if(!(a!=null&&a.length))c=l;else{const d=[...a],h=[...l];for(;h.length&&d.length;){const p=d.shift(),x=h.findIndex(v=>v.id===p);x>-1&&c.push(h.splice(x,1)[0])}c=[...c,...h]}return Ab(c,r,o)},J(n.options,"debugTable"))}},Pa=()=>({left:[],right:[]}),Fb={getInitialState:n=>({columnPinning:Pa(),...n}),getDefaultOptions:n=>({onColumnPinningChange:xt("columnPinning",n)}),createColumn:(n,a)=>{n.pin=r=>{const o=n.getLeafColumns().map(l=>l.id).filter(Boolean);a.setColumnPinning(l=>{var c,d;if(r==="right"){var h,p;return{left:((h=l==null?void 0:l.left)!=null?h:[]).filter(R=>!(o!=null&&o.includes(R))),right:[...((p=l==null?void 0:l.right)!=null?p:[]).filter(R=>!(o!=null&&o.includes(R))),...o]}}if(r==="left"){var x,v;return{left:[...((x=l==null?void 0:l.left)!=null?x:[]).filter(R=>!(o!=null&&o.includes(R))),...o],right:((v=l==null?void 0:l.right)!=null?v:[]).filter(R=>!(o!=null&&o.includes(R)))}}return{left:((c=l==null?void 0:l.left)!=null?c:[]).filter(R=>!(o!=null&&o.includes(R))),right:((d=l==null?void 0:l.right)!=null?d:[]).filter(R=>!(o!=null&&o.includes(R)))}})},n.getCanPin=()=>n.getLeafColumns().some(o=>{var l,c,d;return((l=o.columnDef.enablePinning)!=null?l:!0)&&((c=(d=a.options.enableColumnPinning)!=null?d:a.options.enablePinning)!=null?c:!0)}),n.getIsPinned=()=>{const r=n.getLeafColumns().map(h=>h.id),{left:o,right:l}=a.getState().columnPinning,c=r.some(h=>o==null?void 0:o.includes(h)),d=r.some(h=>l==null?void 0:l.includes(h));return c?"left":d?"right":!1},n.getPinnedIndex=()=>{var r,o;const l=n.getIsPinned();return l?(r=(o=a.getState().columnPinning)==null||(o=o[l])==null?void 0:o.indexOf(n.id))!=null?r:-1:0}},createRow:(n,a)=>{n.getCenterVisibleCells=Z(()=>[n._getAllVisibleCells(),a.getState().columnPinning.left,a.getState().columnPinning.right],(r,o,l)=>{const c=[...o??[],...l??[]];return r.filter(d=>!c.includes(d.column.id))},J(a.options,"debugRows")),n.getLeftVisibleCells=Z(()=>[n._getAllVisibleCells(),a.getState().columnPinning.left],(r,o)=>(o??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"left"})),J(a.options,"debugRows")),n.getRightVisibleCells=Z(()=>[n._getAllVisibleCells(),a.getState().columnPinning.right],(r,o)=>(o??[]).map(c=>r.find(d=>d.column.id===c)).filter(Boolean).map(c=>({...c,position:"right"})),J(a.options,"debugRows"))},createTable:n=>{n.setColumnPinning=a=>n.options.onColumnPinningChange==null?void 0:n.options.onColumnPinningChange(a),n.resetColumnPinning=a=>{var r,o;return n.setColumnPinning(a?Pa():(r=(o=n.initialState)==null?void 0:o.columnPinning)!=null?r:Pa())},n.getIsSomeColumnsPinned=a=>{var r;const o=n.getState().columnPinning;if(!a){var l,c;return!!((l=o.left)!=null&&l.length||(c=o.right)!=null&&c.length)}return!!((r=o[a])!=null&&r.length)},n.getLeftLeafColumns=Z(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left],(a,r)=>(r??[]).map(o=>a.find(l=>l.id===o)).filter(Boolean),J(n.options,"debugColumns")),n.getRightLeafColumns=Z(()=>[n.getAllLeafColumns(),n.getState().columnPinning.right],(a,r)=>(r??[]).map(o=>a.find(l=>l.id===o)).filter(Boolean),J(n.options,"debugColumns")),n.getCenterLeafColumns=Z(()=>[n.getAllLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(a,r,o)=>{const l=[...r??[],...o??[]];return a.filter(c=>!l.includes(c.id))},J(n.options,"debugColumns"))}},$i={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},ka=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),Mb={getDefaultColumnDef:()=>$i,getInitialState:n=>({columnSizing:{},columnSizingInfo:ka(),...n}),getDefaultOptions:n=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:xt("columnSizing",n),onColumnSizingInfoChange:xt("columnSizingInfo",n)}),createColumn:(n,a)=>{n.getSize=()=>{var r,o,l;const c=a.getState().columnSizing[n.id];return Math.min(Math.max((r=n.columnDef.minSize)!=null?r:$i.minSize,(o=c??n.columnDef.size)!=null?o:$i.size),(l=n.columnDef.maxSize)!=null?l:$i.maxSize)},n.getStart=Z(r=>[r,kr(a,r),a.getState().columnSizing],(r,o)=>o.slice(0,n.getIndex(r)).reduce((l,c)=>l+c.getSize(),0),J(a.options,"debugColumns")),n.getAfter=Z(r=>[r,kr(a,r),a.getState().columnSizing],(r,o)=>o.slice(n.getIndex(r)+1).reduce((l,c)=>l+c.getSize(),0),J(a.options,"debugColumns")),n.resetSize=()=>{a.setColumnSizing(r=>{let{[n.id]:o,...l}=r;return l})},n.getCanResize=()=>{var r,o;return((r=n.columnDef.enableResizing)!=null?r:!0)&&((o=a.options.enableColumnResizing)!=null?o:!0)},n.getIsResizing=()=>a.getState().columnSizingInfo.isResizingColumn===n.id},createHeader:(n,a)=>{n.getSize=()=>{let r=0;const o=l=>{if(l.subHeaders.length)l.subHeaders.forEach(o);else{var c;r+=(c=l.column.getSize())!=null?c:0}};return o(n),r},n.getStart=()=>{if(n.index>0){const r=n.headerGroup.headers[n.index-1];return r.getStart()+r.getSize()}return 0},n.getResizeHandler=r=>{const o=a.getColumn(n.column.id),l=o==null?void 0:o.getCanResize();return c=>{if(!o||!l||(c.persist==null||c.persist(),qa(c)&&c.touches&&c.touches.length>1))return;const d=n.getSize(),h=n?n.getLeafHeaders().map(F=>[F.column.id,F.column.getSize()]):[[o.id,o.getSize()]],p=qa(c)?Math.round(c.touches[0].clientX):c.clientX,x={},v=(F,q)=>{typeof q=="number"&&(a.setColumnSizingInfo($=>{var Q,O;const k=a.options.columnResizeDirection==="rtl"?-1:1,H=(q-((Q=$==null?void 0:$.startOffset)!=null?Q:0))*k,W=Math.max(H/((O=$==null?void 0:$.startSize)!=null?O:0),-.999999);return $.columnSizingStart.forEach(B=>{let[se,ce]=B;x[se]=Math.round(Math.max(ce+ce*W,0)*100)/100}),{...$,deltaOffset:H,deltaPercentage:W}}),(a.options.columnResizeMode==="onChange"||F==="end")&&a.setColumnSizing($=>({...$,...x})))},R=F=>v("move",F),y=F=>{v("end",F),a.setColumnSizingInfo(q=>({...q,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=r||typeof document<"u"?document:null,E={moveHandler:F=>R(F.clientX),upHandler:F=>{b==null||b.removeEventListener("mousemove",E.moveHandler),b==null||b.removeEventListener("mouseup",E.upHandler),y(F.clientX)}},j={moveHandler:F=>(F.cancelable&&(F.preventDefault(),F.stopPropagation()),R(F.touches[0].clientX),!1),upHandler:F=>{var q;b==null||b.removeEventListener("touchmove",j.moveHandler),b==null||b.removeEventListener("touchend",j.upHandler),F.cancelable&&(F.preventDefault(),F.stopPropagation()),y((q=F.touches[0])==null?void 0:q.clientX)}},D=Db()?{passive:!1}:!1;qa(c)?(b==null||b.addEventListener("touchmove",j.moveHandler,D),b==null||b.addEventListener("touchend",j.upHandler,D)):(b==null||b.addEventListener("mousemove",E.moveHandler,D),b==null||b.addEventListener("mouseup",E.upHandler,D)),a.setColumnSizingInfo(F=>({...F,startOffset:p,startSize:d,deltaOffset:0,deltaPercentage:0,columnSizingStart:h,isResizingColumn:o.id}))}}},createTable:n=>{n.setColumnSizing=a=>n.options.onColumnSizingChange==null?void 0:n.options.onColumnSizingChange(a),n.setColumnSizingInfo=a=>n.options.onColumnSizingInfoChange==null?void 0:n.options.onColumnSizingInfoChange(a),n.resetColumnSizing=a=>{var r;n.setColumnSizing(a?{}:(r=n.initialState.columnSizing)!=null?r:{})},n.resetHeaderSizeInfo=a=>{var r;n.setColumnSizingInfo(a?ka():(r=n.initialState.columnSizingInfo)!=null?r:ka())},n.getTotalSize=()=>{var a,r;return(a=(r=n.getHeaderGroups()[0])==null?void 0:r.headers.reduce((o,l)=>o+l.getSize(),0))!=null?a:0},n.getLeftTotalSize=()=>{var a,r;return(a=(r=n.getLeftHeaderGroups()[0])==null?void 0:r.headers.reduce((o,l)=>o+l.getSize(),0))!=null?a:0},n.getCenterTotalSize=()=>{var a,r;return(a=(r=n.getCenterHeaderGroups()[0])==null?void 0:r.headers.reduce((o,l)=>o+l.getSize(),0))!=null?a:0},n.getRightTotalSize=()=>{var a,r;return(a=(r=n.getRightHeaderGroups()[0])==null?void 0:r.headers.reduce((o,l)=>o+l.getSize(),0))!=null?a:0}}};let zi=null;function Db(){if(typeof zi=="boolean")return zi;let n=!1;try{const a={get passive(){return n=!0,!1}},r=()=>{};window.addEventListener("test",r,a),window.removeEventListener("test",r)}catch{n=!1}return zi=n,zi}function qa(n){return n.type==="touchstart"}const Tb={getInitialState:n=>({columnVisibility:{},...n}),getDefaultOptions:n=>({onColumnVisibilityChange:xt("columnVisibility",n)}),createColumn:(n,a)=>{n.toggleVisibility=r=>{n.getCanHide()&&a.setColumnVisibility(o=>({...o,[n.id]:r??!n.getIsVisible()}))},n.getIsVisible=()=>{var r,o;const l=n.columns;return(r=l.length?l.some(c=>c.getIsVisible()):(o=a.getState().columnVisibility)==null?void 0:o[n.id])!=null?r:!0},n.getCanHide=()=>{var r,o;return((r=n.columnDef.enableHiding)!=null?r:!0)&&((o=a.options.enableHiding)!=null?o:!0)},n.getToggleVisibilityHandler=()=>r=>{n.toggleVisibility==null||n.toggleVisibility(r.target.checked)}},createRow:(n,a)=>{n._getAllVisibleCells=Z(()=>[n.getAllCells(),a.getState().columnVisibility],r=>r.filter(o=>o.column.getIsVisible()),J(a.options,"debugRows")),n.getVisibleCells=Z(()=>[n.getLeftVisibleCells(),n.getCenterVisibleCells(),n.getRightVisibleCells()],(r,o,l)=>[...r,...o,...l],J(a.options,"debugRows"))},createTable:n=>{const a=(r,o)=>Z(()=>[o(),o().filter(l=>l.getIsVisible()).map(l=>l.id).join("_")],l=>l.filter(c=>c.getIsVisible==null?void 0:c.getIsVisible()),J(n.options,"debugColumns"));n.getVisibleFlatColumns=a("getVisibleFlatColumns",()=>n.getAllFlatColumns()),n.getVisibleLeafColumns=a("getVisibleLeafColumns",()=>n.getAllLeafColumns()),n.getLeftVisibleLeafColumns=a("getLeftVisibleLeafColumns",()=>n.getLeftLeafColumns()),n.getRightVisibleLeafColumns=a("getRightVisibleLeafColumns",()=>n.getRightLeafColumns()),n.getCenterVisibleLeafColumns=a("getCenterVisibleLeafColumns",()=>n.getCenterLeafColumns()),n.setColumnVisibility=r=>n.options.onColumnVisibilityChange==null?void 0:n.options.onColumnVisibilityChange(r),n.resetColumnVisibility=r=>{var o;n.setColumnVisibility(r?{}:(o=n.initialState.columnVisibility)!=null?o:{})},n.toggleAllColumnsVisible=r=>{var o;r=(o=r)!=null?o:!n.getIsAllColumnsVisible(),n.setColumnVisibility(n.getAllLeafColumns().reduce((l,c)=>({...l,[c.id]:r||!(c.getCanHide!=null&&c.getCanHide())}),{}))},n.getIsAllColumnsVisible=()=>!n.getAllLeafColumns().some(r=>!(r.getIsVisible!=null&&r.getIsVisible())),n.getIsSomeColumnsVisible=()=>n.getAllLeafColumns().some(r=>r.getIsVisible==null?void 0:r.getIsVisible()),n.getToggleAllColumnsVisibilityHandler=()=>r=>{var o;n.toggleAllColumnsVisible((o=r.target)==null?void 0:o.checked)}}};function kr(n,a){return a?a==="center"?n.getCenterVisibleLeafColumns():a==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns()}const Lb={createTable:n=>{n._getGlobalFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,"__global__"),n.getGlobalFacetedRowModel=()=>n.options.manualFiltering||!n._getGlobalFacetedRowModel?n.getPreFilteredRowModel():n._getGlobalFacetedRowModel(),n._getGlobalFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,"__global__"),n.getGlobalFacetedUniqueValues=()=>n._getGlobalFacetedUniqueValues?n._getGlobalFacetedUniqueValues():new Map,n._getGlobalFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,"__global__"),n.getGlobalFacetedMinMaxValues=()=>{if(n._getGlobalFacetedMinMaxValues)return n._getGlobalFacetedMinMaxValues()}}},Ob={getInitialState:n=>({globalFilter:void 0,...n}),getDefaultOptions:n=>({onGlobalFilterChange:xt("globalFilter",n),globalFilterFn:"auto",getColumnCanGlobalFilter:a=>{var r;const o=(r=n.getCoreRowModel().flatRows[0])==null||(r=r._getAllCellsByColumnId()[a.id])==null?void 0:r.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(n,a)=>{n.getCanGlobalFilter=()=>{var r,o,l,c;return((r=n.columnDef.enableGlobalFilter)!=null?r:!0)&&((o=a.options.enableGlobalFilter)!=null?o:!0)&&((l=a.options.enableFilters)!=null?l:!0)&&((c=a.options.getColumnCanGlobalFilter==null?void 0:a.options.getColumnCanGlobalFilter(n))!=null?c:!0)&&!!n.accessorFn}},createTable:n=>{n.getGlobalAutoFilterFn=()=>Zt.includesString,n.getGlobalFilterFn=()=>{var a,r;const{globalFilterFn:o}=n.options;return rs(o)?o:o==="auto"?n.getGlobalAutoFilterFn():(a=(r=n.options.filterFns)==null?void 0:r[o])!=null?a:Zt[o]},n.setGlobalFilter=a=>{n.options.onGlobalFilterChange==null||n.options.onGlobalFilterChange(a)},n.resetGlobalFilter=a=>{n.setGlobalFilter(a?void 0:n.initialState.globalFilter)}}},Pb={getInitialState:n=>({expanded:{},...n}),getDefaultOptions:n=>({onExpandedChange:xt("expanded",n),paginateExpandedRows:!0}),createTable:n=>{let a=!1,r=!1;n._autoResetExpanded=()=>{var o,l;if(!a){n._queue(()=>{a=!0});return}if((o=(l=n.options.autoResetAll)!=null?l:n.options.autoResetExpanded)!=null?o:!n.options.manualExpanding){if(r)return;r=!0,n._queue(()=>{n.resetExpanded(),r=!1})}},n.setExpanded=o=>n.options.onExpandedChange==null?void 0:n.options.onExpandedChange(o),n.toggleAllRowsExpanded=o=>{o??!n.getIsAllRowsExpanded()?n.setExpanded(!0):n.setExpanded({})},n.resetExpanded=o=>{var l,c;n.setExpanded(o?{}:(l=(c=n.initialState)==null?void 0:c.expanded)!=null?l:{})},n.getCanSomeRowsExpand=()=>n.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),n.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),n.toggleAllRowsExpanded()},n.getIsSomeRowsExpanded=()=>{const o=n.getState().expanded;return o===!0||Object.values(o).some(Boolean)},n.getIsAllRowsExpanded=()=>{const o=n.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||n.getRowModel().flatRows.some(l=>!l.getIsExpanded()))},n.getExpandedDepth=()=>{let o=0;return(n.getState().expanded===!0?Object.keys(n.getRowModel().rowsById):Object.keys(n.getState().expanded)).forEach(c=>{const d=c.split(".");o=Math.max(o,d.length)}),o},n.getPreExpandedRowModel=()=>n.getSortedRowModel(),n.getExpandedRowModel=()=>(!n._getExpandedRowModel&&n.options.getExpandedRowModel&&(n._getExpandedRowModel=n.options.getExpandedRowModel(n)),n.options.manualExpanding||!n._getExpandedRowModel?n.getPreExpandedRowModel():n._getExpandedRowModel())},createRow:(n,a)=>{n.toggleExpanded=r=>{a.setExpanded(o=>{var l;const c=o===!0?!0:!!(o!=null&&o[n.id]);let d={};if(o===!0?Object.keys(a.getRowModel().rowsById).forEach(h=>{d[h]=!0}):d=o,r=(l=r)!=null?l:!c,!c&&r)return{...d,[n.id]:!0};if(c&&!r){const{[n.id]:h,...p}=d;return p}return o})},n.getIsExpanded=()=>{var r;const o=a.getState().expanded;return!!((r=a.options.getIsRowExpanded==null?void 0:a.options.getIsRowExpanded(n))!=null?r:o===!0||o!=null&&o[n.id])},n.getCanExpand=()=>{var r,o,l;return(r=a.options.getRowCanExpand==null?void 0:a.options.getRowCanExpand(n))!=null?r:((o=a.options.enableExpanding)!=null?o:!0)&&!!((l=n.subRows)!=null&&l.length)},n.getIsAllParentsExpanded=()=>{let r=!0,o=n;for(;r&&o.parentId;)o=a.getRow(o.parentId,!0),r=o.getIsExpanded();return r},n.getToggleExpandedHandler=()=>{const r=n.getCanExpand();return()=>{r&&n.toggleExpanded()}}}},Ya=0,Qa=10,$a=()=>({pageIndex:Ya,pageSize:Qa}),kb={getInitialState:n=>({...n,pagination:{...$a(),...n==null?void 0:n.pagination}}),getDefaultOptions:n=>({onPaginationChange:xt("pagination",n)}),createTable:n=>{let a=!1,r=!1;n._autoResetPageIndex=()=>{var o,l;if(!a){n._queue(()=>{a=!0});return}if((o=(l=n.options.autoResetAll)!=null?l:n.options.autoResetPageIndex)!=null?o:!n.options.manualPagination){if(r)return;r=!0,n._queue(()=>{n.resetPageIndex(),r=!1})}},n.setPagination=o=>{const l=c=>gn(o,c);return n.options.onPaginationChange==null?void 0:n.options.onPaginationChange(l)},n.resetPagination=o=>{var l;n.setPagination(o?$a():(l=n.initialState.pagination)!=null?l:$a())},n.setPageIndex=o=>{n.setPagination(l=>{let c=gn(o,l.pageIndex);const d=typeof n.options.pageCount>"u"||n.options.pageCount===-1?Number.MAX_SAFE_INTEGER:n.options.pageCount-1;return c=Math.max(0,Math.min(c,d)),{...l,pageIndex:c}})},n.resetPageIndex=o=>{var l,c;n.setPageIndex(o?Ya:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageIndex)!=null?l:Ya)},n.resetPageSize=o=>{var l,c;n.setPageSize(o?Qa:(l=(c=n.initialState)==null||(c=c.pagination)==null?void 0:c.pageSize)!=null?l:Qa)},n.setPageSize=o=>{n.setPagination(l=>{const c=Math.max(1,gn(o,l.pageSize)),d=l.pageSize*l.pageIndex,h=Math.floor(d/c);return{...l,pageIndex:h,pageSize:c}})},n.setPageCount=o=>n.setPagination(l=>{var c;let d=gn(o,(c=n.options.pageCount)!=null?c:-1);return typeof d=="number"&&(d=Math.max(-1,d)),{...l,pageCount:d}}),n.getPageOptions=Z(()=>[n.getPageCount()],o=>{let l=[];return o&&o>0&&(l=[...new Array(o)].fill(null).map((c,d)=>d)),l},J(n.options,"debugTable")),n.getCanPreviousPage=()=>n.getState().pagination.pageIndex>0,n.getCanNextPage=()=>{const{pageIndex:o}=n.getState().pagination,l=n.getPageCount();return l===-1?!0:l===0?!1:on.setPageIndex(o=>o-1),n.nextPage=()=>n.setPageIndex(o=>o+1),n.firstPage=()=>n.setPageIndex(0),n.lastPage=()=>n.setPageIndex(n.getPageCount()-1),n.getPrePaginationRowModel=()=>n.getExpandedRowModel(),n.getPaginationRowModel=()=>(!n._getPaginationRowModel&&n.options.getPaginationRowModel&&(n._getPaginationRowModel=n.options.getPaginationRowModel(n)),n.options.manualPagination||!n._getPaginationRowModel?n.getPrePaginationRowModel():n._getPaginationRowModel()),n.getPageCount=()=>{var o;return(o=n.options.pageCount)!=null?o:Math.ceil(n.getRowCount()/n.getState().pagination.pageSize)},n.getRowCount=()=>{var o;return(o=n.options.rowCount)!=null?o:n.getPrePaginationRowModel().rows.length}}},za=()=>({top:[],bottom:[]}),qb={getInitialState:n=>({rowPinning:za(),...n}),getDefaultOptions:n=>({onRowPinningChange:xt("rowPinning",n)}),createRow:(n,a)=>{n.pin=(r,o,l)=>{const c=o?n.getLeafRows().map(p=>{let{id:x}=p;return x}):[],d=l?n.getParentRows().map(p=>{let{id:x}=p;return x}):[],h=new Set([...d,n.id,...c]);a.setRowPinning(p=>{var x,v;if(r==="bottom"){var R,y;return{top:((R=p==null?void 0:p.top)!=null?R:[]).filter(j=>!(h!=null&&h.has(j))),bottom:[...((y=p==null?void 0:p.bottom)!=null?y:[]).filter(j=>!(h!=null&&h.has(j))),...Array.from(h)]}}if(r==="top"){var b,E;return{top:[...((b=p==null?void 0:p.top)!=null?b:[]).filter(j=>!(h!=null&&h.has(j))),...Array.from(h)],bottom:((E=p==null?void 0:p.bottom)!=null?E:[]).filter(j=>!(h!=null&&h.has(j)))}}return{top:((x=p==null?void 0:p.top)!=null?x:[]).filter(j=>!(h!=null&&h.has(j))),bottom:((v=p==null?void 0:p.bottom)!=null?v:[]).filter(j=>!(h!=null&&h.has(j)))}})},n.getCanPin=()=>{var r;const{enableRowPinning:o,enablePinning:l}=a.options;return typeof o=="function"?o(n):(r=o??l)!=null?r:!0},n.getIsPinned=()=>{const r=[n.id],{top:o,bottom:l}=a.getState().rowPinning,c=r.some(h=>o==null?void 0:o.includes(h)),d=r.some(h=>l==null?void 0:l.includes(h));return c?"top":d?"bottom":!1},n.getPinnedIndex=()=>{var r,o;const l=n.getIsPinned();if(!l)return-1;const c=(r=l==="top"?a.getTopRows():a.getBottomRows())==null?void 0:r.map(d=>{let{id:h}=d;return h});return(o=c==null?void 0:c.indexOf(n.id))!=null?o:-1}},createTable:n=>{n.setRowPinning=a=>n.options.onRowPinningChange==null?void 0:n.options.onRowPinningChange(a),n.resetRowPinning=a=>{var r,o;return n.setRowPinning(a?za():(r=(o=n.initialState)==null?void 0:o.rowPinning)!=null?r:za())},n.getIsSomeRowsPinned=a=>{var r;const o=n.getState().rowPinning;if(!a){var l,c;return!!((l=o.top)!=null&&l.length||(c=o.bottom)!=null&&c.length)}return!!((r=o[a])!=null&&r.length)},n._getPinnedRows=(a,r,o)=>{var l;return((l=n.options.keepPinnedRows)==null||l?(r??[]).map(d=>{const h=n.getRow(d,!0);return h.getIsAllParentsExpanded()?h:null}):(r??[]).map(d=>a.find(h=>h.id===d))).filter(Boolean).map(d=>({...d,position:o}))},n.getTopRows=Z(()=>[n.getRowModel().rows,n.getState().rowPinning.top],(a,r)=>n._getPinnedRows(a,r,"top"),J(n.options,"debugRows")),n.getBottomRows=Z(()=>[n.getRowModel().rows,n.getState().rowPinning.bottom],(a,r)=>n._getPinnedRows(a,r,"bottom"),J(n.options,"debugRows")),n.getCenterRows=Z(()=>[n.getRowModel().rows,n.getState().rowPinning.top,n.getState().rowPinning.bottom],(a,r,o)=>{const l=new Set([...r??[],...o??[]]);return a.filter(c=>!l.has(c.id))},J(n.options,"debugRows"))}},$b={getInitialState:n=>({rowSelection:{},...n}),getDefaultOptions:n=>({onRowSelectionChange:xt("rowSelection",n),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:n=>{n.setRowSelection=a=>n.options.onRowSelectionChange==null?void 0:n.options.onRowSelectionChange(a),n.resetRowSelection=a=>{var r;return n.setRowSelection(a?{}:(r=n.initialState.rowSelection)!=null?r:{})},n.toggleAllRowsSelected=a=>{n.setRowSelection(r=>{a=typeof a<"u"?a:!n.getIsAllRowsSelected();const o={...r},l=n.getPreGroupedRowModel().flatRows;return a?l.forEach(c=>{c.getCanSelect()&&(o[c.id]=!0)}):l.forEach(c=>{delete o[c.id]}),o})},n.toggleAllPageRowsSelected=a=>n.setRowSelection(r=>{const o=typeof a<"u"?a:!n.getIsAllPageRowsSelected(),l={...r};return n.getRowModel().rows.forEach(c=>{Xa(l,c.id,o,!0,n)}),l}),n.getPreSelectedRowModel=()=>n.getCoreRowModel(),n.getSelectedRowModel=Z(()=>[n.getState().rowSelection,n.getCoreRowModel()],(a,r)=>Object.keys(a).length?Ba(n,r):{rows:[],flatRows:[],rowsById:{}},J(n.options,"debugTable")),n.getFilteredSelectedRowModel=Z(()=>[n.getState().rowSelection,n.getFilteredRowModel()],(a,r)=>Object.keys(a).length?Ba(n,r):{rows:[],flatRows:[],rowsById:{}},J(n.options,"debugTable")),n.getGroupedSelectedRowModel=Z(()=>[n.getState().rowSelection,n.getSortedRowModel()],(a,r)=>Object.keys(a).length?Ba(n,r):{rows:[],flatRows:[],rowsById:{}},J(n.options,"debugTable")),n.getIsAllRowsSelected=()=>{const a=n.getFilteredRowModel().flatRows,{rowSelection:r}=n.getState();let o=!!(a.length&&Object.keys(r).length);return o&&a.some(l=>l.getCanSelect()&&!r[l.id])&&(o=!1),o},n.getIsAllPageRowsSelected=()=>{const a=n.getPaginationRowModel().flatRows.filter(l=>l.getCanSelect()),{rowSelection:r}=n.getState();let o=!!a.length;return o&&a.some(l=>!r[l.id])&&(o=!1),o},n.getIsSomeRowsSelected=()=>{var a;const r=Object.keys((a=n.getState().rowSelection)!=null?a:{}).length;return r>0&&r{const a=n.getPaginationRowModel().flatRows;return n.getIsAllPageRowsSelected()?!1:a.filter(r=>r.getCanSelect()).some(r=>r.getIsSelected()||r.getIsSomeSelected())},n.getToggleAllRowsSelectedHandler=()=>a=>{n.toggleAllRowsSelected(a.target.checked)},n.getToggleAllPageRowsSelectedHandler=()=>a=>{n.toggleAllPageRowsSelected(a.target.checked)}},createRow:(n,a)=>{n.toggleSelected=(r,o)=>{const l=n.getIsSelected();a.setRowSelection(c=>{var d;if(r=typeof r<"u"?r:!l,n.getCanSelect()&&l===r)return c;const h={...c};return Xa(h,n.id,r,(d=o==null?void 0:o.selectChildren)!=null?d:!0,a),h})},n.getIsSelected=()=>{const{rowSelection:r}=a.getState();return Ao(n,r)},n.getIsSomeSelected=()=>{const{rowSelection:r}=a.getState();return Za(n,r)==="some"},n.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=a.getState();return Za(n,r)==="all"},n.getCanSelect=()=>{var r;return typeof a.options.enableRowSelection=="function"?a.options.enableRowSelection(n):(r=a.options.enableRowSelection)!=null?r:!0},n.getCanSelectSubRows=()=>{var r;return typeof a.options.enableSubRowSelection=="function"?a.options.enableSubRowSelection(n):(r=a.options.enableSubRowSelection)!=null?r:!0},n.getCanMultiSelect=()=>{var r;return typeof a.options.enableMultiRowSelection=="function"?a.options.enableMultiRowSelection(n):(r=a.options.enableMultiRowSelection)!=null?r:!0},n.getToggleSelectedHandler=()=>{const r=n.getCanSelect();return o=>{var l;r&&n.toggleSelected((l=o.target)==null?void 0:l.checked)}}}},Xa=(n,a,r,o,l)=>{var c;const d=l.getRow(a,!0);r?(d.getCanMultiSelect()||Object.keys(n).forEach(h=>delete n[h]),d.getCanSelect()&&(n[a]=!0)):delete n[a],o&&(c=d.subRows)!=null&&c.length&&d.getCanSelectSubRows()&&d.subRows.forEach(h=>Xa(n,h.id,r,o,l))};function Ba(n,a){const r=n.getState().rowSelection,o=[],l={},c=function(d,h){return d.map(p=>{var x;const v=Ao(p,r);if(v&&(o.push(p),l[p.id]=p),(x=p.subRows)!=null&&x.length&&(p={...p,subRows:c(p.subRows)}),v)return p}).filter(Boolean)};return{rows:c(a.rows),flatRows:o,rowsById:l}}function Ao(n,a){var r;return(r=a[n.id])!=null?r:!1}function Za(n,a,r){var o;if(!((o=n.subRows)!=null&&o.length))return!1;let l=!0,c=!1;return n.subRows.forEach(d=>{if(!(c&&!l)&&(d.getCanSelect()&&(Ao(d,a)?c=!0:l=!1),d.subRows&&d.subRows.length)){const h=Za(d,a);h==="all"?c=!0:(h==="some"&&(c=!0),l=!1)}}),l?"all":c?"some":!1}const Ja=/([0-9]+)/gm,zb=(n,a,r)=>Id(vn(n.getValue(r)).toLowerCase(),vn(a.getValue(r)).toLowerCase()),Bb=(n,a,r)=>Id(vn(n.getValue(r)),vn(a.getValue(r))),Vb=(n,a,r)=>Io(vn(n.getValue(r)).toLowerCase(),vn(a.getValue(r)).toLowerCase()),Ub=(n,a,r)=>Io(vn(n.getValue(r)),vn(a.getValue(r))),Gb=(n,a,r)=>{const o=n.getValue(r),l=a.getValue(r);return o>l?1:oIo(n.getValue(r),a.getValue(r));function Io(n,a){return n===a?0:n>a?1:-1}function vn(n){return typeof n=="number"?isNaN(n)||n===1/0||n===-1/0?"":String(n):typeof n=="string"?n:""}function Id(n,a){const r=n.split(Ja).filter(Boolean),o=a.split(Ja).filter(Boolean);for(;r.length&&o.length;){const l=r.shift(),c=o.shift(),d=parseInt(l,10),h=parseInt(c,10),p=[d,h].sort();if(isNaN(p[0])){if(l>c)return 1;if(c>l)return-1;continue}if(isNaN(p[1]))return isNaN(d)?-1:1;if(d>h)return 1;if(h>d)return-1}return r.length-o.length}const Dr={alphanumeric:zb,alphanumericCaseSensitive:Bb,text:Vb,textCaseSensitive:Ub,datetime:Gb,basic:Hb},Kb={getInitialState:n=>({sorting:[],...n}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:n=>({onSortingChange:xt("sorting",n),isMultiSortEvent:a=>a.shiftKey}),createColumn:(n,a)=>{n.getAutoSortingFn=()=>{const r=a.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const l of r){const c=l==null?void 0:l.getValue(n.id);if(Object.prototype.toString.call(c)==="[object Date]")return Dr.datetime;if(typeof c=="string"&&(o=!0,c.split(Ja).length>1))return Dr.alphanumeric}return o?Dr.text:Dr.basic},n.getAutoSortDir=()=>{const r=a.getFilteredRowModel().flatRows[0];return typeof(r==null?void 0:r.getValue(n.id))=="string"?"asc":"desc"},n.getSortingFn=()=>{var r,o;if(!n)throw new Error;return rs(n.columnDef.sortingFn)?n.columnDef.sortingFn:n.columnDef.sortingFn==="auto"?n.getAutoSortingFn():(r=(o=a.options.sortingFns)==null?void 0:o[n.columnDef.sortingFn])!=null?r:Dr[n.columnDef.sortingFn]},n.toggleSorting=(r,o)=>{const l=n.getNextSortingOrder(),c=typeof r<"u"&&r!==null;a.setSorting(d=>{const h=d==null?void 0:d.find(b=>b.id===n.id),p=d==null?void 0:d.findIndex(b=>b.id===n.id);let x=[],v,R=c?r:l==="desc";if(d!=null&&d.length&&n.getCanMultiSort()&&o?h?v="toggle":v="add":d!=null&&d.length&&p!==d.length-1?v="replace":h?v="toggle":v="replace",v==="toggle"&&(c||l||(v="remove")),v==="add"){var y;x=[...d,{id:n.id,desc:R}],x.splice(0,x.length-((y=a.options.maxMultiSortColCount)!=null?y:Number.MAX_SAFE_INTEGER))}else v==="toggle"?x=d.map(b=>b.id===n.id?{...b,desc:R}:b):v==="remove"?x=d.filter(b=>b.id!==n.id):x=[{id:n.id,desc:R}];return x})},n.getFirstSortDir=()=>{var r,o;return((r=(o=n.columnDef.sortDescFirst)!=null?o:a.options.sortDescFirst)!=null?r:n.getAutoSortDir()==="desc")?"desc":"asc"},n.getNextSortingOrder=r=>{var o,l;const c=n.getFirstSortDir(),d=n.getIsSorted();return d?d!==c&&((o=a.options.enableSortingRemoval)==null||o)&&(!(r&&(l=a.options.enableMultiRemove)!=null)||l)?!1:d==="desc"?"asc":"desc":c},n.getCanSort=()=>{var r,o;return((r=n.columnDef.enableSorting)!=null?r:!0)&&((o=a.options.enableSorting)!=null?o:!0)&&!!n.accessorFn},n.getCanMultiSort=()=>{var r,o;return(r=(o=n.columnDef.enableMultiSort)!=null?o:a.options.enableMultiSort)!=null?r:!!n.accessorFn},n.getIsSorted=()=>{var r;const o=(r=a.getState().sorting)==null?void 0:r.find(l=>l.id===n.id);return o?o.desc?"desc":"asc":!1},n.getSortIndex=()=>{var r,o;return(r=(o=a.getState().sorting)==null?void 0:o.findIndex(l=>l.id===n.id))!=null?r:-1},n.clearSorting=()=>{a.setSorting(r=>r!=null&&r.length?r.filter(o=>o.id!==n.id):[])},n.getToggleSortingHandler=()=>{const r=n.getCanSort();return o=>{r&&(o.persist==null||o.persist(),n.toggleSorting==null||n.toggleSorting(void 0,n.getCanMultiSort()?a.options.isMultiSortEvent==null?void 0:a.options.isMultiSortEvent(o):!1))}}},createTable:n=>{n.setSorting=a=>n.options.onSortingChange==null?void 0:n.options.onSortingChange(a),n.resetSorting=a=>{var r,o;n.setSorting(a?[]:(r=(o=n.initialState)==null?void 0:o.sorting)!=null?r:[])},n.getPreSortedRowModel=()=>n.getGroupedRowModel(),n.getSortedRowModel=()=>(!n._getSortedRowModel&&n.options.getSortedRowModel&&(n._getSortedRowModel=n.options.getSortedRowModel(n)),n.options.manualSorting||!n._getSortedRowModel?n.getPreSortedRowModel():n._getSortedRowModel())}},Wb=[pb,Tb,Ib,Fb,xb,vb,Lb,Ob,Kb,Eb,Pb,kb,qb,$b,Mb];function Yb(n){var a,r;const o=[...Wb,...(a=n._features)!=null?a:[]];let l={_features:o};const c=l._features.reduce((y,b)=>Object.assign(y,b.getDefaultOptions==null?void 0:b.getDefaultOptions(l)),{}),d=y=>l.options.mergeOptions?l.options.mergeOptions(c,y):{...c,...y};let p={...{},...(r=n.initialState)!=null?r:{}};l._features.forEach(y=>{var b;p=(b=y.getInitialState==null?void 0:y.getInitialState(p))!=null?b:p});const x=[];let v=!1;const R={_features:o,options:{...c,...n},initialState:p,_queue:y=>{x.push(y),v||(v=!0,Promise.resolve().then(()=>{for(;x.length;)x.shift()();v=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{l.setState(l.initialState)},setOptions:y=>{const b=gn(y,l.options);l.options=d(b)},getState:()=>l.options.state,setState:y=>{l.options.onStateChange==null||l.options.onStateChange(y)},_getRowId:(y,b,E)=>{var j;return(j=l.options.getRowId==null?void 0:l.options.getRowId(y,b,E))!=null?j:`${E?[E.id,b].join("."):b}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(y,b)=>{let E=(b?l.getPrePaginationRowModel():l.getRowModel()).rowsById[y];if(!E&&(E=l.getCoreRowModel().rowsById[y],!E))throw new Error;return E},_getDefaultColumnDef:Z(()=>[l.options.defaultColumn],y=>{var b;return y=(b=y)!=null?b:{},{header:E=>{const j=E.header.column.columnDef;return j.accessorKey?j.accessorKey:j.accessorFn?j.id:null},cell:E=>{var j,D;return(j=(D=E.renderValue())==null||D.toString==null?void 0:D.toString())!=null?j:null},...l._features.reduce((E,j)=>Object.assign(E,j.getDefaultColumnDef==null?void 0:j.getDefaultColumnDef()),{}),...y}},J(n,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:Z(()=>[l._getColumnDefs()],y=>{const b=function(E,j,D){return D===void 0&&(D=0),E.map(F=>{const q=hb(l,F,D,j),$=F;return q.columns=$.columns?b($.columns,q,D+1):[],q})};return b(y)},J(n,"debugColumns")),getAllFlatColumns:Z(()=>[l.getAllColumns()],y=>y.flatMap(b=>b.getFlatColumns()),J(n,"debugColumns")),_getAllFlatColumnsById:Z(()=>[l.getAllFlatColumns()],y=>y.reduce((b,E)=>(b[E.id]=E,b),{}),J(n,"debugColumns")),getAllLeafColumns:Z(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(y,b)=>{let E=y.flatMap(j=>j.getLeafColumns());return b(E)},J(n,"debugColumns")),getColumn:y=>l._getAllFlatColumnsById()[y]};Object.assign(l,R);for(let y=0;yZ(()=>[n.options.data],a=>{const r={rows:[],flatRows:[],rowsById:{}},o=function(l,c,d){c===void 0&&(c=0);const h=[];for(let x=0;xn._autoResetPageIndex()))}function Md(n,a,r){return r.options.filterFromLeafRows?Qb(n,a,r):Xb(n,a,r)}function Qb(n,a,r){var o;const l=[],c={},d=(o=r.options.maxLeafRowFilterDepth)!=null?o:100,h=function(p,x){x===void 0&&(x=0);const v=[];for(let y=0;yZ(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter,n.getFilteredRowModel()],(r,o,l)=>{if(!r.rows.length||!(o!=null&&o.length)&&!l)return r;const c=[...o.map(h=>h.id).filter(h=>h!==a),l?"__global__":void 0].filter(Boolean),d=h=>{for(let p=0;pZ(()=>{var r;return[(r=n.getColumn(a))==null?void 0:r.getFacetedRowModel()]},r=>{if(!r)return new Map;let o=new Map;for(let c=0;cZ(()=>[n.getPreFilteredRowModel(),n.getState().columnFilters,n.getState().globalFilter],(a,r,o)=>{if(!a.rows.length||!(r!=null&&r.length)&&!o){for(let y=0;y{var b;const E=n.getColumn(y.id);if(!E)return;const j=E.getFilterFn();j&&l.push({id:y.id,filterFn:j,resolvedValue:(b=j.resolveFilterValue==null?void 0:j.resolveFilterValue(y.value))!=null?b:y.value})});const d=(r??[]).map(y=>y.id),h=n.getGlobalFilterFn(),p=n.getAllLeafColumns().filter(y=>y.getCanGlobalFilter());o&&h&&p.length&&(d.push("__global__"),p.forEach(y=>{var b;c.push({id:y.id,filterFn:h,resolvedValue:(b=h.resolveFilterValue==null?void 0:h.resolveFilterValue(o))!=null?b:o})}));let x,v;for(let y=0;y{b.columnFiltersMeta[j]=D})}if(c.length){for(let E=0;E{b.columnFiltersMeta[j]=D})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const R=y=>{for(let b=0;bn._autoResetPageIndex()))}function tw(){return n=>Z(()=>[n.getState().sorting,n.getPreSortedRowModel()],(a,r)=>{if(!r.rows.length||!(a!=null&&a.length))return r;const o=n.getState().sorting,l=[],c=o.filter(p=>{var x;return(x=n.getColumn(p.id))==null?void 0:x.getCanSort()}),d={};c.forEach(p=>{const x=n.getColumn(p.id);x&&(d[p.id]={sortUndefined:x.columnDef.sortUndefined,invertSorting:x.columnDef.invertSorting,sortingFn:x.getSortingFn()})});const h=p=>{const x=p.map(v=>({...v}));return x.sort((v,R)=>{for(let b=0;b{var R;l.push(v),(R=v.subRows)!=null&&R.length&&(v.subRows=h(v.subRows))}),x};return{rows:h(r.rows),flatRows:l,rowsById:r.rowsById}},J(n.options,"debugTable","getSortedRowModel",()=>n._autoResetPageIndex()))}/** - * react-table - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Gi(n,a){return n?nw(n)?M.createElement(n,a):n:null}function nw(n){return rw(n)||typeof n=="function"||iw(n)}function rw(n){return typeof n=="function"&&(()=>{const a=Object.getPrototypeOf(n);return a.prototype&&a.prototype.isReactComponent})()}function iw(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Dd(n){const a={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=M.useState(()=>({current:Yb(a)})),[o,l]=M.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...o,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const sw=({buttonText:n,title:a="",content:r,className:o=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${o}`,children:i.jsxs(rr,{children:[i.jsx(Tc,{asChild:!0,children:i.jsxs(G,{variant:"link",className:"inline-flex items-center font-medium group",children:[i.jsx("span",{className:"underline-offset-4 group-hover:underline",children:n}),i.jsx(U_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(ir,{className:"sm:max-w-[425px]",children:[i.jsx(sr,{children:i.jsx(ar,{children:a})}),i.jsxs(no,{className:"grid gap-4 py-2",children:[r,i.jsx(or,{children:i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",children:w("common.close")})})})]})]})]})});function aw(n){let o=0;for(let v=0;v>v*8&255;l+=("00"+R.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),h=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(h*.7|0).toString(16).padStart(2,"0")}`,x=`#${Math.min(255,Math.floor(c+(255-c)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(d+(255-d)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(h+(255-h)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Td=({label:n,className:a})=>{const[r,o]=aw(n);return i.jsx(ro,{className:a,style:a?{}:{backgroundColor:o,color:r},children:n})};function Ld({table:n,header:a,className:r}){return a.column.getCanSort()?i.jsx("div",{className:he("flex items-center space-x-2",r),children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{"aria-label":a.column.getIsSorted()==="desc"?w("common.sort_desc_description"):a.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Gi(a.column.columnDef.header,a.getContext()),a.column.getIsSorted()==="desc"?i.jsx(bc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):a.column.getIsSorted()==="asc"?i.jsx(wc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(q0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(Xi,{align:"start",children:[a.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Lr,{onClick:()=>a.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(wc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Lr,{onClick:()=>a.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(bc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),a.column.getCanSort()&&a.column.getCanHide()&&i.jsx(io,{}),a.column.getCanHide()&&i.jsxs(Lr,{onClick:()=>a.column.toggleVisibility(!1),"aria-label":w("Hide"),children:[i.jsx(md,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("Hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:he("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:a.isPlaceholder?null:Gi(a.column.columnDef.header,a.getContext())}),!1]})}function ow({table:n,className:a,enablePageSizeSelector:r=!0,visible:o="auto"}){const l=M.useMemo(()=>o===!0,[o]),c=M.useMemo(()=>o==="auto",[o]);return!l||c&&n.getPageCount()<1?null:i.jsxs("div",{className:a,children:[i.jsx("div",{className:"flex-1 text-base text-muted-foreground",children:n.getSelectedRowModel().rows.length>0&&i.jsx(i.Fragment,{children:w("common.rows_selected_of_total",{count:n.getFilteredSelectedRowModel().rows.length,total:n.getFilteredRowModel().rows.length})})}),i.jsxs("div",{className:"flex justify-between space-x-6 lg:space-x-8",children:[r&&i.jsxs("div",{className:"flex items-center space-x-2 grow",children:[i.jsx("p",{className:"text-sm font-medium",children:w("common.rows_per_page")}),i.jsxs(so,{value:`${n.getState().pagination.pageSize}`,onValueChange:d=>{n.setPageSize(Number(d))},children:[i.jsx(ao,{className:"h-8 w-[70px]",children:i.jsx(oo,{placeholder:n.getState().pagination.pageSize})}),i.jsx(lo,{side:"top",children:G_.map(d=>i.jsx(Or,{value:`${d}`,children:d},d))})]})]}),i.jsxs("div",{className:he("flex space-x-2 flex-1",r?"justify-end":"justify-between"),children:[i.jsx("div",{className:"flex w-[150px] items-center justify-start",children:i.jsx("p",{className:"text-sm font-medium ",children:w("common.num_page_of_total",{count:n.getState().pagination.pageIndex+1,total:n.getPageCount()})})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsxs(G,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(H_),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_first_page")}),i.jsx($0,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.previousPage(),disabled:!n.getCanPreviousPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_prev_page")}),i.jsx(K_,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"w-8 h-8 p-0",onClick:()=>n.nextPage(),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_next_page")}),i.jsx(W_,{className:"w-4 h-4"})]}),i.jsxs(G,{type:"button",variant:"outline",className:"hidden w-8 h-8 p-0 lg:flex",onClick:()=>n.setPageIndex(n.getPageCount()+1),disabled:!n.getCanNextPage(),children:[i.jsx("span",{className:"sr-only",children:w("common.go_to_last_page")}),i.jsx(z0,{className:"w-4 h-4"})]})]})]})]})]})}function is({table:n,title:a,description:r,caption:o,paginationOptions:l,headerOptions:c={visible:!0},children:d,className:h,contentClassName:p,footerClassName:x,rowClassName:v,cellClassName:R,onRowClick:y,activeRowIndex:b}){var j;const E=c==null?void 0:c.visible;return i.jsxs(Le,{className:h,children:[(a||r)&&i.jsxs(pt,{className:"pb-0",children:[i.jsx(Ge,{children:a}),i.jsx(Ze,{children:r})]}),i.jsxs(Oe,{className:he("pt-6",p),children:[d&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex space-x-2",children:d}),i.jsx(hn,{className:"my-4"})]}),i.jsxs(uo,{children:[typeof o<"u"&&i.jsx(Y_,{children:o}),E&&n.getHeaderGroups().length&&i.jsx(co,{children:n.getHeaderGroups().map(D=>i.jsx(pn,{className:v,children:D.headers.map(F=>i.jsx(fo,{colSpan:F.colSpan,style:{width:F.getSize()===Number.MAX_SAFE_INTEGER?"auto":F.getSize()},children:i.jsx(Ld,{table:n,header:F})},F.id))},D.id))}),i.jsx(go,{children:(j=n.getRowModel().rows)!=null&&j.length?n.getRowModel().rows.map(D=>i.jsx(pn,{onClick:()=>{y&&y(D)},tabIndex:0,"data-state":D.getIsSelected()&&"selected",className:he(D.getIsSelected()||b===D.index?"bg-accent cursor-pointer hover:bg-accent":"cursor-pointer",v),children:D.getVisibleCells().map(F=>i.jsx(qr,{className:R,style:{width:F.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":F.column.getSize()},children:Gi(F.column.columnDef.cell,F.getContext())},F.id))},D.id)):i.jsx(pn,{className:v,children:i.jsx(qr,{className:he("h-24 text-center",R),colSpan:n.getAllColumns.length,children:"No hay datos para mostrar"})})})]})]}),i.jsx(Dt,{className:x,children:i.jsx(ow,{className:"flex-1",table:n,...l})})]})}function lw({actions:n,rowContext:a}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{size:"icon",variant:"outline",className:"w-8 h-8",children:[i.jsx(G0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only",children:w("common.open_menu")})]})}),i.jsxs(Xi,{align:"end",children:[i.jsxs(Lc,{children:[w("common.actions")," "]}),n&&n(a).map((r,o)=>r.label==="-"?i.jsx(io,{},o):i.jsxs(Lr,{onClick:l=>r.onClick?r.onClick(a,l):null,children:[r.icon&&i.jsx(i.Fragment,{children:r.icon}),r.label,r.shortcut&&i.jsx(Q_,{children:r.shortcut})]},o))]})]})}function uw(){return{id:"select",header:({table:n})=>i.jsx(Ui,{id:"select-all",checked:n.getIsAllPageRowsSelected()||n.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:a=>n.toggleAllPageRowsSelected(!!a),"aria-label":"Seleccionar todo",className:"translate-y-[2px]"}),cell:({row:n})=>i.jsx(Ui,{id:`select-row-${n.id}`,checked:n.getIsSelected(),onCheckedChange:a=>{n.toggleSelected(!!a)},"aria-label":"Seleccionar file",className:"translate-y-[2px]"}),enableSorting:!1,enableHiding:!1}}function ss({columnCount:n,rowCount:a=10,searchableColumnCount:r=0,filterableColumnCount:o=0,showViewOptions:l=!0,cellWidths:c=["auto"],withPagination:d=!0,shrinkZero:h=!1,className:p,...x}){return i.jsxs("div",{className:he("w-full space-y-2.5 overflow-auto",p),...x,children:[i.jsxs("div",{className:"flex items-center justify-between w-full p-1 space-x-2 overflow-auto",children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[r>0?Array.from({length:r}).map((v,R)=>i.jsx(ut,{className:"w-40 h-7 lg:w-60"},R)):null,o>0?Array.from({length:o}).map((v,R)=>i.jsx(ut,{className:"h-7 w-[4.5rem] border-dashed"},R)):null]}),l?i.jsx(ut,{className:"ml-auto hidden h-7 w-[4.5rem] lg:flex"}):null]}),i.jsx("div",{className:"border rounded-md",children:i.jsxs(uo,{children:[i.jsx(co,{children:Array.from({length:1}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,b)=>i.jsx(fo,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))}),i.jsx(go,{children:Array.from({length:a}).map((v,R)=>i.jsx(pn,{className:"hover:bg-transparent",children:Array.from({length:n}).map((y,b)=>i.jsx(qr,{style:{width:c[b],minWidth:h?c[b]:"auto"},children:i.jsx(ut,{className:"w-full h-6"})},b))},R))})]})}),d?i.jsxs("div",{className:"flex items-center justify-between w-full gap-4 p-1 overflow-auto sm:gap-8",children:[i.jsx(ut,{className:"w-40 h-7 shrink-0"}),i.jsxs("div",{className:"flex items-center gap-4 sm:gap-6 lg:gap-8",children:[i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"w-24 h-7"}),i.jsx(ut,{className:"h-7 w-[4.5rem]"})]}),i.jsx("div",{className:"flex items-center justify-center text-sm font-medium",children:i.jsx(ut,{className:"w-20 h-7"})}),i.jsxs("div",{className:"flex items-center space-x-2",children:[i.jsx(ut,{className:"hidden size-7 lg:block"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"size-7"}),i.jsx(ut,{className:"hidden size-7 lg:block"})]})]})]}):null]})}const as=({title:n="Esto está muy vacío",subtitle:a="Empieza solicitando la carga del catálogo",buttonText:r="Solicitar carga del catálogo",onButtonClick:o=()=>{},actions:l=()=>i.jsx(i.Fragment,{})})=>i.jsxs("div",{className:"text-center",children:[i.jsx("svg",{className:"w-12 h-12 mx-auto text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:i.jsx("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),i.jsx("h3",{className:"mt-2 text-lg font-semibold text-slate-900",children:n}),i.jsx("p",{className:"mt-1 text-base text-slate-500",children:a}),i.jsxs("div",{className:"items-center mt-6",children:[l&&i.jsx(i.Fragment,{children:l}),!l&&i.jsxs(G,{className:"my-4",onClick:o,children:[i.jsx(yo,{}),r]})]})]}),cw=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),Hi=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:y}=n,{control:b}=lr(),[E,j]=M.useState(""),D={input:F=>{if(typeof F!="object")return F;const q=$t.create(F);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(F,q,$)=>{const{value:Q}=$??{value:null};j(Q??"");const O=$t.createFromFormattedValue(Q);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:a,disabled:h,rules:{max:100,min:0,...x},render:({field:F})=>{const q=D.input(F.value),$=h||F.disabled,Q=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:Q}),i.jsx(xo,{children:i.jsx(Oc,{name:F.name,ref:F.ref,onBlur:F.onBlur,disabled:$,readOnly:v,className:he(cw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,H)=>F.onChange(D.output(O,k,H))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},dw=vo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input"}},defaultVariants:{variant:"default"}}),fw=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,defaultValue:p,rules:x,readOnly:v,scale:R,variant:y}=n,{control:b}=lr(),[E,j]=M.useState(""),D={input:F=>{if(typeof F!="object")return F;const q=xn.create(F);if(q.isFailure)throw q.error;const $=q.object.toString();return E.endsWith(",")?$.replace(/.0$/,","):$},output:(F,q,$)=>{const{value:Q}=$??{value:null};j(Q??"");const O=xn.createFromFormattedValue(Q);if(O.isFailure)throw O.error;return O.object.toObject()}};return i.jsx(mo,{defaultValue:p,control:b,name:a,disabled:h,rules:x,render:({field:F})=>{const q=D.input(F.value),$=h||F.disabled,Q=!!((x==null?void 0:x.required)??!1);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:Q}),i.jsx(xo,{children:i.jsx(Oc,{name:F.name,ref:F.ref,onBlur:F.onBlur,disabled:$,readOnly:v,className:he(dw({variant:y,className:d})),groupSeparator:".",decimalSeparator:",",placeholder:c,allowDecimals:R!==0,decimalsLimit:R,decimalScale:R,step:1,value:q,onValueChange:(O,k,H)=>F.onChange(D.output(O,k,H))})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},gw=vo("",{variants:{variant:{default:"",ghost:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),mn=n=>{const{name:a,label:r,hint:o,description:l,placeholder:c,className:d,disabled:h,rules:p,required:x,type:v,variant:R}=n,{control:y}=lr();return i.jsx(mo,{control:y,name:a,disabled:h,rules:{required:x,...p},render:({field:b,fieldState:E})=>{const j=!!((p==null?void 0:p.required)??x);return i.jsxs(ho,{className:he(d,"space-y-3"),children:[r&&i.jsx(po,{label:r,hint:o,required:j}),i.jsx(xo,{className:"block",children:i.jsx(Zi,{type:v,placeholder:c,className:he(E.error?"border-destructive focus-visible:ring-destructive":"",gw({variant:R,className:d})),...b})}),l&&i.jsx(_o,{children:l}),i.jsx(bo,{})]})}})},mw=(n,a)=>{const r=M.useRef();return M.useEffect(()=>{r.current=n},[n,a]),r.current},Od=(n,a,r,o)=>n.getFixedT(a,r,o),hw=(n,a,r,o)=>M.useCallback(Od(n,a,r,o),[n,a,r,o]),Fo=(n,a={})=>{var Q,O,k,H;const{i18n:r}=a,{i18n:o,defaultNS:l}=M.useContext(X_)||{},c=r||o||Z_();if(c&&!c.reportNamespaces&&(c.reportNamespaces=new J_),!c){gc(c,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const W=(se,ce)=>Ia(ce)?ce:n0(ce)&&Ia(ce.defaultValue)?ce.defaultValue:Array.isArray(se)?se[se.length-1]:se,B=[W,{},!1];return B.t=W,B.i18n={},B.ready=!1,B}(Q=c.options.react)!=null&&Q.wait&&gc(c,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const d={...t0(),...c.options.react,...a},{useSuspense:h,keyPrefix:p}=d;let x=l||((O=c.options)==null?void 0:O.defaultNS);x=Ia(x)?[x]:x||["translation"],(H=(k=c.reportNamespaces).addUsedNamespaces)==null||H.call(k,x);const v=(c.isInitialized||c.initializedStoreOnce)&&x.every(W=>e0(W,c,d)),R=hw(c,a.lng||null,d.nsMode==="fallback"?x:x[0],p),y=()=>R,b=()=>Od(c,a.lng||null,d.nsMode==="fallback"?x:x[0],p),[E,j]=M.useState(y);let D=x.join();a.lng&&(D=`${a.lng}${D}`);const F=mw(D),q=M.useRef(!0);M.useEffect(()=>{const{bindI18n:W,bindI18nStore:B}=d;q.current=!0,!v&&!h&&(a.lng?mc(c,a.lng,x,()=>{q.current&&j(b)}):hc(c,x,()=>{q.current&&j(b)})),v&&F&&F!==D&&q.current&&j(b);const se=()=>{q.current&&j(b)};return W&&(c==null||c.on(W,se)),B&&(c==null||c.store.on(B,se)),()=>{q.current=!1,c&&(W==null||W.split(" ").forEach(ce=>c.off(ce,se))),B&&c&&B.split(" ").forEach(ce=>c.store.off(ce,se))}},[c,D]),M.useEffect(()=>{q.current&&v&&j(y)},[c,p,v]);const $=[E,c,v];if($.t=E,$.i18n=c,$.ready=v,v||!v&&!h)return $;throw new Promise(W=>{a.lng?mc(c,a.lng,x,()=>W()):hc(c,x,()=>W())})};function pw(n=!1){const[a,r]=M.useState(n);return[a,()=>r(l=>!l)]}const Tn=()=>{const n=M.useContext(r0);if(n===null)throw new Error("useDataTableContext must be used within a DataTableProvider");return n};function os({data:n,columns:a,pageCount:r,enableSorting:o=!1,enableHiding:l=!1,enableRowSelection:c=!1,initialState:d,onPaginationChange:h,meta:p}){const{pagination:x,setPagination:v,sorting:R}=Tn(),[y,b]=In.useState({}),[E,j]=In.useState((d==null?void 0:d.columnVisibility)||{}),D=Q=>{if(typeof Q=="function"){const O=Q(x);v(O)}h&&h(Q)},F=Q=>{},q=M.useCallback(()=>{const Q=a;return c&&Q.unshift(uw()),Q},[a,c]);return{table:Dd({data:n,columns:q(),pageCount:r??-1,meta:p,getCoreRowModel:Fd(),initialState:d,state:{pagination:x,sorting:R,columnVisibility:E,rowSelection:y},enableRowSelection:c,onRowSelectionChange:b,manualSorting:!0,enableSorting:o,getSortedRowModel:tw(),onSortingChange:F,enableHiding:l,onColumnVisibilityChange:j,manualPagination:!0,onPaginationChange:D,manualFiltering:!0,getFilteredRowModel:ew(),getFacetedRowModel:Zb(),getFacetedUniqueValues:Jb(),debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER}})}}const xw=({setSize:n,setControllerCallback:a,setPercentageCallback:r,setErrorCallback:o})=>l=>{if(!l.ok)throw Error(`${l.status} ${l.type} ${l.statusText}`);if(!l.body)throw Error("ReadableStream not yet supported in this browser.");const c=l.body,d=l.headers.get("content-encoding"),h=l.headers.get(d?"x-file-size":"content-length"),p=parseInt(h||"0",10);n(()=>p);let x=0;const v=new ReadableStream({start(R){a(R);const y=c.getReader();async function b(){return y.read().then(({done:E,value:j})=>E?R.close():(x+=(j==null?void 0:j.byteLength)||0,j&&R.enqueue(j),r({loaded:x,total:p}),b())).catch(E=>(o(E),y.cancel("Cancelled"),R.error(E)))}return b()}});return new Response(v)},Rc=(n,a,r)=>{const o=[n],l=new Blob(o,{type:r||"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")return window.navigator.msSaveBlob(l,a);const c=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(l):window.webkitURL.createObjectURL(l),d=document.createElement("a");return d.style.display="none",d.href=c,d.setAttribute("download",a),typeof d.download>"u"&&d.setAttribute("target","_blank"),document.body.appendChild(d),d.click(),setTimeout(()=>{document.body.removeChild(d),window.URL.revokeObjectURL(c)},200)};function Ec({customHandleDownload:n,...a}={}){var Q;let r=!1;try{r=process?!!((Q=process==null?void 0:process.env)!=null&&Q.REACT_APP_DEBUG_MODE):!1}catch{r=!1}const[o,l]=M.useState(0),[c,d]=M.useState(0),[h,p]=M.useState(0),[x,v]=M.useState(null),[R,y]=M.useState(!1),b=M.useRef(null),E=M.useCallback(({loaded:O,total:k})=>{const H=Math.round(O/k*100);d(()=>H)},[]),j=M.useCallback(O=>{const k={"Failed to execute 'enqueue' on 'ReadableStreamDefaultController': Cannot enqueue a chunk into an errored readable stream":"Download canceled","The user aborted a request.":"Download timed out"};v(()=>({errorMessage:k[O.message]?k[O.message]:O.message}))},[]),D=M.useCallback(O=>{b.current=O},[]),F=M.useCallback(()=>{b.current&&b.current.error()},[]),q=M.useCallback(()=>{D(null),l(()=>0),d(()=>0),p(()=>0),y(()=>!1)},[D]),$=M.useCallback(async(O,k,H=0,W={})=>{if(R)return null;q(),v(()=>null),y(()=>!0);const B=setInterval(()=>l(rt=>rt+1),r?1:1e3),se=xw({setSize:p,setControllerCallback:D,setPercentageCallback:E,setErrorCallback:j}),ce=new AbortController,Y=setTimeout(()=>{H>0&&ce.abort()},H),Re=n||Rc;try{const rt=await fetch(O,{method:"GET",...a,...W,signal:ce.signal}),je=await se(rt).blob();Re(je,k),q()}catch(rt){q(),v(ee=>{const{message:je}=rt;return je!=="Failed to fetch"?{errorMessage:je}:ee}),clearTimeout(Y)}finally{clearInterval(B)}},[R,q,r,D,E,j,a,n]);return M.useMemo(()=>({elapsed:o,percentage:c,size:h,download:$,cancel:F,error:x,isInProgress:R,jsDownload:Rc}),[o,c,h,$,F,x,R])}const vw=()=>{const{i18n:n}=Fo();return Pd({locale:n.language})},Pd=n=>{const{locale:a}=n,r=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h,currency_code:p}=c;return new Intl.NumberFormat(a??"ES",{style:"currency",currency:p,currencyDisplay:"symbol",useGrouping:!0,maximumFractionDigits:h}).format(d===null?0:pc({amount:d,scale:h}))},[a]),o=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat("es",{minimumFractionDigits:h,useGrouping:!0}).format(d===null?0:pc({amount:d,scale:h}))},[a]),l=M.useCallback(c=>{if(c==null)return"";const{amount:d,scale:h}=c;return new Intl.NumberFormat(a,{style:"decimal",minimumFractionDigits:h}).format(d===null?0:d)},[a]);return{formatCurrency:r,formatNumber:o,formatPercentage:l}};function kd(n){const[a,r]=M.useState(!1);return M.useEffect(()=>{function o(c){r(c.matches)}const l=matchMedia(n);return l.addEventListener("change",o),r(l.matches),()=>l.removeEventListener("change",o)},[n]),a}const _w=()=>{const n=M.useContext(i0);if(n===null)throw new Error("useWarnAboutChange must be used within a UnsavedWarnProvider");return n},Mo=({isDirty:n=!1,title:a=w("hooks.use_unsaved_changes_notifier.title"),subtitle:r=w("hooks.use_unsaved_changes_notifier.subtitle"),confirmText:o=w("hooks.use_unsaved_changes_notifier.confirm_text"),cancelText:l=w("hooks.use_unsaved_changes_notifier.cancel_text"),onConfirm:c,onCancel:d,type:h="warning"})=>{const p=s0(n),{show:x}=_w(),v=M.useCallback(()=>n?new Promise(R=>{x({title:a,subtitle:r,confirmText:o,cancelText:l,type:h,onConfirm:()=>{R(!0),c==null||c()},onCancel:()=>{R(!1),d==null||d()}})}):Promise.resolve(!0),[l,o,n,d,c,x,r,a,h]);return M.useEffect(()=>{p.state==="blocked"&&v().then(R=>{R?p.proceed():p.reset()})},[p,v]),M.useEffect(()=>(n&&(window.onbeforeunload=()=>r),()=>{window.onbeforeunload=null}),[n,r]),{confirm:v}},qd=n=>{const{isSubmitting:a,isLoading:r,isValidating:o}=a0();return i.jsx(wo,{disabled:a||r||o,...n})};qd.displayName="FormSubmitButton";const $d={"any.unknown":"{{#label}}: no está permitido","any.invalid":"{{#label}}: contiene un valor invalido","any.empty":"{{#label}}: no está permitido que sea vacío","any.required":"{{#label}}: es un campo requerido","any.allowOnly":"{{#label}}: debería ser uno de las siguientes variantes: {{valids}}","any.default":"emitió un error cuando se ejecutó el metodo default","alternatives.base":"{{#label}}: no coincide con ninguna de las alternativas permitidas","array.base":"{{#label}}: debe ser un array","array.includes":"{{#label}}: en la posición {{pos}} no coincide con ninguno de los tipos permitidos","array.includesSingle":'{{#label}}: el valor de "{{!key}}" no coincide con ninguno de los tipos permitidos',"array.includesOne":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.includesOneSingle":'{{#label}}: el valor "{{!key}}" falló porque {{reason}}',"array.includesRequiredUnknowns":"{{#label}}: no contiene valor/es requerido/s: {{unknownMisses}} ","array.includesRequiredKnowns":"{{#label}}: no contiene: {{knownMisses}}","array.includesRequiredBoth":"{{#label}}: no contiene {{knownMisses}} y {{unknownMisses}} otros valores requeridos","array.excludes":"{{#label}}: en la posición {{pos}} contiene un valor excluído","array.excludesSingle":'{{#label}}: el valor "{{!key}}" contiene un valor excluído',"array.min":"{{#label}}: debe contener al menos {{limit}} items","array.max":"{{#label}}: debe contener máximo {{limit}} items","array.length":"{{#label}}: debe contener exactamente {{limit}} items","array.ordered":"{{#label}}: en la posición {{pos}} falló porque {{reason}}","array.orderedLength":"{{#label}}: en la posición {{pos}} falló porque el array debre contener como máximo {{limit}} items","array.sparse":"{{#label}}: no debe ser un array esparcido","array.unique":"{{#label}}: posición {{pos}} contiene un valor duplicado","boolean.base":"{{#label}}: debe ser un valor verdadero/falso o si/no","binary.base":"{{#label}}: debe ser un buffer o un string","binary.min":"{{#label}}: debe ser como mínimo de {{limit}} bytes","binary.max":"{{#label}}: debe ser como máximo de {{limit}} bytes","binary.length":"{{#label}}: debe tener exactamente {{limit}} bytes","date.base":"{{#label}}: debe ser una cantidad de milisegundos o una fecha en cadena de texto válida","date.min":'{{#label}}: debe ser mayor o igual a "{{limit}}"',"date.max":'{{#label}}: debe ser menor o igual que "{{limit}}"',"date.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601","date.ref":'referencia a "{{ref}}", que no es una fecha válida',"function.base":"{{#label}}: debe ser una función","object.base":"{{#label}}: debe ser un objeto","object.child":'hijo "{{!key}}" falló porque {{reason}}',"object.min":"{{#label}}: debe tener como mínimo {{limit}} hijo","object.max":"{{#label}}: debe tener menos o a lo sumo {{limit}} hijo","object.length":"{{#label}}: debe tener máximo {{limit}} hijo/s","object.allowUnknown":"no está permitido","object.with":'peer faltante: "{{peer}}"',"object.without":'conflicto con peer prohibido: "{{peer}}"',"object.missing":"{{#label}}: debe contener al menos uno de: {{peers}}","object.xor":"{{#label}}: contiene un conflicto con alguno de: {{peers}}","object.or":"{{#label}}: debe contener al menos uno de: {{peers}}","object.and":"contiene {{present}} sin el requerido: {{missing}}","object.nand":'!!"{{main}}" no debe existir simultáneamente con {{peers}}',"object.assert":'!!"{{ref}}" falló validacion porque "{{ref}}" falló a {{message}}',"object.rename.multiple":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque múltiples re-nombramientos estan deshabilitados y otra clave fue renombrada a "{{to}}"',"object.rename.override":'{{#label}}: no se puede renombrar el hijo "{{from}}" porque la sobre escritura esta deshabilitada y el target "{{to}}" existe',"object.type":'{{#label}}: debe ser una instancia de "{{type}}"',"number.base":"{{#label}}: debe ser un número","number.min":"{{#label}}: debe ser mayor o igual que {{limit}}","number.max":"{{#label}}: debe ser menor o igual que {{limit}}","number.less":"{{#label}}: debe ser menor a {{limit}}","number.greater":"{{#label}}: debe ser mayor a {{limit}}","number.float":"{{#label}}: debe ser un numero flotante","number.integer":"{{#label}}: debe ser un número entero","number.negative":"{{#label}}: debe ser un número negativo","number.positive":"{{#label}}: debe ser un número positivo","number.precision":"{{#label}}: no debe tener mas de {{limit}} decimales","number.ref":'{{#label}}: referencia a "{{ref}}" que no es un número',"number.multiple":"{{#label}}: debe ser un múltiplo de {{multiple}}","string.base":"{{#label}}: debe ser una cadena de texto","string.empty":"{{#label}}: no está permitido que sea vacío","string.min":"{{#label}}: debe ser mínimo de {{limit}} caracteres de largo","string.max":"{{#label}}: debe ser de máximo {{limit}} caracteres de largo","string.length":"{{#label}}: debe ser exactamente de {{limit}} caracteres de largo","string.alphanum":"{{#label}}: debe contener solo letras y números","string.token":"{{#label}}: debe contener solo letras, números y guines bajos","string.regex.base":'{{#label}}: el valor "{{!value}}" no coincide con el pattern requerido: {{pattern}}',"string.regex.name":'{{#label}}: el valor "{{!value}}" no coincide con el nombre de pattern {{name}}',"string.email":"{{#label}}: debe ser un email válido","string.uri":"{{#label}}: debe sre una uri válida","string.uriCustomScheme":"{{#label}}: debe ser una uri válida con el esquema concidiente con el patrón {{scheme}}","string.isoDate":"{{#label}}: debe ser una fecha en formato ISO 8601 válida","string.guid":"{{#label}}: debe ser un GUID valido","string.hex":"{{#label}}: debe contener solo caracteres hexadecimales","string.hostname":"{{#label}}: deber ser un hostname válido","string.lowercase":"{{#label}}: solo debe contener minúsculas","string.uppercase":"{{#label}}: solo debe contener mayúsculas","string.trim":"{{#label}}: no debe tener espacios en blanco delante o atrás","string.creditCard":"{{#label}}: debe ser una tarjeta de crédito","string.ref":'Referencia "{{ref}}" que no es un número',"string.ip":"{{#label}}: debe ser una dirección ip válida con un CDIR {{cidr}}","string.ipVersion":"{{#label}}: debe ser una dirección ip válida de una de las siguientes versiones {{version}} con un CDIR {{cidr}}","object.unknown":"{{#label}}: es un campo no es permitido","luxon.lt":"{{#label}}: must be before {{#date}}","luxon.gt":"{{#label}}: must be after {{#date}}","luxon.lte":"{{#label}}: must be same as or before {{#date}}","luxon.gte":"{{#label}}: must be same as or after {{#date}}"},Bi=[{code:"en",name:"English",flag:()=>i.jsx("span",{className:"fi fi-gb"})},{code:"es",name:"Español",flag:()=>i.jsx("span",{className:"fi fi-es"})}],oS=()=>{var R,y,b,E;const{t:n,i18n:a}=Fo(),[r,o]=M.useState(a.language),l=zt(),{toast:c}=_n();M.useEffect(()=>{const j=navigator.language.split("-")[0],D=Bi.find(F=>F.code===j);D&&d(D.code)},[]);const d=j=>{a.changeLanguage(j),o(j)},{mutate:h,status:p}=k0({onSuccess:j=>{const{success:D,error:F}=j;!D&&F&&x.setError("root",F),D&&l("/quotes",{replace:!0})},onError:j=>{const{message:D}=j;c({description:D,title:"Error"}),console.log(j)}}),x=Ji({mode:"onBlur",defaultValues:{email:"",password:""},resolver:Pc(Fn.object({email:Fn.string().email({tlds:{allow:!1}}).required(),password:Fn.string().min(4).alphanum().required()}),{messages:$d})}),v=async j=>{h({email:j.email,password:j.password},{})};return i.jsxs(o0,{variant:"full",className:"p-0 lg:grid lg:min-h-[600px] lg:grid-cols-2 xl:min-h-[800px] h-screen ",children:[i.jsx("div",{className:"flex items-center justify-center py-12 ",children:i.jsxs("div",{className:"mx-auto grid w-[650px] gap-6 relative ",children:[i.jsx("div",{className:"absolute flex space-x-2 top-4 right-4 ",children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{variant:"outline",className:"w-[140px] justify-start",children:[i.jsx("span",{className:"mr-2",children:(R=Bi.find(j=>j.code===r))==null?void 0:R.flag()}),(y=Bi.find(j=>j.code===r))==null?void 0:y.name,i.jsx(kc,{className:"w-4 h-4 ml-auto opacity-50"})]})}),i.jsx(Xi,{className:"w-[140px]",children:Bi.map(j=>i.jsxs(Lr,{onSelect:()=>d(j.code),children:[i.jsx("span",{className:"mr-2",children:j.flag()}),j.name]},j.code))})]})}),i.jsxs(Le,{className:"px-12 py-6 bg-muted/50",children:[i.jsxs(pt,{children:[i.jsx(l0,{className:"inline-block m-auto mb-6 align-middle max-w-32"}),i.jsx(Ge,{children:i.jsx(le,{i18nKey:"login_page.title"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"login_page.description"})})]}),i.jsx(Oe,{children:i.jsx(es,{...x,children:i.jsx("form",{onSubmit:x.handleSubmit(v),children:i.jsxs("div",{className:"grid items-start gap-6",children:[i.jsx("div",{className:"grid gap-6",children:i.jsx(mn,{required:!0,disabled:p==="pending",name:"email",label:n("login_page.email_label"),type:"email",placeholder:n("login_page.email_placeholder")})}),i.jsxs("div",{className:"grid gap-6",children:[i.jsx(mn,{required:!0,disabled:p==="pending",name:"password",label:n("login_page.password_label"),type:"password"}),i.jsxs("div",{className:"mb-4 -mt-2 text-sm",children:[i.jsx(le,{i18nKey:"login_page.forgotten_password"}),i.jsx("br",{}),i.jsx(xc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(le,{i18nKey:"login_page.contact_us"})})]})]}),((b=x.formState.errors.root)==null?void 0:b.message)&&i.jsxs(qc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(le,{i18nKey:"common.error"})}),i.jsx(zc,{children:(E=x.formState.errors.root)==null?void 0:E.message})]}),i.jsx(qd,{className:"w-full",disabled:p==="pending"}),i.jsxs("div",{className:"mt-4 text-sm text-center",children:[i.jsx(le,{i18nKey:"login_page.become_dealer"}),i.jsx("br",{}),i.jsx(xc,{to:"https://uecko.com/distribuidores",className:"underline",children:i.jsx(le,{i18nKey:"login_page.contact_us"})}),i.jsx("br",{}),i.jsxs("p",{className:"mx-auto mt-4 -mb-6 text-xs text-muted-foreground/50",children:["v.","1.1.8"]})]})]})})})})]}),i.jsx("img",{className:"block w-11/12 mx-auto aspect-auto",src:"/img/uecko-footer_logos.jpg"})]})}),i.jsx("div",{className:"hidden bg-muted lg:block",children:i.jsx("img",{src:"/img/nara2.jpg",alt:"Image",width:"1920",height:"1080",className:"h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"})})]})},bw=n=>{const{onSuccess:a,onError:r,...o}=n||{},l=Jt(),c=Mn(),{logout:d}=Fc(),h=zt(),{toast:p}=_n();return en({mutationKey:c().auth().action("logout").get(),mutationFn:d,onSuccess:async(x,v,R)=>{l.clear();const{success:y,redirectTo:b}=x;y&&b&&h(b||"/"),a&&a(x,v,R)},onError:(x,v,R)=>{const{message:y}=x;p({title:"Error",description:y,variant:"destructive"}),r&&r(x,v,R)},...o})},lS=()=>{const{mutate:n}=bw({});return M.useEffect(()=>n(),[n]),i.jsx(Dn,{})},ww=M.createContext(null),Sw=({children:n})=>{const[a,r]=Bc();return i.jsx(ww.Provider,{value:{pagination:a,setPagination:r},children:n})},uS=({children:n})=>i.jsx(ts,{children:i.jsx(Sw,{children:i.jsxs(zr,{className:"catalog-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})})}),zd=n=>{const a=$r(),r=Mn(),{pagination:o,searchTerm:l=[],enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("catalog").action("list").params(n).get(),queryFn:()=>a.getList({resource:"catalog",quickSearchTerm:l,pagination:o}),enabled:c,queryOptions:d})};function Bd({table:n,className:a,children:r,...o}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=In.useRef(null),[x,v]=In.useState(""),R=In.useCallback(E=>{E.key==="Enter"&&x.trim()&&(E.preventDefault(),d(j=>[...j,x.trim()]),v("")),E.key==="Backspace"&&!x&&l.length>0&&(E.preventDefault(),d(j=>j.slice(0,-1)))},[l,x]),y=In.useCallback(E=>{d(j=>j.filter(D=>D!==E))},[]),b=In.useCallback(()=>{var E;x.trim()&&(d(j=>[...j,x.trim()]),v(""),(E=p.current)==null||E.focus())},[x]);return i.jsx(u0,{children:i.jsxs("div",{className:"w-full space-y-2",...o,children:[i.jsxs("div",{className:he("relative flex items-center flex-1 p-2 space-x-2 border rounded-md",c?"border-primary":"border-input"),children:[i.jsx(Vc,{className:he("w-4 h-4 text-gray-500")}),i.jsxs("div",{className:"flex flex-wrap items-center flex-1 gap-2",children:[l&&l.map(E=>i.jsxs(ro,{variant:"default",className:"px-1 text-base font-normal rounded-sm",children:[E,i.jsxs(G,{variant:"ghost",onClick:()=>y(E),className:"h-auto p-0 px-1 ml-1 hover:bg-transparent",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Ua,{className:"w-4 h-4"})}),i.jsx(We,{children:i.jsx("p",{children:w("catalog.filter.badget_remove_tooltip")})})]}),i.jsx("span",{className:"sr-only",children:w("catalog.filter.badget_remove_tooltip")})]})]},E)),i.jsxs("div",{className:"flex-1 flex items-center min-w-[300px]",children:[i.jsx("input",{ref:p,value:x,onChange:E=>v(E.target.value),onKeyDown:R,placeholder:w("common.filter.input_placeholder"),className:"flex-1 w-full h-8 bg-transparent outline-none placeholder:text-muted-foreground"}),i.jsxs(tr,{children:[c&&i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3 text-primary",children:[i.jsx(Ua,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})}),i.jsx(We,{children:i.jsx("p",{children:w("common.filter.reset_filter")})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"default",size:"icon",disabled:!x,onClick:b,className:"w-8 h-8 p-0 transition-all",children:[i.jsx(yo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.filter.button_add_term")})]})}),i.jsx(We,{children:i.jsx("p",{children:w("common.filter.button_add_term_tooltip")})})]})]})]})]})]}),i.jsx("p",{className:"text-sm text-muted-foreground",children:w("common.filter.help_text")})]})})}const jw=()=>{const n=zt(),{pagination:a,globalFilter:r,isFiltered:o}=Tn(),{data:l,isPending:c,isError:d,error:h}=zd({pagination:{pageIndex:a.pageIndex,pageSize:a.pageSize},searchTerm:r}),p=M.useMemo(()=>[{id:"id",accessorKey:"id"},{id:"id_article",accessorKey:"id_article"},{id:"catalog_name",accessorKey:"catalog_name"},{id:"description",accessorKey:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})},{id:"points",accessorKey:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:v})=>i.jsx("div",{className:"text-right",children:v()})},{id:"retail_price",accessorKey:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:v})=>{const R=Tt.create(v.original.retail_price).object;return i.jsx("div",{className:"text-right",children:R.toFormat()})}}],[]),{table:x}=os({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1,initialState:{columnVisibility:{id:!1,id_article:!1,catalog_name:!1}}});return d?i.jsx(ur,{subtitle:h.message}):c?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!o?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(is,{table:x,paginationOptions:{visible:!0},children:i.jsx(Bd,{table:x})})},cS=()=>i.jsxs(nr,{children:[i.jsx("div",{className:"flex items-center justify-between space-y-2",children:i.jsx("div",{children:i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(le,{i18nKey:"catalog.list.title"})})})}),i.jsx(jw,{})]}),dS=()=>{const{data:n,status:a}=c0();return i.jsxs(zr,{children:[i.jsx(Br,{}),i.jsx(Vr,{children:a==="success"?i.jsx("div",{className:"flex items-center",children:i.jsx("h1",{className:"text-lg font-semibold md:text-2xl",children:`${w("dashboard.welcome")}, ${n==null?void 0:n.name}`})}):i.jsx(ut,{className:"w-[100px] h-[20px] rounded-full"})})]})},fS=({children:n})=>i.jsx(ts,{children:i.jsxs(zr,{className:"dealers-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})});function Cw({table:n}){return i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"sm",className:"hidden h-8 ml-auto lg:flex",children:[i.jsx(X0,{className:"w-4 h-4 mr-2"}),"Columnas"]})}),i.jsxs(Xi,{align:"end",className:"w-[150px]",children:[i.jsx(Lc,{children:"Columnas"}),i.jsx(io,{}),n.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>i.jsx(d0,{className:"capitalize",checked:a.getIsVisible(),onCheckedChange:r=>a.toggleVisibility(!!r),children:i.jsx(i.Fragment,{children:a.columnDef.header})},a.id))]})]})}function Vd({table:n,className:a,children:r,...o}){const{globalFilter:l,isFiltered:c,setGlobalFilter:d,resetGlobalFilter:h}=Tn(),p=x=>{const v=String(x.target.value);v===""?h():d([v])};return i.jsxs("div",{className:he("flex w-full items-center justify-between space-x-2 overflow-auto p-1",a),...o,children:[i.jsxs("div",{className:"flex items-center flex-1 space-x-2",children:[i.jsx(Vc,{className:"w-4 h-4 text-gray-500"}),i.jsx(Zi,{placeholder:w("common.filter.input_placeholder"),value:l,onChange:p,className:he("h-8 w-full transition-all")},"global-filter"),c&&i.jsxs(G,{variant:"outline",onClick:()=>h(),className:"h-8 px-2 transition-all lg:px-3",children:[i.jsx(Ua,{className:"w-4 h-4 mr-2"}),w("common.filter.reset_filter")]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[r,n.options.enableHiding&&i.jsx(Cw,{table:n})]})]})}const yw=n=>{const a=$r(),r=Mn(),{pagination:o,searchTerm:l=void 0,enabled:c=!0,queryOptions:d}=n;return No({queryKey:r().data().resource("dealer").action("list").params(n).get(),queryFn:()=>a.getList({resource:"dealers",quickSearchTerm:l,pagination:o}),enabled:c,queryOptions:d})},Nw=()=>{const n=zt(),{pagination:a,globalFilter:r,isFiltered:o}=Tn(),{data:l,isPending:c,isError:d,error:h}=yw({pagination:{pageIndex:a.pageIndex,pageSize:a.pageSize},searchTerm:r}),p=M.useMemo(()=>[{id:"id",accessorKey:"id",enableResizing:!1,size:10},{id:"name",accessorKey:"name",enableResizing:!1,size:10}],[]),{table:x}=os({data:(l==null?void 0:l.items)??[],columns:p,pageCount:(l==null?void 0:l.total_pages)??-1});return d?i.jsx(ur,{subtitle:h.message}):c?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}):(l==null?void 0:l.total_items)===0&&!o?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>n("/catalog/add")}):i.jsx(i.Fragment,{children:i.jsx(is,{table:x,paginationOptions:{visible:!0},children:i.jsx(Vd,{table:x})})})},gS=()=>i.jsx(nr,{children:i.jsx(Nw,{})}),mS=()=>i.jsx("div",{className:"flex min-h-[100dvh] flex-col items-center justify-center bg-background px-4 py-12 sm:px-6 lg:px-8",children:i.jsxs("div",{className:"max-w-md mx-auto text-center",children:[i.jsx("div",{className:"w-12 h-12 mx-auto text-primary"}),i.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground sm:text-4xl",children:"Oops, page not found!"}),i.jsx("p",{className:"mt-4 text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."}),i.jsx("div",{className:"mt-6",children:i.jsx(G,{className:"inline-flex items-center px-4 py-2 text-sm font-medium transition-colors rounded-md shadow-sm bg-primary text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:"Go to Homepage"})})]})}),Ud=M.createContext({attributes:{role:"button",tabIndex:0,"aria-disabled":!1,"aria-pressed":void 0,"aria-roledescription":"sortable","aria-describedby":""},listeners:void 0,ref(){},isDragging:!1});function Rw(n){return n.isSorting||n.wasDragging?g0(n):!0}function Ew({id:n,children:a,isActive:r=!1,onActivate:o}){const{attributes:l,isDragging:c,listeners:d,setNodeRef:h,setActivatorNodeRef:p,transform:x,transition:v}=f0({animateLayoutChanges:Rw,id:n}),R={transform:Ga.Translate.toString(x),transition:v},y=M.useMemo(()=>({attributes:l,listeners:d,ref:p,isDragging:c}),[l,c,d,p]);return i.jsx(Ud.Provider,{value:y,children:i.jsx(pn,{id:String(n),className:he(c?"opacity-60":"opacity-100",r?"border border-destructive/30 border-b-0 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5 focus-within:bg-destructive/5":"hover:bg-muted hover:focus-within:bg-accent focus-within:bg-accent","m-0"),ref:h,style:R,onClick:o,onFocusCapture:o,children:a},n)})}const Aw=({className:n})=>{const{attributes:a,isDragging:r,listeners:o,ref:l}=M.useContext(Ud);return i.jsxs(G,{ref:l,onClick:c=>{c.preventDefault()},size:"icon",variant:"link",className:he(r?"cursor-grabbing":"cursor-grab","w-4 h-4 mt-2 text-ring hover:text-muted-foreground",n),...a,...o,children:[i.jsx(hd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:w("common.move_row")})]})};function Iw(n,a={}){const{enableDragHandleColumn:r=!1,enableSelectionColumn:o=!1,enableActionsColumn:l=!1,rowActionFn:c=void 0}=a;return M.useMemo(()=>(r&&n.unshift({id:"row_drag_handle",header:()=>null,cell:()=>i.jsx(Aw,{}),enableSorting:!1,enableHiding:!1,size:40}),o&&n.unshift({id:"select",header:({table:d})=>i.jsx(Ui,{id:"select-all",checked:d.getIsAllPageRowsSelected()||d.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:h=>d.toggleAllPageRowsSelected(!!h),"aria-label":"Seleccionar todo",className:"translate-y-[0px]"}),cell:({row:d})=>i.jsx(Ui,{id:`select-row-${d.id}`,checked:d.getIsSelected(),disabled:!d.getCanSelect(),onCheckedChange:d.getToggleSelectedHandler(),"aria-label":"Seleccionar fila",className:"mt-2"}),enableSorting:!1,enableHiding:!1,size:40}),l&&n.push({id:"row_actions",cell:d=>i.jsx(lw,{rowContext:d,actions:c}),enableSorting:!1,enableHiding:!1,size:48}),n),[l,r,o])}var Gd={exports:{}};(function(n,a){(function(r,o,l){n.exports=l(),n.exports.default=l()})("slugify",Xn,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),o=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function l(c,d){if(typeof c!="string")throw new Error("slugify: string argument expected");d=typeof d=="string"?{replacement:d}:d||{};var h=o[d.locale]||{},p=d.replacement===void 0?"-":d.replacement,x=d.trim===void 0?!0:d.trim,v=c.normalize().split("").reduce(function(R,y){var b=h[y];return b===void 0&&(b=r[y]),b===void 0&&(b=y),b===p&&(b=" "),R+b.replace(d.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return d.strict&&(v=v.replace(/[^A-Za-z0-9\s]/g,"")),x&&(v=v.trim()),v=v.replace(/\s+/g,p),d.lower&&(v=v.toLowerCase()),v}return l.extend=function(c){Object.assign(r,c)},l})})(Gd);var Fw=Gd.exports;const Mw=m0(Fw),Ur=()=>{const n=$r(),a=Mn(),r=M.useCallback(c=>`${n.getApiUrl()}/quotes/${c}/report`,[n]),o=M.useCallback(c=>`quote-${Mw(c.reference,{lower:!0,strict:!0,locale:"en",trim:!0})}.pdf`,[]),l={useList:c=>{const d=$r(),h=Mn(),{pagination:p,status:x="draft",quickSearchTerm:v=void 0,enabled:R=!0,queryOptions:y}=c;return No({queryKey:h().data().resource("quotes").action("list").params(c).get(),queryFn:()=>d.getList({resource:"quotes",quickSearchTerm:v,filters:x!=="all"?[{field:"status",operator:"eq",value:x}]:[{field:"status",operator:"ne",value:"archived"}],pagination:p}),enabled:R,queryOptions:y})},useCreate:()=>{const c=Jt();return cb({mutationFn:d=>{const{date:h}=d,p=dn.generateNewID().object.toString();return n.createOne({resource:"quotes",data:{...d,date:new Date(h).toISOString().slice(0,10),status:"draft",id:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useUpdate:c=>{const d=Jt();return en({mutationKey:a().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>n.updateOne({resource:"quotes",id:c,data:h}),onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSetStatus:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h,newStatus:p}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/setStatus`,method:"put",data:{newStatus:p}})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useDuplicate:()=>{const c=Jt();return en({mutationFn:d=>{const{id:h}=d;return n.custom({url:`${n.getApiUrl()}/quotes/${h}/duplicate`,method:"post"})},onSuccess:()=>{c.invalidateQueries({queryKey:["data","default","quotes"]})}})},useSentTo:c=>{const d=Jt();return en({mutationKey:a().data().resource("quotes").action("one").id(c).params().get(),mutationFn:h=>{const{sent_date:p}=h;return n.custom({url:`${n.getApiUrl()}/quotes/${c}/send`,method:"put",data:{sent_date:p}})},onSuccess:()=>{d.invalidateQueries({queryKey:["data","default","quotes"]})}})},useOne:(c,d)=>wd({queryKey:a().data().resource("quotes").action("one").id(c).params().get(),queryFn:()=>n.getOne({resource:"quotes",id:String(c)}),enabled:!!c,...d}),getQuotePDFDownloadURL:r,getQuotePDFFilename:o,useReport:()=>{const c=n.getApiAuthorization(),[d,h]=M.useState(void 0),{download:p,...x}=Ec({headers:{Authorization:c},customHandleDownload:M.useCallback(R=>{const y=[R],b=new Blob(y,{type:"application/octet-stream"});return h(b),!0},[h])}),v=M.useCallback(R=>p(l.getQuotePDFDownloadURL(R),""),[p]);return{...x,preview:v,report:d}},useDownloader:()=>{const c=n.getApiAuthorization(),d=Ec({headers:{Authorization:c}});return{...d,download:(p,x)=>{const v=l.getQuotePDFDownloadURL(p);return d.download(v,x)}}}};return l},hS=()=>{const n=zt(),{toast:a}=_n(),{useCreate:r}=Ur(),{mutate:o,isPending:l}=r(),c=M.useMemo(()=>({date:new Date(Date.now()).toUTCString(),customer_reference:"",customer_information:""}),[]),d=Ji({mode:"onBlur",defaultValues:c,resolver:Pc(Fn.object({customer_reference:Fn.string(),date:Fn.date().required(),customer_information:Fn.string().required()}),{messages:{es:$d}})}),{formState:h,reset:p,getValues:x,handleSubmit:v}=d,{isSubmitting:R,isDirty:y}=h;Mo({isDirty:y});const b=async E=>{try{o(E,{onError:j=>{console.debug(j),a({title:"Error",description:j.message,variant:"destructive"})},onSuccess:j=>{p(x()),a({title:"Cotización creada",variant:"default"}),n(`/quotes/edit/${j.id}`,{relative:"path"})}})}finally{}};return R?i.jsx(Dn,{title:"Guardando ajustes"}):l?i.jsx(Dn,{}):i.jsx(es,{...d,children:i.jsx("form",{onSubmit:v(b),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Uc,{}),i.jsx("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:w("quotes.create.title")})]}),i.jsx("div",{className:"grid w-6/12 gap-6 mx-auto",children:i.jsxs(Ha,{className:"md:col-span-4",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),footerActions:i.jsxs("div",{className:"flex items-stretch justify-between flex-1",children:[i.jsx(G,{size:"sm",variant:"outline",onClick:()=>n("/quotes"),children:w("common.discard")}),i.jsx(wo,{size:"sm",label:w("common.continue")})]}),children:[i.jsx(mn,{required:!0,name:"customer_reference",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),placeholder:w("quotes.form_fields.customer_reference.placeholder")}),i.jsx(Gc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(hn,{}),i.jsx(qt,{rows:4,className:"row-span-2",name:"customer_information",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),placeholder:w("quotes.form_fields.customer_information.placeholder")})]})})]})})})},Va=(n,a=!1)=>{const{discount:r,tax:o,subtotal_price:l}=n||{},c=$t.create(r||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=$t.create(o||{amount:null,scale:2});if(h.isFailure)throw h.error;const p=h.object,x=Tt.create(l||{amount:null,scale:2});if(x.isFailure)throw x.error;const v=a?Dw(n.items).convertScale(2):x.object,R=v.percentage(d.toNumber()).convertScale(2),y=v.subtract(R).convertScale(2),b=y.percentage(p.toNumber()).convertScale(2),E=y.add(b).convertScale(2);return{subtotal_price:v,discount:n.discount,discount_price:R,before_tax_price:y,tax:p,tax_price:b,total_price:E}},Dw=n=>{let a=Tt.create({amount:0,scale:2}).object;return n&&n.map(r=>{const o=eo(r);a=a.add(o.total_price)}),a},eo=n=>{const{quantity:a,unit_price:r,discount:o}=n||{};if((!a||a&&a.amount===null)&&(!r||r&&r.amount===null)&&(!o||o&&o.amount===null))return{quantity:xn.create({amount:null,scale:0}).object,unit_price:Tt.create({amount:null,scale:2}).object,subtotal_price:Tt.create({amount:null,scale:2}).object,discount:$t.create({amount:null,scale:2}).object,total_price:Tt.create({amount:null,scale:2}).object};const l=xn.create(a);if(l.isFailure)throw l.error;const c=l.object,d=Tt.create(r);if(d.isFailure)throw d.error;const h=d.object,p=$t.create(o);if(p.isFailure)throw p.error;const x=p.object,v=h.multiply(c.toNumber()),R=v.subtract(v.percentage(x.toNumber()));return{quantity:c,unit_price:h,subtotal_price:v,discount:x,total_price:R}},Tw=()=>{const{id:n}=h0();return n};var Ki={exports:{}};/** - * @license - * Lodash - * Copyright OpenJS Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Ki.exports;(function(n,a){(function(){var r,o="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",h="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",x=500,v="__lodash_placeholder__",R=1,y=2,b=4,E=1,j=2,D=1,F=2,q=4,$=8,Q=16,O=32,k=64,H=128,W=256,B=512,se=30,ce="...",Y=800,Re=16,rt=1,ee=2,je=3,Me=1/0,U=9007199254740991,be=17976931348623157e292,Je=NaN,it=4294967295,bn=it-1,Qd=it>>>1,Xd=[["ary",H],["bind",D],["bindKey",F],["curry",$],["curryRight",Q],["flip",B],["partial",O],["partialRight",k],["rearg",W]],Ln="[object Arguments]",Gr="[object Array]",Zd="[object AsyncFunction]",dr="[object Boolean]",fr="[object Date]",Jd="[object DOMException]",Hr="[object Error]",Kr="[object Function]",Oo="[object GeneratorFunction]",Rt="[object Map]",gr="[object Number]",ef="[object Null]",Bt="[object Object]",Po="[object Promise]",tf="[object Proxy]",mr="[object RegExp]",Et="[object Set]",hr="[object String]",Wr="[object Symbol]",nf="[object Undefined]",pr="[object WeakMap]",rf="[object WeakSet]",xr="[object ArrayBuffer]",On="[object DataView]",ls="[object Float32Array]",us="[object Float64Array]",cs="[object Int8Array]",ds="[object Int16Array]",fs="[object Int32Array]",gs="[object Uint8Array]",ms="[object Uint8ClampedArray]",hs="[object Uint16Array]",ps="[object Uint32Array]",sf=/\b__p \+= '';/g,af=/\b(__p \+=) '' \+/g,of=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ko=/&(?:amp|lt|gt|quot|#39);/g,qo=/[&<>"']/g,lf=RegExp(ko.source),uf=RegExp(qo.source),cf=/<%-([\s\S]+?)%>/g,df=/<%([\s\S]+?)%>/g,$o=/<%=([\s\S]+?)%>/g,ff=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,gf=/^\w*$/,mf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xs=/[\\^$.*+?()[\]{}|]/g,hf=RegExp(xs.source),vs=/^\s+/,pf=/\s/,xf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vf=/\{\n\/\* \[wrapped with (.+)\] \*/,_f=/,? & /,bf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wf=/[()=,{}\[\]\/\s]/,Sf=/\\(\\)?/g,jf=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zo=/\w*$/,Cf=/^[-+]0x[0-9a-f]+$/i,yf=/^0b[01]+$/i,Nf=/^\[object .+?Constructor\]$/,Rf=/^0o[0-7]+$/i,Ef=/^(?:0|[1-9]\d*)$/,Af=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yr=/($^)/,If=/['\n\r\u2028\u2029\\]/g,Qr="\\ud800-\\udfff",Ff="\\u0300-\\u036f",Mf="\\ufe20-\\ufe2f",Df="\\u20d0-\\u20ff",Bo=Ff+Mf+Df,Vo="\\u2700-\\u27bf",Uo="a-z\\xdf-\\xf6\\xf8-\\xff",Tf="\\xac\\xb1\\xd7\\xf7",Lf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Of="\\u2000-\\u206f",Pf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Go="A-Z\\xc0-\\xd6\\xd8-\\xde",Ho="\\ufe0e\\ufe0f",Ko=Tf+Lf+Of+Pf,_s="['’]",kf="["+Qr+"]",Wo="["+Ko+"]",Xr="["+Bo+"]",Yo="\\d+",qf="["+Vo+"]",Qo="["+Uo+"]",Xo="[^"+Qr+Ko+Yo+Vo+Uo+Go+"]",bs="\\ud83c[\\udffb-\\udfff]",$f="(?:"+Xr+"|"+bs+")",Zo="[^"+Qr+"]",ws="(?:\\ud83c[\\udde6-\\uddff]){2}",Ss="[\\ud800-\\udbff][\\udc00-\\udfff]",Pn="["+Go+"]",Jo="\\u200d",el="(?:"+Qo+"|"+Xo+")",zf="(?:"+Pn+"|"+Xo+")",tl="(?:"+_s+"(?:d|ll|m|re|s|t|ve))?",nl="(?:"+_s+"(?:D|LL|M|RE|S|T|VE))?",rl=$f+"?",il="["+Ho+"]?",Bf="(?:"+Jo+"(?:"+[Zo,ws,Ss].join("|")+")"+il+rl+")*",Vf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Uf="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",sl=il+rl+Bf,Gf="(?:"+[qf,ws,Ss].join("|")+")"+sl,Hf="(?:"+[Zo+Xr+"?",Xr,ws,Ss,kf].join("|")+")",Kf=RegExp(_s,"g"),Wf=RegExp(Xr,"g"),js=RegExp(bs+"(?="+bs+")|"+Hf+sl,"g"),Yf=RegExp([Pn+"?"+Qo+"+"+tl+"(?="+[Wo,Pn,"$"].join("|")+")",zf+"+"+nl+"(?="+[Wo,Pn+el,"$"].join("|")+")",Pn+"?"+el+"+"+tl,Pn+"+"+nl,Uf,Vf,Yo,Gf].join("|"),"g"),Qf=RegExp("["+Jo+Qr+Bo+Ho+"]"),Xf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Zf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Jf=-1,ye={};ye[ls]=ye[us]=ye[cs]=ye[ds]=ye[fs]=ye[gs]=ye[ms]=ye[hs]=ye[ps]=!0,ye[Ln]=ye[Gr]=ye[xr]=ye[dr]=ye[On]=ye[fr]=ye[Hr]=ye[Kr]=ye[Rt]=ye[gr]=ye[Bt]=ye[mr]=ye[Et]=ye[hr]=ye[pr]=!1;var Ce={};Ce[Ln]=Ce[Gr]=Ce[xr]=Ce[On]=Ce[dr]=Ce[fr]=Ce[ls]=Ce[us]=Ce[cs]=Ce[ds]=Ce[fs]=Ce[Rt]=Ce[gr]=Ce[Bt]=Ce[mr]=Ce[Et]=Ce[hr]=Ce[Wr]=Ce[gs]=Ce[ms]=Ce[hs]=Ce[ps]=!0,Ce[Hr]=Ce[Kr]=Ce[pr]=!1;var eg={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},tg={"&":"&","<":"<",">":">",'"':""","'":"'"},ng={"&":"&","<":"<",">":">",""":'"',"'":"'"},rg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ig=parseFloat,sg=parseInt,al=typeof Xn=="object"&&Xn&&Xn.Object===Object&&Xn,ag=typeof self=="object"&&self&&self.Object===Object&&self,Be=al||ag||Function("return this")(),Cs=a&&!a.nodeType&&a,wn=Cs&&!0&&n&&!n.nodeType&&n,ol=wn&&wn.exports===Cs,ys=ol&&al.process,vt=function(){try{var C=wn&&wn.require&&wn.require("util").types;return C||ys&&ys.binding&&ys.binding("util")}catch{}}(),ll=vt&&vt.isArrayBuffer,ul=vt&&vt.isDate,cl=vt&&vt.isMap,dl=vt&&vt.isRegExp,fl=vt&&vt.isSet,gl=vt&&vt.isTypedArray;function ct(C,I,A){switch(A.length){case 0:return C.call(I);case 1:return C.call(I,A[0]);case 2:return C.call(I,A[0],A[1]);case 3:return C.call(I,A[0],A[1],A[2])}return C.apply(I,A)}function og(C,I,A,V){for(var re=-1,me=C==null?0:C.length;++re-1}function Ns(C,I,A){for(var V=-1,re=C==null?0:C.length;++V-1;);return A}function wl(C,I){for(var A=C.length;A--&&kn(I,C[A],0)>-1;);return A}function pg(C,I){for(var A=C.length,V=0;A--;)C[A]===I&&++V;return V}var xg=Is(eg),vg=Is(tg);function _g(C){return"\\"+rg[C]}function bg(C,I){return C==null?r:C[I]}function qn(C){return Qf.test(C)}function wg(C){return Xf.test(C)}function Sg(C){for(var I,A=[];!(I=C.next()).done;)A.push(I.value);return A}function Ts(C){var I=-1,A=Array(C.size);return C.forEach(function(V,re){A[++I]=[re,V]}),A}function Sl(C,I){return function(A){return C(I(A))}}function rn(C,I){for(var A=-1,V=C.length,re=0,me=[];++A-1}function um(e,t){var s=this.__data__,u=hi(s,e);return u<0?(++this.size,s.push([e,t])):s[u][1]=t,this}Vt.prototype.clear=sm,Vt.prototype.delete=am,Vt.prototype.get=om,Vt.prototype.has=lm,Vt.prototype.set=um;function Ut(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function St(e,t,s,u,f,m){var _,S=t&R,N=t&y,T=t&b;if(s&&(_=f?s(e,u,f,m):s(e)),_!==r)return _;if(!Ae(e))return e;var L=ie(e);if(L){if(_=gh(e),!S)return st(e,_)}else{var P=Qe(e),z=P==Kr||P==Oo;if(cn(e))return iu(e,S);if(P==Bt||P==Ln||z&&!f){if(_=N||z?{}:ju(e),!S)return N?nh(e,ym(_,e)):th(e,Tl(_,e))}else{if(!Ce[P])return f?e:{};_=mh(e,P,S)}}m||(m=new It);var K=m.get(e);if(K)return K;m.set(e,_),Zu(e)?e.forEach(function(ne){_.add(St(ne,t,s,ne,e,m))}):Qu(e)&&e.forEach(function(ne,de){_.set(de,St(ne,t,s,de,e,m))});var te=T?N?aa:sa:N?ot:ze,oe=L?r:te(e);return _t(oe||e,function(ne,de){oe&&(de=ne,ne=e[de]),Cr(_,de,St(ne,t,s,de,e,m))}),_}function Nm(e){var t=ze(e);return function(s){return Ll(s,e,t)}}function Ll(e,t,s){var u=s.length;if(e==null)return!u;for(e=we(e);u--;){var f=s[u],m=t[f],_=e[f];if(_===r&&!(f in e)||!m(_))return!1}return!0}function Ol(e,t,s){if(typeof e!="function")throw new bt(d);return Fr(function(){e.apply(r,s)},t)}function yr(e,t,s,u){var f=-1,m=Zr,_=!0,S=e.length,N=[],T=t.length;if(!S)return N;s&&(t=Ee(t,dt(s))),u?(m=Ns,_=!1):t.length>=l&&(m=vr,_=!1,t=new Cn(t));e:for(;++ff?0:f+s),u=u===r||u>f?f:ae(u),u<0&&(u+=f),u=s>u?0:ec(u);s0&&s(S)?t>1?Ve(S,t-1,s,u,f):nn(f,S):u||(f[f.length]=S)}return f}var zs=cu(),ql=cu(!0);function Ot(e,t){return e&&zs(e,t,ze)}function Bs(e,t){return e&&ql(e,t,ze)}function xi(e,t){return tn(t,function(s){return Yt(e[s])})}function Nn(e,t){t=ln(t,e);for(var s=0,u=t.length;e!=null&&st}function Am(e,t){return e!=null&&xe.call(e,t)}function Im(e,t){return e!=null&&t in we(e)}function Fm(e,t,s){return e>=Ye(t,s)&&e<$e(t,s)}function Us(e,t,s){for(var u=s?Ns:Zr,f=e[0].length,m=e.length,_=m,S=A(m),N=1/0,T=[];_--;){var L=e[_];_&&t&&(L=Ee(L,dt(t))),N=Ye(L.length,N),S[_]=!s&&(t||f>=120&&L.length>=120)?new Cn(_&&L):r}L=e[0];var P=-1,z=S[0];e:for(;++P-1;)S!==e&&li.call(S,N,1),li.call(e,N,1);return e}function Ql(e,t){for(var s=e?t.length:0,u=s-1;s--;){var f=t[s];if(s==u||f!==m){var m=f;Wt(f)?li.call(e,f,1):Zs(e,f)}}return e}function Ys(e,t){return e+di(Il()*(t-e+1))}function Um(e,t,s,u){for(var f=-1,m=$e(ci((t-e)/(s||1)),0),_=A(m);m--;)_[u?m:++f]=e,e+=s;return _}function Qs(e,t){var s="";if(!e||t<1||t>U)return s;do t%2&&(s+=e),t=di(t/2),t&&(e+=e);while(t);return s}function ue(e,t){return ga(Nu(e,t,lt),e+"")}function Gm(e){return Dl(Qn(e))}function Hm(e,t){var s=Qn(e);return Ei(s,yn(t,0,s.length))}function Er(e,t,s,u){if(!Ae(e))return e;t=ln(t,e);for(var f=-1,m=t.length,_=m-1,S=e;S!=null&&++ff?0:f+t),s=s>f?f:s,s<0&&(s+=f),f=t>s?0:s-t>>>0,t>>>=0;for(var m=A(f);++u>>1,_=e[m];_!==null&&!gt(_)&&(s?_<=t:_=l){var T=t?null:ah(e);if(T)return ei(T);_=!1,f=vr,N=new Cn}else N=t?[]:S;e:for(;++u=u?e:jt(e,t,s)}var ru=Pg||function(e){return Be.clearTimeout(e)};function iu(e,t){if(t)return e.slice();var s=e.length,u=yl?yl(s):new e.constructor(s);return e.copy(u),u}function na(e){var t=new e.constructor(e.byteLength);return new ai(t).set(new ai(e)),t}function Xm(e,t){var s=t?na(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function Zm(e){var t=new e.constructor(e.source,zo.exec(e));return t.lastIndex=e.lastIndex,t}function Jm(e){return jr?we(jr.call(e)):{}}function su(e,t){var s=t?na(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function au(e,t){if(e!==t){var s=e!==r,u=e===null,f=e===e,m=gt(e),_=t!==r,S=t===null,N=t===t,T=gt(t);if(!S&&!T&&!m&&e>t||m&&_&&N&&!S&&!T||u&&_&&N||!s&&N||!f)return 1;if(!u&&!m&&!T&&e=S)return N;var T=s[u];return N*(T=="desc"?-1:1)}}return e.index-t.index}function ou(e,t,s,u){for(var f=-1,m=e.length,_=s.length,S=-1,N=t.length,T=$e(m-_,0),L=A(N+T),P=!u;++S1?s[f-1]:r,_=f>2?s[2]:r;for(m=e.length>3&&typeof m=="function"?(f--,m):r,_&&tt(s[0],s[1],_)&&(m=f<3?r:m,f=1),t=we(t);++u-1?f[m?t[_]:_]:r}}function gu(e){return Kt(function(t){var s=t.length,u=s,f=wt.prototype.thru;for(e&&t.reverse();u--;){var m=t[u];if(typeof m!="function")throw new bt(d);if(f&&!_&&Ni(m)=="wrapper")var _=new wt([],!0)}for(u=_?u:s;++u1&&ge.reverse(),L&&NS))return!1;var T=m.get(e),L=m.get(t);if(T&&L)return T==t&&L==e;var P=-1,z=!0,K=s&j?new Cn:r;for(m.set(e,t),m.set(t,e);++P1?"& ":"")+t[u],t=t.join(s>2?", ":" "),e.replace(xf,`{ -/* [wrapped with `+t+`] */ -`)}function ph(e){return ie(e)||An(e)||!!(El&&e&&e[El])}function Wt(e,t){var s=typeof e;return t=t??U,!!t&&(s=="number"||s!="symbol"&&Ef.test(e))&&e>-1&&e%1==0&&e0){if(++t>=Y)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ei(e,t){var s=-1,u=e.length,f=u-1;for(t=t===r?u:t;++s1?e[t-1]:r;return s=typeof s=="function"?(e.pop(),s):r,ku(e,s)});function qu(e){var t=g(e);return t.__chain__=!0,t}function Rp(e,t){return t(e),e}function Ai(e,t){return t(e)}var Ep=Kt(function(e){var t=e.length,s=t?e[0]:0,u=this.__wrapped__,f=function(m){return $s(m,e)};return t>1||this.__actions__.length||!(u instanceof fe)||!Wt(s)?this.thru(f):(u=u.slice(s,+s+(t?1:0)),u.__actions__.push({func:Ai,args:[f],thisArg:r}),new wt(u,this.__chain__).thru(function(m){return t&&!m.length&&m.push(r),m}))});function Ap(){return qu(this)}function Ip(){return new wt(this.value(),this.__chain__)}function Fp(){this.__values__===r&&(this.__values__=Ju(this.value()));var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function Mp(){return this}function Dp(e){for(var t,s=this;s instanceof mi;){var u=Mu(s);u.__index__=0,u.__values__=r,t?f.__wrapped__=u:t=u;var f=u;s=s.__wrapped__}return f.__wrapped__=e,t}function Tp(){var e=this.__wrapped__;if(e instanceof fe){var t=e;return this.__actions__.length&&(t=new fe(this)),t=t.reverse(),t.__actions__.push({func:Ai,args:[ma],thisArg:r}),new wt(t,this.__chain__)}return this.thru(ma)}function Lp(){return tu(this.__wrapped__,this.__actions__)}var Op=wi(function(e,t,s){xe.call(e,s)?++e[s]:Gt(e,s,1)});function Pp(e,t,s){var u=ie(e)?ml:Rm;return s&&tt(e,t,s)&&(t=r),u(e,X(t,3))}function kp(e,t){var s=ie(e)?tn:kl;return s(e,X(t,3))}var qp=fu(Du),$p=fu(Tu);function zp(e,t){return Ve(Ii(e,t),1)}function Bp(e,t){return Ve(Ii(e,t),Me)}function Vp(e,t,s){return s=s===r?1:ae(s),Ve(Ii(e,t),s)}function $u(e,t){var s=ie(e)?_t:an;return s(e,X(t,3))}function zu(e,t){var s=ie(e)?lg:Pl;return s(e,X(t,3))}var Up=wi(function(e,t,s){xe.call(e,s)?e[s].push(t):Gt(e,s,[t])});function Gp(e,t,s,u){e=at(e)?e:Qn(e),s=s&&!u?ae(s):0;var f=e.length;return s<0&&(s=$e(f+s,0)),Li(e)?s<=f&&e.indexOf(t,s)>-1:!!f&&kn(e,t,s)>-1}var Hp=ue(function(e,t,s){var u=-1,f=typeof t=="function",m=at(e)?A(e.length):[];return an(e,function(_){m[++u]=f?ct(t,_,s):Nr(_,t,s)}),m}),Kp=wi(function(e,t,s){Gt(e,s,t)});function Ii(e,t){var s=ie(e)?Ee:Ul;return s(e,X(t,3))}function Wp(e,t,s,u){return e==null?[]:(ie(t)||(t=t==null?[]:[t]),s=u?r:s,ie(s)||(s=s==null?[]:[s]),Wl(e,t,s))}var Yp=wi(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function Qp(e,t,s){var u=ie(e)?Rs:vl,f=arguments.length<3;return u(e,X(t,4),s,f,an)}function Xp(e,t,s){var u=ie(e)?ug:vl,f=arguments.length<3;return u(e,X(t,4),s,f,Pl)}function Zp(e,t){var s=ie(e)?tn:kl;return s(e,Di(X(t,3)))}function Jp(e){var t=ie(e)?Dl:Gm;return t(e)}function ex(e,t,s){(s?tt(e,t,s):t===r)?t=1:t=ae(t);var u=ie(e)?Sm:Hm;return u(e,t)}function tx(e){var t=ie(e)?jm:Wm;return t(e)}function nx(e){if(e==null)return 0;if(at(e))return Li(e)?$n(e):e.length;var t=Qe(e);return t==Rt||t==Et?e.size:Hs(e).length}function rx(e,t,s){var u=ie(e)?Es:Ym;return s&&tt(e,t,s)&&(t=r),u(e,X(t,3))}var ix=ue(function(e,t){if(e==null)return[];var s=t.length;return s>1&&tt(e,t[0],t[1])?t=[]:s>2&&tt(t[0],t[1],t[2])&&(t=[t[0]]),Wl(e,Ve(t,1),[])}),Fi=kg||function(){return Be.Date.now()};function sx(e,t){if(typeof t!="function")throw new bt(d);return e=ae(e),function(){if(--e<1)return t.apply(this,arguments)}}function Bu(e,t,s){return t=s?r:t,t=e&&t==null?e.length:t,Ht(e,H,r,r,r,r,t)}function Vu(e,t){var s;if(typeof t!="function")throw new bt(d);return e=ae(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=r),s}}var pa=ue(function(e,t,s){var u=D;if(s.length){var f=rn(s,Wn(pa));u|=O}return Ht(e,u,t,s,f)}),Uu=ue(function(e,t,s){var u=D|F;if(s.length){var f=rn(s,Wn(Uu));u|=O}return Ht(t,u,e,s,f)});function Gu(e,t,s){t=s?r:t;var u=Ht(e,$,r,r,r,r,r,t);return u.placeholder=Gu.placeholder,u}function Hu(e,t,s){t=s?r:t;var u=Ht(e,Q,r,r,r,r,r,t);return u.placeholder=Hu.placeholder,u}function Ku(e,t,s){var u,f,m,_,S,N,T=0,L=!1,P=!1,z=!0;if(typeof e!="function")throw new bt(d);t=yt(t)||0,Ae(s)&&(L=!!s.leading,P="maxWait"in s,m=P?$e(yt(s.maxWait)||0,t):m,z="trailing"in s?!!s.trailing:z);function K(Te){var Mt=u,Xt=f;return u=f=r,T=Te,_=e.apply(Xt,Mt),_}function te(Te){return T=Te,S=Fr(de,t),L?K(Te):_}function oe(Te){var Mt=Te-N,Xt=Te-T,fc=t-Mt;return P?Ye(fc,m-Xt):fc}function ne(Te){var Mt=Te-N,Xt=Te-T;return N===r||Mt>=t||Mt<0||P&&Xt>=m}function de(){var Te=Fi();if(ne(Te))return ge(Te);S=Fr(de,oe(Te))}function ge(Te){return S=r,z&&u?K(Te):(u=f=r,_)}function mt(){S!==r&&ru(S),T=0,u=N=f=S=r}function nt(){return S===r?_:ge(Fi())}function ht(){var Te=Fi(),Mt=ne(Te);if(u=arguments,f=this,N=Te,Mt){if(S===r)return te(N);if(P)return ru(S),S=Fr(de,t),K(N)}return S===r&&(S=Fr(de,t)),_}return ht.cancel=mt,ht.flush=nt,ht}var ax=ue(function(e,t){return Ol(e,1,t)}),ox=ue(function(e,t,s){return Ol(e,yt(t)||0,s)});function lx(e){return Ht(e,B)}function Mi(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new bt(d);var s=function(){var u=arguments,f=t?t.apply(this,u):u[0],m=s.cache;if(m.has(f))return m.get(f);var _=e.apply(this,u);return s.cache=m.set(f,_)||m,_};return s.cache=new(Mi.Cache||Ut),s}Mi.Cache=Ut;function Di(e){if(typeof e!="function")throw new bt(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function ux(e){return Vu(2,e)}var cx=Qm(function(e,t){t=t.length==1&&ie(t[0])?Ee(t[0],dt(X())):Ee(Ve(t,1),dt(X()));var s=t.length;return ue(function(u){for(var f=-1,m=Ye(u.length,s);++f=t}),An=zl(function(){return arguments}())?zl:function(e){return Ie(e)&&xe.call(e,"callee")&&!Rl.call(e,"callee")},ie=A.isArray,yx=ll?dt(ll):Dm;function at(e){return e!=null&&Ti(e.length)&&!Yt(e)}function De(e){return Ie(e)&&at(e)}function Nx(e){return e===!0||e===!1||Ie(e)&&et(e)==dr}var cn=$g||Ea,Rx=ul?dt(ul):Tm;function Ex(e){return Ie(e)&&e.nodeType===1&&!Mr(e)}function Ax(e){if(e==null)return!0;if(at(e)&&(ie(e)||typeof e=="string"||typeof e.splice=="function"||cn(e)||Yn(e)||An(e)))return!e.length;var t=Qe(e);if(t==Rt||t==Et)return!e.size;if(Ir(e))return!Hs(e).length;for(var s in e)if(xe.call(e,s))return!1;return!0}function Ix(e,t){return Rr(e,t)}function Fx(e,t,s){s=typeof s=="function"?s:r;var u=s?s(e,t):r;return u===r?Rr(e,t,r,s):!!u}function va(e){if(!Ie(e))return!1;var t=et(e);return t==Hr||t==Jd||typeof e.message=="string"&&typeof e.name=="string"&&!Mr(e)}function Mx(e){return typeof e=="number"&&Al(e)}function Yt(e){if(!Ae(e))return!1;var t=et(e);return t==Kr||t==Oo||t==Zd||t==tf}function Yu(e){return typeof e=="number"&&e==ae(e)}function Ti(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=U}function Ae(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function Ie(e){return e!=null&&typeof e=="object"}var Qu=cl?dt(cl):Om;function Dx(e,t){return e===t||Gs(e,t,la(t))}function Tx(e,t,s){return s=typeof s=="function"?s:r,Gs(e,t,la(t),s)}function Lx(e){return Xu(e)&&e!=+e}function Ox(e){if(_h(e))throw new re(c);return Bl(e)}function Px(e){return e===null}function kx(e){return e==null}function Xu(e){return typeof e=="number"||Ie(e)&&et(e)==gr}function Mr(e){if(!Ie(e)||et(e)!=Bt)return!1;var t=oi(e);if(t===null)return!0;var s=xe.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&ri.call(s)==Tg}var _a=dl?dt(dl):Pm;function qx(e){return Yu(e)&&e>=-9007199254740991&&e<=U}var Zu=fl?dt(fl):km;function Li(e){return typeof e=="string"||!ie(e)&&Ie(e)&&et(e)==hr}function gt(e){return typeof e=="symbol"||Ie(e)&&et(e)==Wr}var Yn=gl?dt(gl):qm;function $x(e){return e===r}function zx(e){return Ie(e)&&Qe(e)==pr}function Bx(e){return Ie(e)&&et(e)==rf}var Vx=yi(Ks),Ux=yi(function(e,t){return e<=t});function Ju(e){if(!e)return[];if(at(e))return Li(e)?At(e):st(e);if(_r&&e[_r])return Sg(e[_r]());var t=Qe(e),s=t==Rt?Ts:t==Et?ei:Qn;return s(e)}function Qt(e){if(!e)return e===0?e:0;if(e=yt(e),e===Me||e===-1/0){var t=e<0?-1:1;return t*be}return e===e?e:0}function ae(e){var t=Qt(e),s=t%1;return t===t?s?t-s:t:0}function ec(e){return e?yn(ae(e),0,it):0}function yt(e){if(typeof e=="number")return e;if(gt(e))return Je;if(Ae(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ae(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=_l(e);var s=yf.test(e);return s||Rf.test(e)?sg(e.slice(2),s?2:8):Cf.test(e)?Je:+e}function tc(e){return Pt(e,ot(e))}function Gx(e){return e?yn(ae(e),-9007199254740991,U):e===0?e:0}function pe(e){return e==null?"":ft(e)}var Hx=Hn(function(e,t){if(Ir(t)||at(t)){Pt(t,ze(t),e);return}for(var s in t)xe.call(t,s)&&Cr(e,s,t[s])}),nc=Hn(function(e,t){Pt(t,ot(t),e)}),Oi=Hn(function(e,t,s,u){Pt(t,ot(t),e,u)}),Kx=Hn(function(e,t,s,u){Pt(t,ze(t),e,u)}),Wx=Kt($s);function Yx(e,t){var s=Gn(e);return t==null?s:Tl(s,t)}var Qx=ue(function(e,t){e=we(e);var s=-1,u=t.length,f=u>2?t[2]:r;for(f&&tt(t[0],t[1],f)&&(u=1);++s1),m}),Pt(e,aa(e),s),u&&(s=St(s,R|y|b,oh));for(var f=t.length;f--;)Zs(s,t[f]);return s});function mv(e,t){return ic(e,Di(X(t)))}var hv=Kt(function(e,t){return e==null?{}:Bm(e,t)});function ic(e,t){if(e==null)return{};var s=Ee(aa(e),function(u){return[u]});return t=X(t),Yl(e,s,function(u,f){return t(u,f[0])})}function pv(e,t,s){t=ln(t,e);var u=-1,f=t.length;for(f||(f=1,e=r);++ut){var u=e;e=t,t=u}if(s||e%1||t%1){var f=Il();return Ye(e+f*(t-e+ig("1e-"+((f+"").length-1))),t)}return Ys(e,t)}var Rv=Kn(function(e,t,s){return t=t.toLowerCase(),e+(s?oc(t):t)});function oc(e){return Sa(pe(e).toLowerCase())}function lc(e){return e=pe(e),e&&e.replace(Af,xg).replace(Wf,"")}function Ev(e,t,s){e=pe(e),t=ft(t);var u=e.length;s=s===r?u:yn(ae(s),0,u);var f=s;return s-=t.length,s>=0&&e.slice(s,f)==t}function Av(e){return e=pe(e),e&&uf.test(e)?e.replace(qo,vg):e}function Iv(e){return e=pe(e),e&&hf.test(e)?e.replace(xs,"\\$&"):e}var Fv=Kn(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),Mv=Kn(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Dv=du("toLowerCase");function Tv(e,t,s){e=pe(e),t=ae(t);var u=t?$n(e):0;if(!t||u>=t)return e;var f=(t-u)/2;return Ci(di(f),s)+e+Ci(ci(f),s)}function Lv(e,t,s){e=pe(e),t=ae(t);var u=t?$n(e):0;return t&&u>>0,s?(e=pe(e),e&&(typeof t=="string"||t!=null&&!_a(t))&&(t=ft(t),!t&&qn(e))?un(At(e),0,s):e.split(t,s)):[]}var Bv=Kn(function(e,t,s){return e+(s?" ":"")+Sa(t)});function Vv(e,t,s){return e=pe(e),s=s==null?0:yn(ae(s),0,e.length),t=ft(t),e.slice(s,s+t.length)==t}function Uv(e,t,s){var u=g.templateSettings;s&&tt(e,t,s)&&(t=r),e=pe(e),t=Oi({},t,u,vu);var f=Oi({},t.imports,u.imports,vu),m=ze(f),_=Ds(f,m),S,N,T=0,L=t.interpolate||Yr,P="__p += '",z=Ls((t.escape||Yr).source+"|"+L.source+"|"+(L===$o?jf:Yr).source+"|"+(t.evaluate||Yr).source+"|$","g"),K="//# sourceURL="+(xe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Jf+"]")+` -`;e.replace(z,function(ne,de,ge,mt,nt,ht){return ge||(ge=mt),P+=e.slice(T,ht).replace(If,_g),de&&(S=!0,P+=`' + -__e(`+de+`) + -'`),nt&&(N=!0,P+=`'; -`+nt+`; -__p += '`),ge&&(P+=`' + -((__t = (`+ge+`)) == null ? '' : __t) + -'`),T=ht+ne.length,ne}),P+=`'; -`;var te=xe.call(t,"variable")&&t.variable;if(!te)P=`with (obj) { -`+P+` -} -`;else if(wf.test(te))throw new re(h);P=(N?P.replace(sf,""):P).replace(af,"$1").replace(of,"$1;"),P="function("+(te||"obj")+`) { -`+(te?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(N?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+P+`return __p -}`;var oe=cc(function(){return me(m,K+"return "+P).apply(r,_)});if(oe.source=P,va(oe))throw oe;return oe}function Gv(e){return pe(e).toLowerCase()}function Hv(e){return pe(e).toUpperCase()}function Kv(e,t,s){if(e=pe(e),e&&(s||t===r))return _l(e);if(!e||!(t=ft(t)))return e;var u=At(e),f=At(t),m=bl(u,f),_=wl(u,f)+1;return un(u,m,_).join("")}function Wv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.slice(0,jl(e)+1);if(!e||!(t=ft(t)))return e;var u=At(e),f=wl(u,At(t))+1;return un(u,0,f).join("")}function Yv(e,t,s){if(e=pe(e),e&&(s||t===r))return e.replace(vs,"");if(!e||!(t=ft(t)))return e;var u=At(e),f=bl(u,At(t));return un(u,f).join("")}function Qv(e,t){var s=se,u=ce;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?ft(t.omission):u}e=pe(e);var m=e.length;if(qn(e)){var _=At(e);m=_.length}if(s>=m)return e;var S=s-$n(u);if(S<1)return u;var N=_?un(_,0,S).join(""):e.slice(0,S);if(f===r)return N+u;if(_&&(S+=N.length-S),_a(f)){if(e.slice(S).search(f)){var T,L=N;for(f.global||(f=Ls(f.source,pe(zo.exec(f))+"g")),f.lastIndex=0;T=f.exec(L);)var P=T.index;N=N.slice(0,P===r?S:P)}}else if(e.indexOf(ft(f),S)!=S){var z=N.lastIndexOf(f);z>-1&&(N=N.slice(0,z))}return N+u}function Xv(e){return e=pe(e),e&&lf.test(e)?e.replace(ko,Ng):e}var Zv=Kn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Sa=du("toUpperCase");function uc(e,t,s){return e=pe(e),t=s?r:t,t===r?wg(e)?Ag(e):fg(e):e.match(t)||[]}var cc=ue(function(e,t){try{return ct(e,r,t)}catch(s){return va(s)?s:new re(s)}}),Jv=Kt(function(e,t){return _t(t,function(s){s=kt(s),Gt(e,s,pa(e[s],e))}),e});function e_(e){var t=e==null?0:e.length,s=X();return e=t?Ee(e,function(u){if(typeof u[1]!="function")throw new bt(d);return[s(u[0]),u[1]]}):[],ue(function(u){for(var f=-1;++fU)return[];var s=it,u=Ye(e,it);t=X(t),e-=it;for(var f=Ms(u,t);++s0||t<0)?new fe(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==r&&(t=ae(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},fe.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},fe.prototype.toArray=function(){return this.take(it)},Ot(fe.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),f=g[u?"take"+(t=="last"?"Right":""):t],m=u||/^find/.test(t);f&&(g.prototype[t]=function(){var _=this.__wrapped__,S=u?[1]:arguments,N=_ instanceof fe,T=S[0],L=N||ie(_),P=function(de){var ge=f.apply(g,nn([de],S));return u&&z?ge[0]:ge};L&&s&&typeof T=="function"&&T.length!=1&&(N=L=!1);var z=this.__chain__,K=!!this.__actions__.length,te=m&&!z,oe=N&&!K;if(!m&&L){_=oe?_:new fe(this);var ne=e.apply(_,S);return ne.__actions__.push({func:Ai,args:[P],thisArg:r}),new wt(ne,z)}return te&&oe?e.apply(this,S):(ne=this.thru(P),te?u?ne.value()[0]:ne.value():ne)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=ti[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",u=/^(?:pop|shift)$/.test(e);g.prototype[e]=function(){var f=arguments;if(u&&!this.__chain__){var m=this.value();return t.apply(ie(m)?m:[],f)}return this[s](function(_){return t.apply(ie(_)?_:[],f)})}}),Ot(fe.prototype,function(e,t){var s=g[t];if(s){var u=s.name+"";xe.call(Un,u)||(Un[u]=[]),Un[u].push({name:t,func:s})}}),Un[Si(r,F).name]=[{name:"wrapper",func:r}],fe.prototype.clone=Xg,fe.prototype.reverse=Zg,fe.prototype.value=Jg,g.prototype.at=Ep,g.prototype.chain=Ap,g.prototype.commit=Ip,g.prototype.next=Fp,g.prototype.plant=Dp,g.prototype.reverse=Tp,g.prototype.toJSON=g.prototype.valueOf=g.prototype.value=Lp,g.prototype.first=g.prototype.head,_r&&(g.prototype[_r]=Mp),g},zn=Ig();wn?((wn.exports=zn)._=zn,Cs._=zn):Be._=zn}).call(Xn)})(Ki,Ki.exports);var Fe=Ki.exports;const Lw=n=>{console.debug("calculateQuoteTotals",n);const a=$t.create(n[1]||{amount:null,scale:2});if(a.isFailure)throw a.error;const r=a.object,o=$t.create(n[2]||{amount:null,scale:2});if(o.isFailure)throw o.error;const l=o.object,c=Tt.create(n[0]||{amount:null,scale:2});if(c.isFailure)throw c.error;const d=c.object,h=d.percentage(r.toNumber()).convertScale(2),p=d.subtract(h).convertScale(2),x=p.percentage(l.toNumber()).convertScale(2),v=p.add(x).convertScale(2);return{subtotalPrice:d.toObject(),discount:r.toObject(),discountPrice:h.toObject(),priceBeforeTaxes:p.toObject(),tax:l.toObject(),taxesPrice:x.toObject(),totalPrice:v.toObject()}},Ow=({currency:n})=>{const{formState:a,control:r}=lr(),{formatNumber:o}=vw(),l=vc({control:r,name:["subtotal_price","discount","tax"]}),c=vc({control:r,name:"tax_label"})||w("quotes.form_fields.tax.label"),d=Lw(l),h=o(d.subtotalPrice),p=o(d.discountPrice),x=o(d.taxesPrice),v=o(d.totalPrice),R=M.useMemo(()=>n.symbol||"",[n]);return i.jsx(Le,{className:"w-full bg-muted",children:i.jsxs(Oe,{className:"flex flex-row items-end gap-2 p-4 border-t",children:[i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-1 font-semibold text-right text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:w("quotes.form_fields.subtotal_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[h,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:w("quotes.form_fields.discount.label")}),i.jsx(Hi,{scale:2,disabled:a.disabled,placeholder:w("quotes.form_fields.discount.placeholder"),name:"discount",onChange:y=>{console.log("discount",y)}})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm text-right",children:w("quotes.form_fields.discount_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end text-2xl tabular-nums",children:[p,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})]}),i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsxs("div",{className:"grid flex-1 h-16 grid-cols-2 gap-6 auto-rows-max",children:[i.jsxs("div",{className:"grid gap-1 font-medium text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm",children:c}),i.jsx(Hi,{scale:2,disabled:a.disabled,placeholder:w("quotes.form_fields.tax.placeholder"),name:"tax"})]}),i.jsxs("div",{className:"grid gap-1 font-semibold text-muted-foreground",children:[i.jsx(Ze,{className:"text-sm text-right",children:w("quotes.form_fields.tax_price.label",{label:""})}),i.jsxs(Ge,{className:"flex items-baseline justify-end gap-1 text-2xl tabular-nums",children:[x,i.jsx("span",{className:"text-base font-medium tracking-normal",children:R})]})]})]})," ",i.jsx(hn,{orientation:"vertical",className:"w-px h-16 mx-2"}),i.jsx("div",{className:"grid flex-1 h-16 grid-cols-1 auto-rows-max",children:i.jsxs("div",{className:"grid gap-0",children:[i.jsx(Ze,{className:"text-sm font-semibold text-right text-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsxs(Ge,{className:"flex items-baseline justify-end gap-1 text-3xl tabular-nums",children:[v,i.jsx("span",{className:"ml-1 text-lg tracking-normal",children:R})]})]})})]})})},Hd=n=>{const{percentage:a,cancel:r,error:o,isInProgress:l,onFinishDownload:c}=n,d=M.useId();return M.useEffect(()=>{l&&!o&&a===100&&c&&c()},[a,l,o,c]),i.jsx(rr,{open:l,children:i.jsxs(ir,{className:"sm:max-w-md",children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.downloading_dialog.title")}),i.jsx(ns,{children:w("quotes.downloading_dialog.description")})]}),i.jsxs("div",{className:"mb-4 space-y-2",id:d,children:[i.jsx(cr,{children:w("quotes.downloading_dialog.progress.label",{status:w(l?"quotes.downloading_dialog.progress.status_in_progress":"quotes.downloading_dialog.progress.status_stopped")})}),i.jsx(Hc,{value:a,max:100,getValueLabel:()=>w("quotes.downloading_dialog.progress.label",{})}),o&&i.jsxs("p",{children:["Error: ",JSON.stringify(o)]})]}),i.jsx(or,{className:"sm:justify-end",children:i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",variant:"secondary",onClick:()=>r(),children:w("quotes.downloading_dialog.cancel_button")})})})]})})},Pw=({isInProgress:n,percentage:a,elapsed:r,cancel:o,error:l,className:c})=>{const[d,h]=M.useState(10);return M.useEffect(()=>{if(n&&a>0){const p=r/a*100;h(Math.max(0,Math.round(p-r)))}},[n,a,r]),!n&&!(l!=null&&l.errorMessage)?null:i.jsxs(Le,{className:he("overflow-hidden",c),children:[i.jsx(pt,{children:i.jsxs(Ge,{className:"flex items-center justify-between",children:[l!=null&&l.errorMessage?"Error en la generación del PDF":"Generando PDF",n&&i.jsx(W0,{className:"w-4 h-4 animate-spin"}),(l==null?void 0:l.errorMessage)&&i.jsx(V0,{className:"w-4 h-4 text-destructive"})]})}),i.jsx(Oe,{children:l!=null&&l.errorMessage?i.jsx("div",{className:"text-destructive",children:l==null?void 0:l.errorMessage}):i.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[i.jsxs("div",{className:"relative w-32 h-40 overflow-hidden rounded-lg bg-muted",children:[i.jsx("div",{className:"absolute bottom-0 left-0 right-0 transition-all duration-1000 ease-out bg-primary",style:{height:`${a}%`}}),i.jsx(K0,{className:"absolute transform -translate-x-1/2 -translate-y-1/2 animate-pulse top-1/2 left-1/2 text-muted-foreground",size:48})]}),i.jsx(Hc,{value:a,className:"w-full"}),i.jsxs("div",{className:"text-sm text-center text-muted-foreground",children:[i.jsxs("p",{children:["Progreso: ",a,"%"]}),i.jsxs("div",{className:"hidden",children:[i.jsxs("p",{children:["Tiempo transcurrido: ",r," segundos"]}),d>0&&i.jsxs("p",{children:["Tiempo estimado restante: ",d," segundos"]})]})]}),i.jsx(G,{variant:"destructive",onClick:o,className:"hidden",children:"Cancelar generación"})]})})]})},Kd=({quote:n,className:a})=>{const{useReport:r,getQuotePDFFilename:o,useDownloader:l}=Ur(),{download:c}=l(),{report:d,preview:h,isInProgress:p,...x}=r(),[v,R]=M.useState(void 0),y=M.useCallback(()=>{n&&c(n.id,o(n))},[n]);return M.useEffect(()=>{const b=setTimeout(()=>{n&&n.id&&h(n.id)},200);return()=>clearTimeout(b)},[n]),M.useEffect(()=>{if(!p&&d){const b=window.URL&&window.URL.createObjectURL?window.URL.createObjectURL(d):window.webkitURL.createObjectURL(d);return R(b),()=>{R(void 0),window.URL.revokeObjectURL(b)}}},[d,p]),n?p?i.jsx(Pw,{isInProgress:p,...x}):i.jsx(p0,{file:v,className:"object-contain",onThumbnailClick:y}):i.jsx(Le,{className:he("overflow-hidden",a),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})})};Kd.whyDidYouRender=!0;const Tr=db();function kw({row:n,table:a}){var l;const r=(l=a.options.meta)==null?void 0:l.catalogPicker;if(!r)return null;const o=r.quantities[n.index]??1;return i.jsx(Zi,{type:"number",name:"quantity",min:1,className:"w-24",value:o,onChange:c=>{const d=c.target.value;r.setQuantity(n.index,d===""?"":Number(d))}})}function qw({row:n,table:a}){var o;const r=(o=a.options.meta)==null?void 0:o.catalogPicker;return i.jsxs(G,{size:"sm",variant:"outline",className:"h-8 gap-1",onClick:l=>{l.preventDefault(),r==null||r.selectArticle(n.original,n.index)},children:[i.jsx(Co,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only xl:not-sr-only xl:whitespace-nowrap",children:w("common.add")})]})}const to=({onSelect:n})=>{const a=zt(),{pagination:r,globalFilter:o,isFiltered:l}=Tn(),[c,d]=M.useState([]),h=M.useCallback((D,F)=>{d(q=>{const $=[...q];return $[D]=F,$})},[]),p=()=>{d([])},{data:x,isPending:v,isError:R,error:y}=zd({pagination:{pageIndex:r.pageIndex,pageSize:r.pageSize},searchTerm:o});M.useEffect(()=>{p()},[r,o,l]);const b=M.useMemo(()=>({catalogPicker:{quantities:c,setQuantity:h,selectArticle:(D,F)=>n(D,c[F]===""?1:c[F]??1)}}),[h,n,c]),E=M.useMemo(()=>[Tr.accessor("description",{id:"description",header:()=>i.jsx(i.Fragment,{children:w("catalog.list.columns.description")})}),Tr.accessor("points",{id:"points",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.points")}),cell:({renderValue:D})=>i.jsx("div",{className:"text-right",children:D()})}),Tr.accessor("retail_price",{id:"retail_price",header:()=>i.jsx("div",{className:"text-right",children:w("catalog.list.columns.retail_price")}),cell:({row:D})=>{const F=Tt.create(D.original.retail_price).object;return i.jsx("div",{className:"text-right",children:F.toFormat()})}}),Tr.display({id:"quantity",header:()=>i.jsx("div",{className:"font-medium text-right text-foreground",children:w("catalog.list.columns.quantity")}),cell:kw}),Tr.display({id:"row-actions",header:()=>null,cell:qw})],[]),{table:j}=os({data:[...(x==null?void 0:x.items)||[]],columns:E,pageCount:(x==null?void 0:x.total_pages)??-1,meta:b});return R?i.jsx(ur,{subtitle:y.message}):v?i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0}):(x==null?void 0:x.total_items)===0&&!l?i.jsx(as,{subtitle:"Empieza cargando los artículos del catálogo",buttonText:"",onButtonClick:()=>a("/catalog/add")}):i.jsx(is,{className:"bg-transparent border-0 shadow-none",table:j,paginationOptions:{visible:!0,enablePageSizeSelector:!1},footerClassName:"px-10 pt-2 border-t",children:i.jsx(Bd,{table:j})})},Do=M.forwardRef(({label:n=w("common.append_block"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Do.displayName="AppendBlockRowButton";const To=M.forwardRef(({label:n=w("common.append_article"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[" ",i.jsx(Co,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));To.displayName="AppendCatalogArticleRowButton";const Lo=M.forwardRef(({label:n=w("common.append_empty_row"),className:a,...r},o)=>i.jsxs(G,{type:"button",variant:"outline",ref:o,...r,children:[i.jsx(B0,{className:n?"w-4 h-4 mr-2":"w-4 h-4"}),n&&i.jsx(i.Fragment,{children:n})]}));Lo.displayName="AppendEmptyRowButton";const $w=({table:n,showLineDiscountColumn:a,hasLineDiscounts:r,onShowLineDiscountColumnChange:o})=>{const l=n.getSelectedRowModel().rows.length,[c,d]=M.useState(!1),h=x=>{if(!x&&a&&r){d(!0);return}o(x)},p=i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[i.jsxs("div",{className:"grid gap-0.5",children:[i.jsx(cr,{htmlFor:"show-line-discount-column",className:"text-sm font-medium",children:w("quotes.discount_column.label")}),i.jsx("p",{className:"text-xs font-normal text-muted-foreground",children:w("quotes.discount_column.description")})]}),i.jsx(So,{id:"show-line-discount-column",checked:a,onCheckedChange:h})]}),i.jsx(rr,{open:c,onOpenChange:d,children:i.jsxs(ir,{children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.discount_column.confirmation.title")}),i.jsx(ns,{children:w("quotes.discount_column.confirmation.description")})]}),i.jsxs(or,{children:[i.jsx(G,{type:"button",variant:"secondary",onClick:()=>d(!1),children:w("common.cancel")}),i.jsx(G,{type:"button",onClick:()=>{o(!1),d(!1)},children:w("quotes.discount_column.confirmation.confirm")})]})]})})]});return l?i.jsx("nav",{className:"flex items-center h-12 p-1 rounded-md text-muted-foreground bg-muted ",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.duplicateItems()},children:[i.jsx(U0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.duplicate_selected_rows")})]})}),i.jsx(We,{children:w("common.duplicate_selected_rows_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.deleteItems()},children:[i.jsx(xd,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.remove_selected_rows")})]})}),i.jsx(We,{children:w("common.remove_selected_rows_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"link",disabled:!n.getSelectedRowModel().rows.length,onClick:()=>n.resetRowSelection(),children:[i.jsx(Y0,{className:"w-4 h-4 sm:mr-2"}),i.jsx("span",{className:"sr-only sm:not-sr-only",children:w("common.reset_selected_rows")})]})}),i.jsx(We,{children:w("common.reset_selected_rows_tooltip")})]}),i.jsx(hn,{orientation:"vertical",className:"h-6 ml-1 mr-4"}),i.jsx("p",{className:"text-sm font-normal",children:w("common.rows_selected",{count:l})}),p]})}):i.jsxs("nav",{className:"flex items-center h-12 p-1 rounded-md bg-accent/75 text-muted-foreground",children:[i.jsxs("div",{className:"flex space-x-2",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Lo,{variant:"link",onClick:()=>{var x;return(x=n.options.meta)==null?void 0:x.appendItem()}})}),i.jsx(We,{children:w("common.append_empty_row_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(To,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickCatalogArticle&&((x=n.options.meta)==null||x.pickCatalogArticle())}})}),i.jsx(We,{children:w("common.append_article_tooltip")})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsx(Do,{variant:"link",onClick:()=>{var x;n.options.meta&&n.options.meta.pickBlock&&((x=n.options.meta)==null||x.pickBlock())}})}),i.jsx(We,{children:w("common.append_block_tooltip")})]})]}),p]})},zw=({row:n,table:a,onDelete:r})=>{const o=()=>{var l;(l=a.options.meta)==null||l.deleteItems(n.index),r()};return i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.insertItem(n.index)},children:[i.jsx(x0,{className:"w-4 h-4 mr-2"}),w("common.insert_row_above")]}),i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.insertItem(n.index+1)},children:[i.jsx(kc,{className:"w-4 h-4 mr-2"}),w("common.insert_row_below")]}),i.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>{var l;return(l=a.options.meta)==null?void 0:l.duplicateItems(n.index)},children:[i.jsx(jo,{className:"w-4 h-4 mr-2"}),w("common.duplicate_row")]}),i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,children:i.jsxs(G,{type:"button",variant:"destructive",size:"sm",children:[i.jsx(xd,{className:"w-4 h-4 mr-2"}),w("common.remove_row")]})}),i.jsxs(Yc,{children:[i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("quotes.inline_row_actions.delete_confirmation.title")}),i.jsx(Zc,{children:w("quotes.inline_row_actions.delete_confirmation.description")})]}),i.jsxs(Jc,{children:[i.jsx(ed,{children:w("common.cancel")}),i.jsx(td,{asChild:!0,children:i.jsx(G,{type:"button",variant:"destructive",onClick:o,children:w("quotes.inline_row_actions.delete_confirmation.confirm")})})]})]})]})]})},Bw={droppable:{strategy:w0.Always}},Vw={keyframes({transform:n}){return[{opacity:1,transform:Ga.Transform.toString(n.initial)},{opacity:0,transform:Ga.Transform.toString({...n.final,x:n.final.x+5,y:n.final.y+5})}]},easing:"ease-out",sideEffects({active:n}){n.node.animate([{opacity:0},{opacity:1}],{duration:_c.duration,easing:_c.easing})}};function Ac({columns:n,data:a,defaultValues:r,initialState:o,actions:l,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h}){const[p,x]=M.useState({}),[v,R]=M.useState(),[y,b]=M.useState(null),E=M.useMemo(()=>a.map(O=>O.id),[a]),j=Dd({data:a,columns:n,enableColumnResizing:!1,columnResizeMode:"onChange",autoResetAll:!1,initialState:o,state:{rowSelection:p,columnVisibility:{...o==null?void 0:o.columnVisibility,discount:c}},enableRowSelection:!0,enableMultiRowSelection:!0,enableSorting:!1,enableHiding:!0,onRowSelectionChange:x,getCoreRowModel:Fd(),getRowId:O=>O==null?void 0:O.id,debugTable:!1,debugHeaders:!1,debugColumns:!1,defaultColumn:{minSize:0,size:Number.MAX_SAFE_INTEGER,maxSize:Number.MAX_SAFE_INTEGER},meta:{insertItem:(O,k)=>{l.insert(O,k||(r==null?void 0:r.items[0]),{shouldFocus:!0})},appendItem:O=>{l.append(O||(r==null?void 0:r.items[0]),{shouldFocus:!0})},pickCatalogArticle:()=>{l.pickCatalogArticle&&(l==null||l.pickCatalogArticle())},pickBlock:()=>{l.pickBlock&&(l==null||l.pickBlock())},duplicateItems:O=>{var k;if(O!=null){const H=((k=l.getItem)==null?void 0:k.call(l,O))??j.getRowModel().rows[O].original;l.insert(O+1,{...H,id:void 0},{shouldFocus:!0})}else if(j.getSelectedRowModel().rows.length){const H=j.getSelectedRowModel().rows[j.getSelectedRowModel().rows.length-1].index,W=j.getSelectedRowModel().rows.map(B=>({...B.original,id:void 0}));j.getRowModel().rows.length{if(O!=null)l.remove(O);else if(j.getSelectedRowModel().rows.length>0){let k=j.getSelectedRowModel().rows.length-1;for(;k>=0;k--){const H=E.indexOf(String(j.getSelectedRowModel().rows[k].id));l.remove(H),E.splice(H,1)}j.resetRowSelection()}else l.remove()},updateItem:(O,k,H,W)=>{l.update(O,{...k,[`${H}`]:W})}}}),D=v0(Pi(A0,{}),Pi(E0,{}),Pi(R0,{}),Pi(N0,{}));function F(O){var W;let k=O.active.id,H=(W=O.over)==null?void 0:W.id;if(H!==void 0&&k!==H){let B=E.indexOf(String(H));if(j.getSelectedRowModel().rows.length>1)j.getSelectedRowModel().rows.forEach((se,ce)=>{const Y=E.indexOf(String(se.id));ce>0&&(k=se.id,B=E.indexOf(String(H)),B{const H=typeof k=="string"?k:k.id;return H===v||!j.getSelectedRowModel().rowsById[H]}):O}return i.jsx(_0,{measuring:Bw,sensors:D,onDragEnd:F,onDragStart:q,onDragCancel:$,collisionDetection:b0,children:i.jsxs(Le,{children:[i.jsx(pt,{className:"sticky z-10 top-16 bg-card/90",children:i.jsx(Ge,{children:i.jsx($w,{table:j,showLineDiscountColumn:c,hasLineDiscounts:d,onShowLineDiscountColumnChange:h})})}),i.jsxs(Oe,{children:[i.jsxs(uo,{className:"table-fixed",children:[i.jsx(co,{className:"sticky top-0 z-10 bg-background",children:j.getHeaderGroups().map(O=>i.jsx(pn,{className:"hover:bg-transparent",children:O.headers.map(k=>i.jsx(fo,{className:"px-2 py-1",style:{width:k.getSize()===Number.MAX_SAFE_INTEGER?"auto":k.getSize()},children:k.isPlaceholder?null:i.jsx(Ld,{table:j,header:k})},k.id))},O.id))}),i.jsx(go,{children:i.jsx(j0,{items:Q(E),strategy:C0,children:Q(j.getRowModel().rows).map(O=>{const k=O,H=k.id===y;return i.jsxs(M.Fragment,{children:[i.jsx(Ew,{id:k.id,isActive:H,onActivate:()=>b(k.id),children:k.getVisibleCells().map(W=>i.jsx(qr,{className:"px-2 py-2 align-top",style:{width:W.column.getSize()===Number.MAX_SAFE_INTEGER?"auto":W.column.getSize()},children:Gi(W.column.columnDef.cell,W.getContext())},W.id))}),H&&i.jsx(pn,{className:"border border-t-0 border-destructive/30 border-l-4 border-l-destructive bg-destructive/5 hover:bg-destructive/5",children:i.jsx(qr,{colSpan:k.getVisibleCells().length,className:"px-2 py-2",children:i.jsx(zw,{row:k,table:j,onDelete:()=>b(null)})})})]},k.id)})})})]}),S0.createPortal(i.jsx(y0,{dropAnimation:Vw,className:"z-40 opacity-100",children:v&&i.jsx("div",{className:"relative flex flex-wrap",children:j.getSelectedRowModel().rows.length?i.jsx(ro,{variant:"destructive",className:"absolute z-50 flex items-center justify-center w-2 h-2 p-3 rounded-full top left -left-2 -top-2",children:j.getSelectedRowModel().rows.length}):null})}),document.body),!1]}),i.jsx(Dt,{children:i.jsxs(tr,{children:[i.jsx(Lo,{onClick:()=>{var O;return(O=j.options.meta)==null?void 0:O.appendItem()}}),i.jsx(To,{onClick:()=>{var O;j.options.meta&&j.options.meta.pickCatalogArticle&&((O=j.options.meta)==null||O.pickCatalogArticle())}}),i.jsx(Do,{onClick:()=>{var O;j.options.meta&&j.options.meta.pickBlock&&((O=j.options.meta)==null||O.pickBlock())}})]})})]})})}const Uw={en:[{id:2000000098,code:"CAP_CLA_SEMI_SUSPENDIDO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r -Hanging rods: CHROME/ BLACK\r -Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r -Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r -Shoe rack door: YES/NO / Profile finish: BLACK LACQUER / SILVER MATTE\r -Shoe cabinet door glass finish: FLOAT BRONZE C-424\r -Composed of:`},{id:2000000084,code:"CAP_FRE_ARM_ABATIBLE_EN",title:"CHARACTERISTICS OF THE FRONT OF THE HINGED WARDROBE",body:`Size of opening: 2275x1390 mm.\r -Model: ARGO / Finish: LACQUER / Colour: TO BE DETERMINED\r -Door thickness: 22 or 19 mm\r -Door finish: SMOOTH \r -Handle: KNOB TO BE DETERMINED\r -Hardware finish: CHROME OR ANTHRACITE\r -Perimetral doorposts: VISIBLE, REMETED OR COMBI TO BE DETERMINED.\r -Number of doors: 2 \r -Composed of:`},{id:2000000089,code:"CAP_FRE_ARM_CORREDERA_EN",title:"Size of opening: 2440x5180mm. ",body:`Model: PANORAMIC P.O. / Finish: LACQUER / Colour: WHITE\r -No. of listers: NO LISTELS / Panels finish: LACQUERED PANEL \r -Handle: \r -Perimeter frame: \r -Nº of doors: \r -INCORPORATED HYDRAULIC BRAKE (not available in lower doors of 650 mm.) OR INCORPORATED MAGNETIC BRAKE. \r -Composed of:`},{id:2000000092,code:"CAP_INT_ARM_FORRADO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r -Hanging rods: CHROME/ BLACK\r -Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r -Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r -Composed of:`},{id:2000000109,code:"CAP_INT_EST_CRISTAL_EN",title:"Frames finish: BLACK ANODIZED",body:`Side frame panel finish: BRONZE FLOAT BRONZE GLASS C-424\r -Rear panel finish: BRONZE FLOAT GLASS C-424\r -Complements finish: MELAMIN / Colour: DENBER OAK M-242\r -Thickness of accessories: 25 mm.\r -Hanging bars: BLACK\r -Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r -Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r -Composed of:`},{id:2000000095,code:"CAP_SEP_AMBIENTES_EN",title:"CHARACTERISTICS SEPARATION OF ROOMS",body:`Size of opening: 2450x3000 mm.\r -Model: LYN / Finish: ANODISED / Colour: BLACK\r -No. of crosspieces: 2 HORIZONTAL CROSSBARS\r -Panel finish: TRANSPARENT TEMPLARED \r -Handle: DOUBLE PER DOOR\r -Brake: DOUBLE PER DOOR (OPENING AND CLOSING)\r -Guide: VISTA (DOUBLE EMBELLECEDOR)\r -Number of panels: 2 SLIDING + 2 FIXED`}],es:[{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado vestidor: MELAMINA / color: A DETERMINAR",body:`Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r -Barras de colgar: CROMO/ NEGRA/ BRONCE\r -Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r -Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r -Baldas deslizantes: X DE 145 MM. A DETERMINAR\r -Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r -Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r -Grosor hoja: 22 o 19 mm\r -Acabado de hojas: LISAS\r -Tirador: UÑERO A DETERMINAR\r -Acabado herrajes: CROMADO O ANTRACITA\r -Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r -Nº de hojas: 2\r -Compuesto por:`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO CORREDERA",body:`Medida de Hueco:2440x5180mm.\r -Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r -Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r -Tirador:\r -Cerco perimetral: \r -Nº de hojas:\r -FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r -Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r -Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r -Barras de colgar: CROMO/ NEGRA/ BRONCE\r -Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r -Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r -Baldas deslizantes: X DE 145 MM. A DETERMINAR\r -Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r -Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r -Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r -Espesor complementos: 25 mm.\r -Barras de colgar: NEGRA\r -Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r -Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r -Compuesto por:`},{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r -Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r -Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r -Acabado paneles: TRANSPARENTE TEMPLADO \r -Tirador: DOBLE POR PUERTA\r -Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r -Guía: VISTA (DOBLE EMBELLECEDOR)\r -Nº de hojas: 2 CORREDERAS + 2 FIJOS`}]},Ic=({onSelect:n})=>{const{i18n:a}=Fo(),[r]=M.useState(a.resolvedLanguage||"es"),[o]=M.useState(Uw[r.toLowerCase()]);return console.log(r),i.jsx(no,{className:"h-96",children:i.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:o&&o.sort((l,c)=>l.title.localeCompare(c.title)).map((l,c)=>i.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>n&&n(l,1),children:i.jsxs("div",{className:"flex flex-col w-full gap-1",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("div",{className:"font-semibold",children:l.title})})}),i.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:i.jsx("p",{dangerouslySetInnerHTML:{__html:l.body.substring(0,300).replace(`\r -`,"
")}})})]})},l.id))})})},Gw=({isOpen:n,onOpenChange:a,onSelect:r})=>kd("(min-width: 768px)")?i.jsx(rr,{modal:!0,open:n,onOpenChange:a,children:i.jsxs(ir,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(ns,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Ic,{onSelect:r}),i.jsx(or,{children:i.jsx(G,{type:"submit",onClick:()=>a(!1),children:w("common.close")})})]})}):i.jsx(nd,{open:n,onOpenChange:a,children:i.jsxs(rd,{children:[i.jsxs(id,{className:"text-left",children:[i.jsx(sd,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(ad,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Ic,{onSelect:r}),i.jsx(od,{className:"pt-2",children:i.jsx(ld,{asChild:!0,children:i.jsx(G,{variant:"outline",children:w("common.close")})})})]})}),Hw=({isOpen:n,onOpenChange:a,onSelect:r})=>kd("(min-width: 768px)")?i.jsx(rr,{modal:!0,open:n,onOpenChange:a,children:i.jsxs(ir,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(sr,{children:[i.jsx(ar,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(ns,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(nr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(to,{onSelect:r})}),i.jsx(or,{children:i.jsx(G,{type:"submit",onClick:()=>a(!1),children:w("common.close")})})]})}):i.jsx(nd,{open:n,onOpenChange:a,children:i.jsxs(rd,{children:[i.jsxs(id,{className:"text-left",children:[i.jsx(sd,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(ad,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(nr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(to,{onSelect:r})}),i.jsx(od,{className:"pt-2",children:i.jsx(ld,{asChild:!0,children:i.jsx(G,{variant:"outline",children:w("common.close")})})})]})}),Kw=({currency:n,language:a,defaultValues:r})=>{var W;const{toast:o}=_n(),{control:l,getValues:c,setValue:d,watch:h}=lr(),p=h("show_line_discount_column")??!0,x=!!((W=c("items"))!=null&&W.some(B=>{var se;return Number((se=B.discount)==null?void 0:se.amount)>0})),[v]=M.useState("dialog"),[R,y]=M.useState(!1),[b,E]=M.useState(!1),{fields:j,...D}=I0({control:l,name:"items"}),F=Iw([{id:"description",accessorKey:"description",header:w("quotes.form_fields.items.description.label"),cell:({row:{index:B,original:se}})=>i.jsx(qt,{readOnly:se==null?void 0:se.id_article,autoSize:!0,name:`items.${B}.description`}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.quantity.label")}),cell:({row:{index:B}})=>i.jsx(fw,{scale:0,className:"text-right",name:`items.${B}.quantity`}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:B}})=>i.jsx(Fa,{currency:n,language:a,scale:2,className:"text-right",name:`items.${B}.unit_price`}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:B}})=>i.jsx(Fa,{variant:"ghost",currency:n,language:a,scale:2,readOnly:!0,className:"text-right",name:`items.${B}.subtotal_price`}),size:150},{id:"discount",accessorKey:"discount",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.discount.label")}),cell:({row:{index:B}})=>i.jsx(Hi,{scale:2,className:"text-right",name:`items.${B}.discount`}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.total_price.label")}),cell:({row:{index:B}})=>i.jsx(Fa,{variant:"ghost",currency:n,language:a,scale:2,readOnly:!0,className:"font-semibold text-right",name:`items.${B}.total_price`}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0}),q=M.useCallback((B,se=1)=>{D.append({...B,quantity:{amount:100*se,scale:xn.DEFAULT_SCALE},unit_price:B.retail_price,discount:{amount:null,scale:2}}),o({title:w("quotes.catalog_picker_dialog.toast_article_added"),description:B.description})},[D]),$=M.useCallback(B=>{D.append({description:`${B.title} -${B.body}`,quantity:{amount:null,scale:xn.DEFAULT_SCALE},unit_price:{amount:null,scale:ab.DEFAULT_SCALE},discount:{amount:null,scale:2}}),o({title:w("quotes.blocks_picker_dialog.toast_article_added"),description:B.title})},[D]),[Q,O]=M.useState(!1),k=[265,440,655],H=4;return v==="dialog"?i.jsxs("div",{className:"relative",children:[i.jsx(Ac,{actions:{...D,getItem:B=>c(`items.${B}`),pickCatalogArticle:()=>y(!0),pickBlock:()=>E(!0)},columns:F,data:j,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})}),i.jsx(Hw,{onSelect:q,isOpen:R,onOpenChange:y}),i.jsx(Gw,{onSelect:$,isOpen:b,onOpenChange:E})]}):i.jsxs(Z0,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[i.jsx(Sc,{defaultSize:k[0],collapsedSize:H,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{O(!0)},onExpand:()=>{O(!1)},className:he(Q&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:i.jsx(Ac,{actions:{...D,getItem:B=>c(`items.${B}`)},columns:F,data:j,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})})}),i.jsx(J0,{withHandle:!0,className:"mx-3"}),i.jsx(Sc,{defaultSize:k[1],minSize:10,children:i.jsx(nr,{syncWithLocation:!1,children:i.jsx(to,{onSelect:q})})})]})},Ww=()=>{const{formState:n}=lr();return i.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[i.jsxs(Ha,{className:"md:col-span-6",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),children:[i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(mn,{required:!0,className:"col-span-2",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_reference.placeholder"),name:"customer_reference"}),i.jsx(Gc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(mn,{label:w("quotes.form_fields.validity.label"),description:w("quotes.form_fields.validity.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.validity.placeholder"),name:"validity"}),i.jsx(qt,{className:"col-span-2",label:w("quotes.form_fields.payment_method.label"),description:w("quotes.form_fields.payment_method.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.payment_method.placeholder"),name:"payment_method"})]}),i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(qt,{className:"col-span-3",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_information.placeholder"),name:"customer_information",errors:n.errors}),i.jsx(qt,{className:"col-span-3",label:w("quotes.form_fields.notes.label"),description:w("quotes.form_fields.notes.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.notes.placeholder"),name:"notes"})]})]}),i.jsx(Ha,{className:"hidden md:col-span-2",title:w("quotes.create.form_groups.status.title"),description:w("quotes.create.form_groups.status.desc"),children:i.jsxs("div",{className:"grid gap-6",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx(cr,{htmlFor:"status",children:"Status"}),i.jsxs(so,{children:[i.jsx(ao,{id:"status","aria-label":"Select status",children:i.jsx(oo,{placeholder:"Select status"})}),i.jsxs(lo,{children:[i.jsx(Or,{value:"draft",children:"Draft"}),i.jsx(Or,{value:"published",children:"Active"}),i.jsx(Or,{value:"archived",children:"Archived"})]})]})]}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.lang_code.label"),description:w("quotes.form_fields.lang_code.desc"),placeholder:w("quotes.form_fields.lang_code.placeholder"),name:"lang_code"}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.currency_code.label"),description:w("quotes.form_fields.currency_code.desc"),placeholder:w("quotes.form_fields.currency_code.placeholder"),name:"currency_code"})]})})]})},Wd=({id:n,onSentTo:a,disabled:r})=>{const o=()=>{a(n)};return i.jsxs(Kc,{children:[i.jsx(Wc,{asChild:!0,disabled:r,children:i.jsxs(G,{variant:"ghost",className:"h-10 gap-1 text-primary disabled:text-secondary-foreground",children:[i.jsx(Q0,{className:"w-4 h-4"}),w("quotes.quote_sent_to_editor.trigger_button")]})}),i.jsxs(Yc,{children:[i.jsxs(Qc,{children:[i.jsx(Xc,{children:w("quotes.quote_sent_to_editor.title")}),i.jsx(Zc,{children:w("quotes.quote_sent_to_editor.description")})]}),i.jsxs(Jc,{children:[i.jsx(ed,{children:w("common.cancel")}),i.jsx(td,{asChild:!0,children:i.jsx(G,{onClick:o,children:w("common.continue")})})]})]})]})},Yw=["draft","ready","delivered","accepted","rejected","archived"],Qw={draft:["draft","ready","archived"],ready:["ready","delivered","archived"],delivered:["delivered","accepted","rejected","archived"],accepted:["accepted","rejected","archived"],rejected:["rejected","accepted","archived"],archived:["archived","draft","ready","delivered","accepted","rejected"]},Yd=({type:n="button",status:a,onChangeStatus:r})=>{const[o,l]=M.useState(a),c=h=>l(h);M.useEffect(()=>{a&&l(a)},[a]);const d=()=>{o!==a&&r(o,a)};return i.jsxs(rr,{children:[i.jsx(Tc,{asChild:!0,children:n==="button"?i.jsxs(G,{size:"sm",variant:"outline",className:"h-8 gap-1",children:[i.jsx(F0,{className:"h-3.5 w-3.5"}),i.jsx("span",{className:"sr-only md:not-sr-only md:whitespace-nowrap",children:w("quotes.quote_status_editor.trigger_button")})]}):i.jsx(M0,{status:a,isEditable:!0})}),i.jsxs(ir,{children:[i.jsx(sr,{children:i.jsx(ar,{children:w("quotes.quote_status_editor.title")})}),i.jsx(D0,{}),i.jsx("div",{className:"grid gap-4 py-4",children:Yw.map(h=>{const p=!Qw[a].includes(h);return i.jsxs("div",{className:"flex items-start space-x-4",children:[i.jsx(So,{id:h,checked:o===h,onCheckedChange:()=>c(h),disabled:p}),i.jsxs("div",{className:"grid gap-1.5 leading-none",children:[i.jsx(cr,{htmlFor:h,className:he("font-medium",p?"text-input":"text-foreground"),children:w(`quotes.quote_status_editor.status.${h}.title`)}),i.jsx("p",{className:he("text-sm",p?"text-input":"text-muted-foreground"),children:w(`quotes.quote_status_editor.status.${h}.description`)})]})]},h)})}),i.jsxs(or,{className:"pt-6 border-t",children:[i.jsx(Vi,{asChild:!0,children:i.jsx(G,{type:"button",variant:"secondary",children:w("common.cancel")})}),i.jsx(Vi,{asChild:!0,children:i.jsx(G,{onClick:d,disabled:o===a,children:w("quotes.quote_status_editor.submit_button")})})]})]})]})},Xw=({quoteId:n,className:a})=>{const r=zt(),{toast:o}=_n(),{useOne:l,useSetStatus:c,useSentTo:d,useDownloader:h,useDuplicate:p,getQuotePDFFilename:x}=Ur(),{data:v,status:R}=l(n),{mutate:y}=c(),{mutate:b}=d(n),{mutate:E}=p(),{download:j,...D}=h(),{formatCurrency:F,formatNumber:q}=Pd({locale:(v==null?void 0:v.lang_code)||"ES"}),$=M.useMemo(()=>v?{subtotal_price:F(v.subtotal_price),discount:q(v.discount),discount_price:F(v.discount_price),tax:q(v.tax),tax_price:F(v.tax_price),total_price:F(v.total_price)}:{subtotal_price:"0,00 €",discount:"0",discount_price:"0,00 €",tax:"0",tax_price:"0,00 €",total_price:"0,00 €"},[v]),Q=M.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!(v!=null&&v.date_sent),[v]),O=M.useMemo(()=>(v==null?void 0:v.status)==="accepted"&&!!(v!=null&&v.date_sent),[v]),k=Y=>{y({id:v.id,newStatus:Y},{onSuccess:()=>{o({description:w("quotes.quote_status_editor.toast_status_changed"),variant:"success"})}})},H=Y=>{b({sent_date:T0(new Date)},{onSuccess:()=>{o({description:w("quotes.quote_sent_to_editor.toast_status_changed"),variant:"success"})}})},W=M.useCallback(()=>{o({description:w("quotes.downloading_dialog.toast_success"),variant:"success"})},[o]),B=M.useCallback(()=>{v&&j(v.id,x(v))},[v]);if(R==="error"||R!=="success")return null;if(!v)return i.jsx(Le,{className:he("overflow-hidden",a),children:i.jsx(Oe,{className:"px-4 py-6 text-center",children:i.jsx("p",{className:"mx-auto",children:"Select a quote"})})});const se=Y=>{E({id:Y},{onSuccess(Re){o({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${Re.id}`,{relative:"path"})}})},ce=Y=>{y({id:Y,newStatus:"archived"},{onSuccess:()=>{o({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})};return i.jsxs(i.Fragment,{children:[i.jsx(Hd,{...D,onFinishDownload:W}),i.jsx(ud,{defaultValue:"resume",children:i.jsxs(Le,{className:"w-[390px] overflow-hidden",children:[i.jsxs(pt,{className:"gap-3 border-b bg-accent",children:[i.jsxs(Ge,{className:"flex items-center justify-between text-lg",children:[i.jsx("span",{children:w("quotes.list.resume.title")}),i.jsx(Yd,{status:v.status,onChangeStatus:k,type:"badge"})]}),i.jsx("div",{className:"flex w-full mr-auto text-foreground",children:i.jsxs("div",{className:"flex justify-between w-full",children:[i.jsxs(tr,{className:"gap-0",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",disabled:O,onClick:Y=>{Y.preventDefault(),r(`/quotes/edit/${v.id}`,{relative:"path"})},children:[i.jsx(pd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",onClick:Y=>{Y.preventDefault(),se(v.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",onClick:B,children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"outline",size:"icon",disabled:O,onClick:Y=>{Y.preventDefault(),ce(v.id)},children:[i.jsx(dd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(tr,{children:i.jsx(Wd,{disabled:O||!Q,id:v.id,onSentTo:H})})]})})]}),i.jsxs(Oe,{className:"p-6 text-sm",children:[i.jsxs(cd,{className:"grid w-full grid-cols-2",children:[i.jsx(Ka,{value:"resume",children:w("quotes.list.resume.tabs.resume")}),i.jsx(Ka,{value:"preview",children:w("quotes.list.resume.tabs.preview")})]}),i.jsx(Wa,{value:"resume",className:"pt-4",children:i.jsxs("div",{className:"grid gap-3",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.quote_information")}),i.jsxs("dl",{className:"grid gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.reference.label")}),i.jsx("dd",{className:"font-medium",children:v.reference})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("dt",{className:"text-muted-foreground",children:w("quotes.form_fields.date.label")}),i.jsx("dd",{className:"font-medium",children:new Date(v.date).toLocaleDateString()})]}),i.jsxs("div",{className:"flex items-start justify-between",children:[i.jsx("dt",{className:"text-muted-foreground whitespace-nowrap",children:w("quotes.form_fields.customer_reference.label")}),i.jsx("dd",{className:"font-medium text-right whitespace-break-spaces",children:v.customer_reference})]})]})]}),i.jsx(hn,{className:"my-4"}),i.jsxs("div",{className:"grid gap-3",children:[i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.customer_information")}),i.jsx("div",{children:v.customer_information})]}),i.jsx(hn,{className:"my-4"}),i.jsx("div",{className:"font-semibold",children:w("quotes.list.resume.price_information")}),i.jsxs("ul",{className:"grid gap-3",children:[i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.subtotal_price.label")}),i.jsx("span",{children:$.subtotal_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.discount_value.label",{value:$.discount})}),i.jsx("span",{children:$.discount_price})]}),i.jsxs("li",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.tax_value.label",{label:v.tax_label,value:$.tax})}),i.jsx("span",{children:$.tax_price})]}),i.jsxs("li",{className:"flex items-center justify-between font-semibold",children:[i.jsx("span",{className:"text-muted-foreground",children:w("quotes.form_fields.total_price.label")}),i.jsx("span",{children:$.total_price})]})]})]})}),i.jsx(Wa,{value:"preview",children:i.jsx(Kd,{quote:v})})]}),i.jsx(Dt,{className:"flex flex-row items-center px-6 py-3 border-t bg-accent",children:i.jsx("div",{className:"text-xs text-muted-foreground"})})]})})]})},Zw=({status:n="all",preview:a=!1})=>{const r=zt(),{toast:o}=_n(),l=M.useId(),c=M.useId(),{pagination:d,globalFilter:h,isFiltered:p}=Tn(),[x,v]=M.useState(void 0),{useList:R,useDownloader:y,useSetStatus:b,useDuplicate:E,getQuotePDFFilename:j}=Ur(),{mutate:D}=b(),{mutate:F}=E(),{data:q,isPending:$,isError:Q,error:O}=R({pagination:{pageIndex:d.pageIndex,pageSize:d.pageSize},status:n,quickSearchTerm:h}),{download:k,...H}=y(),W=je=>{v(je)},B=M.useCallback(()=>{o({description:w("quotes.downloading_dialog.toast_success")})},[o]),se=M.useCallback(je=>{r(`/quotes/edit/${je.id}`,{relative:"path"})},[r,o]),ce=je=>{F({id:je},{onSuccess(Me){o({description:w("quotes.duplicate_action.toast_success"),variant:"success"}),r(`/quotes/edit/${Me.id}`,{relative:"path"})}})},Y=je=>{D({id:je,newStatus:"archived"},{onSuccess:()=>{o({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w("quotes.status.archived")}),variant:"success"})}})},Re=(je,Me)=>{D({id:je,newStatus:Me},{onSuccess:()=>{o({description:w("quotes.quote_status_editor.toast_status_changed",{newStatus:w(`quotes.status.${Me}`)}),variant:"success"})}})},rt=M.useMemo(()=>{const je=[{id:"reference",accessorKey:"reference",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.reference")}),cell:({row:{original:U},renderValue:be})=>{const Je=!!((U==null?void 0:U.status)==="accepted"&&(U!=null&&U.date_sent));return i.jsx(G,{size:"sm",variant:"link",disabled:Je,className:"h-8 gap-1 px-0 text-left text-ellipsis",onClick:it=>{it.preventDefault(),se(U)},children:i.jsx("div",{className:"",children:be()})})}},{id:"status",accessorKey:"status",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.status")}),cell:({row:{original:U}})=>i.jsx(Yd,{type:"badge",status:U.status,onChangeStatus:be=>Re(U.id,be)})},{id:"date_sent",accessor:"date_sent",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:w("quotes.list.columns.date_sent")}),cell:({row:{original:U}})=>{const be=Zn.create(U.date_sent),Je=be.isSuccess&&!be.object.isEmpty();return i.jsx("div",{className:"text-left text-ellipsis",children:Je?i.jsx(Td,{label:be.object.toLocaleDateString("es-ES"),className:"text-green-800 bg-green-100 hover:text-green-800 hover:bg-green-100"}):i.jsx(i.Fragment,{})})}},{id:"date",accessor:"date",header:()=>i.jsx("div",{className:"text-left text-ellipsis",children:w("quotes.list.columns.date")}),cell:({row:{original:U}})=>{const be=Zn.create(U.date);return i.jsx("div",{className:"text-left text-ellipsis",children:be.isSuccess?be.object.toLocaleDateString("es-ES"):"-"})}},{id:"customer_reference",accessorKey:"customer_reference",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.customer_reference")}),cell:({renderValue:U})=>i.jsx("div",{className:"text-left text-ellipsis",children:U()})},{id:"customer_information",accessorKey:"customer_information",header:()=>i.jsx(i.Fragment,{children:w("quotes.list.columns.customer_information")}),cell:({row:{original:U}})=>i.jsx("div",{className:"text-left text-ellipsis",children:U.customer_information.split(` -`).map((be,Je)=>i.jsxs("span",{className:Je===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[be,i.jsx("br",{})]},Je))}),size:500}],Me=[{id:"row-actions",header:()=>null,cell:({row:{original:U}})=>{const be=(U==null?void 0:U.status)==="accepted"&&!(U!=null&&U.date_sent),Je=(U==null?void 0:U.status)==="accepted"&&!!(U!=null&&U.date_sent),it=(U==null?void 0:U.status)==="archived";return i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(tr,{className:"gap-0",children:[i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",disabled:Je,onClick:bn=>{bn.preventDefault(),se(U)},children:[i.jsx(pd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",onClick:bn=>{bn.preventDefault(),ce(U.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",onClick:()=>{k(U.id,j(U))},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(He,{children:[i.jsx(Ke,{asChild:!0,children:i.jsxs(G,{variant:"ghost",size:"icon",disabled:it||Je,onClick:bn=>{bn.preventDefault(),Y(U.id)},children:[i.jsx(dd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(We,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(tr,{children:i.jsx(Wd,{id:U.id,onSentTo:()=>null,disabled:Je||!be})})]})}}];return a?je:[...je,...Me]},[a]),{table:ee}=os({data:(q==null?void 0:q.items)??[],columns:rt,pageCount:(q==null?void 0:q.total_pages)??-1});return M.useEffect(()=>{ee&&q&&(q==null?void 0:q.total_pages)>0&&v(ee.getRowModel().rows[0])},[q,ee]),Q?i.jsx(ur,{subtitle:O.message}):$?i.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[i.jsx(Le,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:i.jsx(Oe,{children:i.jsx(ss,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),i.jsx("div",{})]}):(q==null?void 0:q.total_items)===0&&!p?i.jsx(Le,{children:i.jsx(Oe,{children:i.jsx(as,{subtitle:"Empieza creando alguna cotización",buttonText:w("quotes.create.title"),onButtonClick:()=>r("add",{relative:"path"})})})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[i.jsx("div",{id:l,className:"flex items-stretch flex-1",children:i.jsx(is,{table:ee,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:W,activeRowIndex:x==null?void 0:x.index,children:i.jsx(Vd,{table:ee})})}),a&&i.jsx("div",{id:c,className:"flex items-stretch ",children:i.jsx(Xw,{quoteId:x==null?void 0:x.original.id})})]}),i.jsx(Hd,{...H,onFinishDownload:B})]})},pS=()=>{const n=zt(),a=Tw(),{toast:r}=_n(),[o,l]=M.useState(Ma.createDefaultCode().object),[c,d]=M.useState(Pr.createDefaultCode().object),h=M.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",show_line_discount_column:!0,subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_label:"% IVA",tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:o.code},subtotal_price:{amount:null,scale:2,currency_code:o.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:o.code}}]}),[o.code]),{useOne:p,useUpdate:x}=Ur(),{data:v,status:R,error:y}=p(a),{mutate:b,isPending:E}=x(String(a)),j=Ji({mode:"onBlur",defaultValues:h}),{getValues:D,reset:F,handleSubmit:q,formState:$,control:Q,watch:O,setValue:k}=j,{isSubmitting:H,isDirty:W}=$;Mo({isDirty:W}),M.useEffect(()=>{if(!W)return;const{unsubscribe:ce}=O((Y,{name:Re,type:rt})=>{if(Re==="items"){Y.items&&Y.items.map((je,Me)=>{if(je){const U=eo(je);Fe.isEqual(U.subtotal_price.toObject(),je.subtotal_price)||k(`items.${Me}.subtotal_price`,U.subtotal_price.toObject()),Fe.isEqual(U.total_price.toObject(),je.total_price)||k(`items.${Me}.total_price`,U.total_price.toObject())}});const ee=Va(Y,!0);Fe.isEqual(ee.subtotal_price.toObject(),Y.total_price)||k("subtotal_price",ee.subtotal_price.toObject()),Fe.isEqual(ee.discount_price.toObject(),Y.total_price)||k("discount_price",ee.discount_price.toObject()),Fe.isEqual(ee.before_tax_price.toObject(),Y.before_tax_price)||k("before_tax_price",ee.before_tax_price.toObject()),Fe.isEqual(ee.tax_price.toObject(),Y.tax_price)||k("tax_price",ee.tax_price.toObject()),Fe.isEqual(ee.total_price.toObject(),Y.total_price)||k("total_price",ee.total_price.toObject())}else if(Re&&rt==="change"){if(Re==="currency_code"){const ee=Ma.createFromCode(Y.currency_code??Ma.DEFAULT_CURRENCY_CODE);if(ee.isFailure)throw console.error(ee.error),ee.error;l(ee.object)}if(Re==="lang_code"){const ee=Pr.createFromCode(Y.lang_code??Pr.DEFAULT_LANGUAGE_CODE);if(ee.isFailure)throw console.error(ee.error),ee.error;d(ee.object)}if(["discount","tax"].includes(Re)){const ee=Va(Y,!0);Fe.isEqual(ee.subtotal_price.toObject(),Y.total_price)||k("subtotal_price",ee.subtotal_price.toObject()),Fe.isEqual(ee.discount_price.toObject(),Y.total_price)||k("discount_price",ee.discount_price.toObject()),Fe.isEqual(ee.before_tax_price.toObject(),Y.before_tax_price)||k("before_tax_price",ee.before_tax_price.toObject()),Fe.isEqual(ee.tax_price.toObject(),Y.tax_price)||k("tax_price",ee.tax_price.toObject()),Fe.isEqual(ee.total_price.toObject(),Y.total_price)||k("total_price",ee.total_price.toObject())}if(Re!=null&&Re.startsWith("items")){const ee=Number(Re.split(".")[1]),je=Re.split(".")[2];if(["quantity","unit_price","discount"].includes(je)&&Y.items&&Y.items[ee]){const Me=Y.items[ee],U=eo(Me);Fe.isEqual(U.quantity.toObject(),Me.quantity)||k(`items.${ee}.quantity`,U.quantity.toObject()),Fe.isEqual(U.unit_price.toObject(),Me.unit_price)||k(`items.${ee}.unit_price`,U.unit_price.toObject()),Fe.isEqual(U.discount.toObject(),Me.discount)||k(`items.${ee}.discount`,U.discount.toObject()),Fe.isEqual(U.subtotal_price.toObject(),Me.subtotal_price)||k(`items.${ee}.subtotal_price`,U.subtotal_price.toObject()),Fe.isEqual(U.total_price.toObject(),Me.total_price)||k(`items.${ee}.total_price`,U.total_price.toObject());const be=Va(Y,!0);Fe.isEqual(be.subtotal_price.toObject(),Y.total_price)||k("subtotal_price",be.subtotal_price.toObject()),Fe.isEqual(be.discount_price.toObject(),Y.total_price)||k("discount_price",be.discount_price.toObject()),Fe.isEqual(be.before_tax_price.toObject(),Y.before_tax_price)||k("before_tax_price",be.before_tax_price.toObject()),Fe.isEqual(be.tax_price.toObject(),Y.tax_price)||k("tax_price",be.tax_price.toObject()),Fe.isEqual(be.total_price.toObject(),Y.total_price)||k("total_price",be.total_price.toObject())}}}});return()=>ce()},[O,W,k]);const B=async(ce,Y)=>{b(ce,{onError:Re=>{console.error(Re),r({title:"Error",description:Re.message,variant:"destructive"})},onSuccess:()=>{F(D()),r({title:"Cotización guardada",variant:"success"}),Y&&n("/quotes")}})},se=M.useCallback(()=>{n("/quotes",{state:{id:a}})},[n,a]);return M.useEffect(()=>{R==="success"&&v&&F(v)},[R,v,F]),R==="error"?i.jsx(ur,{errorMessage:y.message}):R!=="success"?i.jsx(Dn,{}):i.jsxs(i.Fragment,{children:[(H||E)&&i.jsx(Dn,{title:"Guardando cotización"}),i.jsx(es,{...j,children:i.jsx("form",{onSubmit:q(ce=>B(ce,!1)),children:i.jsxs("div",{className:"mx-auto grid max-w-[90rem] flex-1 auto-rows-max gap-6",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx(Uc,{}),i.jsxs("h1",{className:"flex-1 text-xl font-semibold tracking-tight shrink-0 whitespace-nowrap sm:grow-0",children:[w("quotes.edit.title")," ",v.reference]}),i.jsx(Td,{label:w(`quotes.status.${v.status}`),className:"ml-auto sm:ml-0"}),i.jsxs("div",{className:"items-center hidden gap-2 md:ml-auto md:flex",children:[i.jsx(L0,{label:w("common.close"),variant:"secondary",size:"sm",onClick:se}),i.jsx(wo,{label:w("common.save"),size:"sm",disabled:$.isSubmitting||$.isLoading||$.isValidating}),i.jsx(G,{size:"sm",disabled:$.isSubmitting||$.isLoading||$.isValidating,onClick:q(ce=>B(ce,!0)),children:w("common.save_close")})]})]}),i.jsx(Ww,{}),i.jsx(Ow,{currency:o}),i.jsx(Kw,{currency:o,language:c,defaultValues:h}),i.jsxs("div",{className:"flex items-center justify-center gap-2 md:hidden",children:[i.jsx(G,{variant:"outline",size:"sm",children:w("common.discard")}),i.jsx(G,{onClick:q(ce=>B(ce,!1)),size:"sm",children:w("quotes.edit.buttons.save_quote")})]})]})})}),!1]})},Jw=M.createContext(null),eS=({children:n})=>{const[a,r]=Bc();return i.jsx(Jw.Provider,{value:{pagination:a,setPagination:r},children:n})},xS=({children:n})=>i.jsx(ts,{children:i.jsx(eS,{children:i.jsxs(zr,{className:"quotes-layout",children:[i.jsx(Br,{}),i.jsx(Vr,{children:n})]})})}),vS=()=>{const n=zt(),[a,r]=M.useState("all"),[o,l]=pw(!0),c=[{value:"all",label:w("quotes.list.tabs.all")},{value:"draft",label:w("quotes.list.tabs.draft")},{value:"ready",label:w("quotes.list.tabs.ready")},{value:"delivered",label:w("quotes.list.tabs.delivered")},{value:"accepted",label:w("quotes.list.tabs.accepted")},{value:"rejected",label:w("quotes.list.tabs.rejected")},{value:"archived",label:w("quotes.list.tabs.archived")}];return i.jsxs(nr,{children:[i.jsxs("div",{className:"flex items-center justify-between space-y-2",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:i.jsx(le,{i18nKey:"quotes.list.title"})}),i.jsx("p",{className:"text-muted-foreground",children:i.jsx(le,{i18nKey:"quotes.list.subtitle"})})]}),i.jsx("div",{className:"flex items-center space-x-2",children:i.jsxs(G,{onClick:()=>n("/quotes/add"),children:[i.jsx(yo,{className:"w-4 h-4 mr-2"}),w("quotes.create.title")]})})]}),i.jsxs(ud,{value:a,onValueChange:r,children:[i.jsxs("div",{className:"flex flex-col items-start justify-between mb-4 sm:flex-row sm:items-center",children:[i.jsxs("div",{className:"w-full mb-4 sm:w-auto sm:mb-0",children:[i.jsx(cd,{className:"hidden sm:flex",children:c.map(d=>i.jsx(Ka,{value:d.value,children:d.label},d.value))}),i.jsxs("div",{className:"flex items-center w-full space-x-2 sm:hidden",children:[i.jsx(cr,{children:w("quotes.list.tabs_title")}),i.jsxs(so,{value:a,onValueChange:r,children:[i.jsx(ao,{children:i.jsx(oo,{placeholder:"Seleccionar estado"})}),i.jsx(lo,{children:c.map(d=>i.jsx(Or,{value:d.value,children:d.label},d.value))})]})]})]}),i.jsx("div",{className:"flex items-baseline justify-center mr-4 font-medium",children:i.jsx(sw,{buttonText:"Ayuda",title:"Ayuda sobre el Estado de Cotizaciones",content:tS})}),i.jsx("div",{className:"flex items-center gap-2 ml-auto",children:i.jsx(O0,{"aria-label":"Show quote preview",variant:"outline",defaultPressed:!1,pressed:o,onPressedChange:l,children:o?i.jsxs(i.Fragment,{children:[i.jsx(md,{className:"w-4 h-4 mr-2"}),w("common.disable_preview")]}):i.jsxs(i.Fragment,{children:[i.jsx(H0,{className:"w-4 h-4 mr-2"}),w("common.enable_preview")]})})})]}),c.map(d=>i.jsx(Wa,{value:d.value,children:i.jsx(Zw,{status:d.value,preview:o})},d.value))]})]})},tS=i.jsxs(no,{className:"grid gap-4 py-4",children:[i.jsx("p",{children:"El estado de una cotización indica su posición actual en el proceso de negocio."}),i.jsx("p",{children:"Los estados posibles son:"}),i.jsxs("ul",{className:"pl-6 space-y-2 list-disc",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Borrador:"})," La cotización está en proceso de creación o edición."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Preparado:"})," La cotización está lista para ser enviada al cliente."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Entregado:"})," La cotización ha sido enviada al cliente."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Aceptado:"})," El cliente ha aprobado la cotización."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Rechazado:"})," El cliente no ha aceptado la cotización."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Arcivado:"})," La cotización ha sido guardada para referencia futura y ya no está activa."]})]}),i.jsxs("p",{children:["Utiliza estos estados para hacer un seguimiento eficiente de tus cotizaciones y optimizar tu proceso de ventas. El estado ",i.jsx("strong",{children:"Archivado"})," es útil para mantener un historial de cotizaciones pasadas sin que interfieran con las cotizaciones activas."]})]}),nS=n=>{const a=$r(),r=Mn();return{useOne:()=>wd({queryKey:r().data().resource("settings").action("one").id("me").params().get(),queryFn:()=>a.getOne({resource:"profile",id:""}),...n}),useUpdate:()=>{const o=Jt();return en({mutationKey:r().data().resource("settings").action("one").id("me").params().get(),mutationFn:l=>a.updateOne({resource:"profile",data:l,id:""}),onSuccess:()=>{o.invalidateQueries({queryKey:["data","default","settings"]})}})},useUploadLogo:()=>{const o=Jt(),{mutate:l,mutateAsync:c,...d}=en({mutationKey:["data","default","settings"],mutationFn:h=>a.uploadFile({path:"profile/logo",file:h,key:"logo"}),onError:()=>o.invalidateQueries({queryKey:["data","default","settings"]}),onSuccess:()=>{o.invalidateQueries({queryKey:["data","default","settings"]})}});return{upload:l,uploadAsync:c,...d}}}},_S=()=>{var O,k;const[n,a]=M.useState("profile"),{useOne:r,useUpdate:o,useUploadLogo:l}=nS(),{toast:c}=_n(),{data:d,status:h,error:p}=r(),x=M.useMemo(()=>({contact_information:"",default_payment_method:"",default_notes:"",default_legal_terms:"",default_quote_validity:"",default_show_line_discount_column:!0,default_tax:{amount:void 0,scale:2},default_tax_label:"% IVA"}),[]),{mutate:v}=o(),{upload:R}=l(),y=Ji({mode:"onBlur",values:d==null?void 0:d.dealer,defaultValues:x}),{formState:b,reset:E,getValues:j,handleSubmit:D}=y,{isSubmitting:F,isDirty:q}=b,$=H=>{var B;const W=(B=H.target.files)==null?void 0:B[0];if(W){if(W.type!=="image/png"&&W.type!=="image/jpeg"){alert(w("settings.form_fields.logo.invalid_format"));return}const se=new FileReader;se.onloadend=()=>{const ce=new Image;ce.onload=()=>{const Y=ce.width,Re=ce.height,rt=Y/Re===2;Y<200||Re<100||!rt?alert(w("settings.form_fields.logo.invalid_dimensions")):R(W)},ce.src=se.result},se.readAsDataURL(W)}};Mo({isDirty:q});const Q=async H=>{v(H,{onError:W=>{console.debug(W),c({title:"Error",description:W.message,variant:"destructive"})},onSuccess:()=>{E(j()),c({description:"Ajustes guardados",variant:"success"})}})};return F?i.jsx(Dn,{title:"Guardando ajustes"}):h==="error"?i.jsx(ur,{errorMessage:p.message}):h!=="success"?i.jsx(Dn,{}):i.jsx(es,{...y,children:i.jsx("form",{onSubmit:D(Q),children:i.jsxs("div",{className:"mx-auto grid w-full max-w-6xl items-start gap-6 md:grid-cols-[180px_1fr] lg:grid-cols-[250px_1fr]",children:[((O=y.formState.errors.root)==null?void 0:O.message)&&i.jsxs(qc,{variant:"destructive",children:[i.jsx(fd,{className:"w-4 h-4"}),i.jsx($c,{children:i.jsx(le,{i18nKey:"common.error"})}),i.jsx(zc,{children:(k=y.formState.errors.root)==null?void 0:k.message})]}),i.jsxs("nav",{className:"grid gap-4 text-sm text-muted-foreground",children:[i.jsx("a",{onClick:()=>a("profile"),className:n==="profile"?"font-semibold text-primary":"cursor-pointer",children:i.jsx(le,{i18nKey:"settings.edit.tabs.profile"})}),i.jsx("a",{onClick:()=>a("quotes"),className:n==="quotes"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(le,{i18nKey:"settings.edit.tabs.quotes"})}),i.jsx("a",{onClick:()=>a("legal"),className:n==="legal"?"font-semibold text-primary":"cursor-pointer ",children:i.jsx(le,{i18nKey:"settings.edit.tabs.legal"})})]}),i.jsxs("div",{className:he("grid gap-6",n==="profile"?"visible":"hidden"),children:[i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.contact_information.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.contact_information.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{rows:8,placeholder:w("settings.form_fields.contact_information.placeholder"),name:"contact_information",required:!0})}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.logo.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.logo.desc"})})]}),i.jsx(Oe,{children:i.jsxs("div",{className:"flex items-center space-x-4",children:[i.jsx("div",{className:"w-[400px] h-[200px] border border-gray-300 flex items-center justify-center overflow-hidden",children:i.jsx("img",{src:d.dealer.logo?d.dealer.logo:"https://via.placeholder.com/200x100",width:400,height:200,style:{objectFit:"contain"}})}),i.jsx("div",{children:i.jsx("p",{className:"mt-2 text-sm text-gray-500",children:i.jsx(le,{i18nKey:"settings.form_fields.logo.requirements"})})})]})}),i.jsxs(Dt,{className:"px-6 py-4 border-t",children:[i.jsx(cr,{htmlFor:"logo-upload",className:"inline-flex items-center justify-center h-10 px-4 py-2 text-sm font-medium transition-colors rounded-md cursor-pointer bg-primary text-primary-foreground hover:bg-primary/90 whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",children:i.jsx(le,{i18nKey:"settings.form_fields.logo.upload"})}),i.jsx(Zi,{id:"logo-upload",type:"file",accept:".png,.jpg,.jpeg",onChange:$,className:"hidden"})]})]})]}),i.jsxs("div",{className:he("grid gap-6",n==="quotes"?"visible":"hidden"),children:[i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_show_line_discount_column.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_show_line_discount_column.desc"})})]}),i.jsx(Oe,{children:i.jsx(P0,{control:y.control,name:"default_show_line_discount_column",render:({field:H})=>i.jsx(So,{checked:H.value??!0,onCheckedChange:H.onChange})})}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_tax.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_tax.desc"})})]}),i.jsxs(Oe,{children:[i.jsx(mn,{maxLength:32,placeholder:w("settings.form_fields.default_tax_label.placeholder"),name:"default_tax_label",required:!0,description:w("settings.form_fields.default_tax_label.desc")}),i.jsx("br",{}),i.jsx(Hi,{scale:2,disabled:b.disabled,placeholder:w("settings.form_fields.default_tax.desc"),name:"default_tax",required:!0,description:w("settings.form_fields.default_tax.desc")})]}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_payment_method.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_payment_method.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_payment_method.placeholder"),name:"default_payment_method",required:!0,errors:y.formState.errors})}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_quote_validity.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_quote_validity.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_quote_validity.placeholder"),name:"default_quote_validity",required:!0})}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]}),i.jsxs(Le,{children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_notes.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_notes.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{autoSize:!0,placeholder:w("settings.form_fields.default_notes.placeholder"),name:"default_notes"})}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]})]}),i.jsx("div",{className:he("grid gap-6",n==="legal"?"visible":"hidden"),children:i.jsxs(Le,{className:"h-",children:[i.jsxs(pt,{children:[i.jsx(Ge,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_legal_terms.label"})}),i.jsx(Ze,{children:i.jsx(le,{i18nKey:"settings.form_fields.default_legal_terms.desc"})})]}),i.jsx(Oe,{children:i.jsx(qt,{rows:25,placeholder:w("settings.form_fields.default_legal_terms.placeholder"),name:"default_legal_terms"})}),i.jsx(Dt,{className:"px-6 py-4 border-t",children:i.jsx(G,{children:i.jsx(le,{i18nKey:"common.save"})})})]})})]})})})},rS=M.createContext(null),iS=({children:n})=>i.jsx(rS.Provider,{value:{},children:n}),bS=({children:n})=>i.jsx(ts,{children:i.jsx(iS,{children:i.jsxs(zr,{className:"settings-layout",children:[i.jsx(Br,{}),i.jsxs(Vr,{children:[i.jsx("div",{className:"grid w-full max-w-6xl gap-2 mx-auto",children:i.jsx("h1",{className:"text-2xl font-semibold md:text-3xl",children:i.jsx(le,{i18nKey:"settings.edit.title"})})}),n]})]})})});export{uS as CatalogLayout,cS as CatalogList,dS as DashboardPage,fS as DealerLayout,gS as DealersList,mS as ErrorPage,oS as LoginPageWithLanguageSelector,lS as LogoutPage,hS as QuoteCreate,pS as QuoteEdit,xS as QuotesLayout,vS as QuotesList,_S as SettingsEditor,bS as SettingsLayout}; diff --git a/dist/client/assets/index-CJmQk4ZY.js b/dist/client/assets/index-QDyDWtz5.js similarity index 64% rename from dist/client/assets/index-CJmQk4ZY.js rename to dist/client/assets/index-QDyDWtz5.js index 4888009..39bf335 100644 --- a/dist/client/assets/index-CJmQk4ZY.js +++ b/dist/client/assets/index-QDyDWtz5.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CCfX-UYJ.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); -var vle=Object.defineProperty;var Sj=t=>{throw TypeError(t)};var yle=(t,e,n)=>e in t?vle(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var He=(t,e,n)=>yle(t,typeof e!="symbol"?e+"":e,n),_P=(t,e,n)=>e.has(t)||Sj("Cannot "+n);var C=(t,e,n)=>(_P(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Sj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(_P(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),B=(t,e,n)=>(_P(t,e,"access private method"),n);var vs=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return C(t,e,r)}});function l5(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ble(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var c5={exports:{}},g1={},u5={exports:{}},Mt={};/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BVZyG6kc.js","assets/index-DtTssDoC.css"])))=>i.map(i=>d[i]); +var _le=Object.defineProperty;var Aj=t=>{throw TypeError(t)};var xle=(t,e,n)=>e in t?_le(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var He=(t,e,n)=>xle(t,typeof e!="symbol"?e+"":e,n),xP=(t,e,n)=>e.has(t)||Aj("Cannot "+n);var C=(t,e,n)=>(xP(t,e,"read from private field"),n?n.call(t):e.get(t)),z=(t,e,n)=>e.has(t)?Aj("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$=(t,e,n,r)=>(xP(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),B=(t,e,n)=>(xP(t,e,"access private method"),n);var vs=(t,e,n,r)=>({set _(s){$(t,e,s,n)},get _(){return C(t,e,r)}});function f5(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Sle(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var h5={exports:{}},v1={},p5={exports:{}},Mt={};/** * @license React * react.production.min.js * @@ -7,7 +7,7 @@ var vle=Object.defineProperty;var Sj=t=>{throw TypeError(t)};var yle=(t,e,n)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var qw=Symbol.for("react.element"),wle=Symbol.for("react.portal"),_le=Symbol.for("react.fragment"),xle=Symbol.for("react.strict_mode"),Sle=Symbol.for("react.profiler"),Ele=Symbol.for("react.provider"),Cle=Symbol.for("react.context"),Ale=Symbol.for("react.forward_ref"),Rle=Symbol.for("react.suspense"),Ple=Symbol.for("react.memo"),Tle=Symbol.for("react.lazy"),Ej=Symbol.iterator;function kle(t){return t===null||typeof t!="object"?null:(t=Ej&&t[Ej]||t["@@iterator"],typeof t=="function"?t:null)}var d5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f5=Object.assign,h5={};function mv(t,e,n){this.props=t,this.context=e,this.refs=h5,this.updater=n||d5}mv.prototype.isReactComponent={};mv.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};mv.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function p5(){}p5.prototype=mv.prototype;function iM(t,e,n){this.props=t,this.context=e,this.refs=h5,this.updater=n||d5}var oM=iM.prototype=new p5;oM.constructor=iM;f5(oM,mv.prototype);oM.isPureReactComponent=!0;var Cj=Array.isArray,m5=Object.prototype.hasOwnProperty,aM={current:null},g5={key:!0,ref:!0,__self:!0,__source:!0};function v5(t,e,n){var r,s={},i=null,a=null;if(e!=null)for(r in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)m5.call(e,r)&&!g5.hasOwnProperty(r)&&(s[r]=e[r]);var o=arguments.length-2;if(o===1)s.children=n;else if(1{throw TypeError(t)};var yle=(t,e,n)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Lle=_,Ile=Symbol.for("react.element"),$le=Symbol.for("react.fragment"),Fle=Object.prototype.hasOwnProperty,jle=Lle.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,zle={key:!0,ref:!0,__self:!0,__source:!0};function b5(t,e,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)Fle.call(e,r)&&!zle.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:Ile,type:t,key:i,ref:a,props:s,_owner:jle.current}}g1.Fragment=$le;g1.jsx=b5;g1.jsxs=b5;c5.exports=g1;var P=c5.exports,xk={},w5={exports:{}},ao={},_5={exports:{}},x5={};/** + */var jle=_,zle=Symbol.for("react.element"),Ble=Symbol.for("react.fragment"),Ule=Object.prototype.hasOwnProperty,Hle=jle.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Vle={key:!0,ref:!0,__self:!0,__source:!0};function S5(t,e,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(r in e)Ule.call(e,r)&&!Vle.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:zle,type:t,key:i,ref:a,props:s,_owner:Hle.current}}v1.Fragment=Ble;v1.jsx=S5;v1.jsxs=S5;h5.exports=v1;var P=h5.exports,Sk={},E5={exports:{}},ao={},C5={exports:{}},A5={};/** * @license React * scheduler.production.min.js * @@ -23,7 +23,7 @@ var vle=Object.defineProperty;var Sj=t=>{throw TypeError(t)};var yle=(t,e,n)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(H,ee){var re=H.length;H.push(ee);e:for(;0>>1,q=H[X];if(0>>1;Xs(ue,re))des(ie,ue)?(H[X]=ie,H[de]=re,X=de):(H[X]=ue,H[Z]=re,X=Z);else if(des(ie,re))H[X]=ie,H[de]=re,X=de;else break e}}return ee}function s(H,ee){var re=H.sortIndex-ee.sortIndex;return re!==0?re:H.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var c=[],u=[],f=1,l=null,d=3,m=!1,p=!1,h=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(H){for(var ee=n(u);ee!==null;){if(ee.callback===null)r(u);else if(ee.startTime<=H)r(u),ee.sortIndex=ee.expirationTime,e(c,ee);else break;ee=n(u)}}function x(H){if(h=!1,w(H),!p)if(n(c)!==null)p=!0,Y(A);else{var ee=n(u);ee!==null&&V(x,ee.startTime-H)}}function A(H,ee){p=!1,h&&(h=!1,g(E),E=-1),m=!0;var re=d;try{for(w(ee),l=n(c);l!==null&&(!(l.expirationTime>ee)||H&&!O());){var X=l.callback;if(typeof X=="function"){l.callback=null,d=l.priorityLevel;var q=X(l.expirationTime<=ee);ee=t.unstable_now(),typeof q=="function"?l.callback=q:l===n(c)&&r(c),w(ee)}else r(c);l=n(c)}if(l!==null)var K=!0;else{var Z=n(u);Z!==null&&V(x,Z.startTime-ee),K=!1}return K}finally{l=null,d=re,m=!1}}var k=!1,R=null,E=-1,T=5,D=-1;function O(){return!(t.unstable_now()-DH||125X?(H.sortIndex=re,e(u,H),n(c)===null&&H===n(u)&&(h?(g(E),E=-1):h=!0,V(x,re-X))):(H.sortIndex=q,e(c,H),p||m||(p=!0,Y(A))),H},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(H){var ee=d;return function(){var re=d;d=ee;try{return H.apply(this,arguments)}finally{d=re}}}})(x5);_5.exports=x5;var Ble=_5.exports;/** + */(function(t){function e(H,ee){var re=H.length;H.push(ee);e:for(;0>>1,q=H[X];if(0>>1;Xs(ue,re))des(ie,ue)?(H[X]=ie,H[de]=re,X=de):(H[X]=ue,H[Z]=re,X=Z);else if(des(ie,re))H[X]=ie,H[de]=re,X=de;else break e}}return ee}function s(H,ee){var re=H.sortIndex-ee.sortIndex;return re!==0?re:H.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var c=[],u=[],f=1,l=null,d=3,m=!1,p=!1,h=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(H){for(var ee=n(u);ee!==null;){if(ee.callback===null)r(u);else if(ee.startTime<=H)r(u),ee.sortIndex=ee.expirationTime,e(c,ee);else break;ee=n(u)}}function x(H){if(h=!1,w(H),!p)if(n(c)!==null)p=!0,Y(A);else{var ee=n(u);ee!==null&&V(x,ee.startTime-H)}}function A(H,ee){p=!1,h&&(h=!1,g(E),E=-1),m=!0;var re=d;try{for(w(ee),l=n(c);l!==null&&(!(l.expirationTime>ee)||H&&!O());){var X=l.callback;if(typeof X=="function"){l.callback=null,d=l.priorityLevel;var q=X(l.expirationTime<=ee);ee=t.unstable_now(),typeof q=="function"?l.callback=q:l===n(c)&&r(c),w(ee)}else r(c);l=n(c)}if(l!==null)var K=!0;else{var Z=n(u);Z!==null&&V(x,Z.startTime-ee),K=!1}return K}finally{l=null,d=re,m=!1}}var k=!1,R=null,E=-1,T=5,D=-1;function O(){return!(t.unstable_now()-DH||125X?(H.sortIndex=re,e(u,H),n(c)===null&&H===n(u)&&(h?(g(E),E=-1):h=!0,V(x,re-X))):(H.sortIndex=q,e(c,H),p||m||(p=!0,Y(A))),H},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(H){var ee=d;return function(){var re=d;d=ee;try{return H.apply(this,arguments)}finally{d=re}}}})(A5);C5.exports=A5;var Wle=C5.exports;/** * @license React * react-dom.production.min.js * @@ -31,125 +31,125 @@ var vle=Object.defineProperty;var Sj=t=>{throw TypeError(t)};var yle=(t,e,n)=>e * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ule=_,io=Ble;function ke(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sk=Object.prototype.hasOwnProperty,Hle=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Rj={},Pj={};function Vle(t){return Sk.call(Pj,t)?!0:Sk.call(Rj,t)?!1:Hle.test(t)?Pj[t]=!0:(Rj[t]=!0,!1)}function Wle(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Gle(t,e,n,r){if(e===null||typeof e>"u"||Wle(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Zs(t,e,n,r,s,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var ds={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ds[t]=new Zs(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ds[e]=new Zs(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ds[t]=new Zs(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ds[t]=new Zs(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ds[t]=new Zs(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ds[t]=new Zs(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ds[t]=new Zs(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ds[t]=new Zs(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ds[t]=new Zs(t,5,!1,t.toLowerCase(),null,!1,!1)});var cM=/[\-:]([a-z])/g;function uM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(cM,uM);ds[e]=new Zs(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(cM,uM);ds[e]=new Zs(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(cM,uM);ds[e]=new Zs(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ds[t]=new Zs(t,1,!1,t.toLowerCase(),null,!1,!1)});ds.xlinkHref=new Zs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ds[t]=new Zs(t,1,!1,t.toLowerCase(),null,!0,!0)});function dM(t,e,n,r){var s=ds.hasOwnProperty(e)?ds[e]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ek=Object.prototype.hasOwnProperty,qle=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,kj={},Dj={};function Kle(t){return Ek.call(Dj,t)?!0:Ek.call(kj,t)?!1:qle.test(t)?Dj[t]=!0:(kj[t]=!0,!1)}function Yle(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function Xle(t,e,n,r){if(e===null||typeof e>"u"||Yle(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Zs(t,e,n,r,s,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var ds={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ds[t]=new Zs(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ds[e]=new Zs(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ds[t]=new Zs(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ds[t]=new Zs(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ds[t]=new Zs(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ds[t]=new Zs(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ds[t]=new Zs(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ds[t]=new Zs(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ds[t]=new Zs(t,5,!1,t.toLowerCase(),null,!1,!1)});var dM=/[\-:]([a-z])/g;function fM(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(dM,fM);ds[e]=new Zs(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(dM,fM);ds[e]=new Zs(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(dM,fM);ds[e]=new Zs(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ds[t]=new Zs(t,1,!1,t.toLowerCase(),null,!1,!1)});ds.xlinkHref=new Zs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ds[t]=new Zs(t,1,!1,t.toLowerCase(),null,!0,!0)});function hM(t,e,n,r){var s=ds.hasOwnProperty(e)?ds[e]:null;(s!==null?s.type!==0:r||!(2o||s[a]!==i[o]){var c=` -`+s[a].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=a&&0<=o);break}}}finally{EP=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ny(t):""}function qle(t){switch(t.tag){case 5:return Ny(t.type);case 16:return Ny("Lazy");case 13:return Ny("Suspense");case 19:return Ny("SuspenseList");case 0:case 2:case 15:return t=CP(t.type,!1),t;case 11:return t=CP(t.type.render,!1),t;case 1:return t=CP(t.type,!0),t;default:return""}}function Rk(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case lm:return"Fragment";case am:return"Portal";case Ek:return"Profiler";case fM:return"StrictMode";case Ck:return"Suspense";case Ak:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case C5:return(t.displayName||"Context")+".Consumer";case E5:return(t._context.displayName||"Context")+".Provider";case hM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case pM:return e=t.displayName||null,e!==null?e:Rk(t.type)||"Memo";case Su:e=t._payload,t=t._init;try{return Rk(t(e))}catch{}}return null}function Kle(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Rk(e);case 8:return e===fM?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function _d(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function R5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Yle(t){var e=R5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ox(t){t._valueTracker||(t._valueTracker=Yle(t))}function P5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=R5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function CE(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Pk(t,e){var n=e.checked;return rr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function kj(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=_d(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function T5(t,e){e=e.checked,e!=null&&dM(t,"checked",e,!1)}function Tk(t,e){T5(t,e);var n=_d(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?kk(t,e.type,n):e.hasOwnProperty("defaultValue")&&kk(t,e.type,_d(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Dj(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function kk(t,e,n){(e!=="number"||CE(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Oy=Array.isArray;function Em(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=Mx.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ab(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ib={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},Xle=["Webkit","ms","Moz","O"];Object.keys(ib).forEach(function(t){Xle.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ib[e]=ib[t]})});function O5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ib.hasOwnProperty(t)&&ib[t]?(""+e).trim():e+"px"}function M5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=O5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var Qle=rr({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 Ok(t,e){if(e){if(Qle[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ke(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ke(62))}}function Mk(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Lk=null;function mM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ik=null,Cm=null,Am=null;function Mj(t){if(t=Qw(t)){if(typeof Ik!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=_1(e),Ik(t.stateNode,t.type,e))}}function L5(t){Cm?Am?Am.push(t):Am=[t]:Cm=t}function I5(){if(Cm){var t=Cm,e=Am;if(Am=Cm=null,Mj(t),e)for(t=0;t>>=0,t===0?32:31-(lce(t)/cce|0)|0}var Lx=64,Ix=4194304;function My(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function TE(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=My(o):(i&=a,i!==0&&(r=My(i)))}else a=n&~s,a!==0?r=My(a):i!==0&&(r=My(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Yw(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ya(e),t[e]=n}function hce(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=ab),Hj=" ",Vj=!1;function nH(t,e){switch(t){case"keyup":return Bce.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rH(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var cm=!1;function Hce(t,e){switch(t){case"compositionend":return rH(e);case"keypress":return e.which!==32?null:(Vj=!0,Hj);case"textInput":return t=e.data,t===Hj&&Vj?null:t;default:return null}}function Vce(t,e){if(cm)return t==="compositionend"||!SM&&nH(t,e)?(t=eH(),kS=wM=ld=null,cm=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kj(n)}}function aH(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?aH(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function lH(){for(var t=window,e=CE();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=CE(t.document)}return e}function EM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Jce(t){var e=lH(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&aH(n.ownerDocument.documentElement,n)){if(r!==null&&EM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=Yj(n,i);var a=Yj(n,r);s&&a&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,um=null,Uk=null,cb=null,Hk=!1;function Xj(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hk||um==null||um!==CE(r)||(r=um,"selectionStart"in r&&EM(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}),cb&&Nb(cb,r)||(cb=r,r=NE(Uk,"onSelect"),0hm||(t.current=Yk[hm],Yk[hm]=null,hm--)}function On(t,e){hm++,Yk[hm]=t.current,t.current=e}var xd={},Ns=Od(xd),wi=Od(!1),Lh=xd;function Jg(t,e){var n=t.type.contextTypes;if(!n)return xd;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function _i(t){return t=t.childContextTypes,t!=null}function ME(){Bn(wi),Bn(Ns)}function r3(t,e,n){if(Ns.current!==xd)throw Error(ke(168));On(Ns,e),On(wi,n)}function vH(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(ke(108,Kle(t)||"Unknown",s));return rr({},n,r)}function LE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||xd,Lh=Ns.current,On(Ns,t),On(wi,wi.current),!0}function s3(t,e,n){var r=t.stateNode;if(!r)throw Error(ke(169));n?(t=vH(t,e,Lh),r.__reactInternalMemoizedMergedChildContext=t,Bn(wi),Bn(Ns),On(Ns,t)):Bn(wi),On(wi,n)}var Ql=null,x1=!1,jP=!1;function yH(t){Ql===null?Ql=[t]:Ql.push(t)}function due(t){x1=!0,yH(t)}function Md(){if(!jP&&Ql!==null){jP=!0;var t=0,e=pn;try{var n=Ql;for(pn=1;t>=a,s-=a,Rc=1<<32-ya(e)+s|n<E?(T=R,R=null):T=R.sibling;var D=d(g,R,w[E],x);if(D===null){R===null&&(R=T);break}t&&R&&D.alternate===null&&e(g,R),v=i(D,v,E),k===null?A=D:k.sibling=D,k=D,R=T}if(E===w.length)return n(g,R),qn&&lf(g,E),A;if(R===null){for(;EE?(T=R,R=null):T=R.sibling;var O=d(g,R,D.value,x);if(O===null){R===null&&(R=T);break}t&&R&&O.alternate===null&&e(g,R),v=i(O,v,E),k===null?A=O:k.sibling=O,k=O,R=T}if(D.done)return n(g,R),qn&&lf(g,E),A;if(R===null){for(;!D.done;E++,D=w.next())D=l(g,D.value,x),D!==null&&(v=i(D,v,E),k===null?A=D:k.sibling=D,k=D);return qn&&lf(g,E),A}for(R=r(g,R);!D.done;E++,D=w.next())D=m(R,g,E,D.value,x),D!==null&&(t&&D.alternate!==null&&R.delete(D.key===null?E:D.key),v=i(D,v,E),k===null?A=D:k.sibling=D,k=D);return t&&R.forEach(function(L){return e(g,L)}),qn&&lf(g,E),A}function y(g,v,w,x){if(typeof w=="object"&&w!==null&&w.type===lm&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Nx:e:{for(var A=w.key,k=v;k!==null;){if(k.key===A){if(A=w.type,A===lm){if(k.tag===7){n(g,k.sibling),v=s(k,w.props.children),v.return=g,g=v;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Su&&a3(A)===k.type){n(g,k.sibling),v=s(k,w.props),v.ref=cy(g,k,w),v.return=g,g=v;break e}n(g,k);break}else e(g,k);k=k.sibling}w.type===lm?(v=kh(w.props.children,g.mode,x,w.key),v.return=g,g=v):(x=FS(w.type,w.key,w.props,null,g.mode,x),x.ref=cy(g,v,w),x.return=g,g=x)}return a(g);case am:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),v=s(v,w.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=qP(w,g.mode,x),v.return=g,g=v}return a(g);case Su:return k=w._init,y(g,v,k(w._payload),x)}if(Oy(w))return p(g,v,w,x);if(sy(w))return h(g,v,w,x);Hx(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),v=s(v,w),v.return=g,g=v):(n(g,v),v=GP(w,g.mode,x),v.return=g,g=v),a(g)):n(g,v)}return y}var tv=xH(!0),SH=xH(!1),FE=Od(null),jE=null,gm=null,PM=null;function TM(){PM=gm=jE=null}function kM(t){var e=FE.current;Bn(FE),t._currentValue=e}function Zk(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Pm(t,e){jE=t,PM=gm=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(mi=!0),t.firstContext=null)}function Io(t){var e=t._currentValue;if(PM!==t)if(t={context:t,memoizedValue:e,next:null},gm===null){if(jE===null)throw Error(ke(308));gm=t,jE.dependencies={lanes:0,firstContext:t}}else gm=gm.next=t;return e}var wf=null;function DM(t){wf===null?wf=[t]:wf.push(t)}function EH(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,DM(e)):(n.next=s.next,s.next=n),e.interleaved=n,jc(t,r)}function jc(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Eu=!1;function NM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function CH(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Tc(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function md(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,qt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,jc(t,n)}return s=r.interleaved,s===null?(e.next=e,DM(r)):(e.next=s.next,s.next=e),r.interleaved=e,jc(t,n)}function NS(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,vM(t,n)}}function l3(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function zE(t,e,n,r){var s=t.updateQueue;Eu=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var f=t.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==a&&(o===null?f.firstBaseUpdate=u:o.next=u,f.lastBaseUpdate=c))}if(i!==null){var l=s.baseState;a=0,f=u=c=null,o=i;do{var d=o.lane,m=o.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=t,h=o;switch(d=e,m=n,h.tag){case 1:if(p=h.payload,typeof p=="function"){l=p.call(m,l,d);break e}l=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=h.payload,d=typeof p=="function"?p.call(m,l,d):p,d==null)break e;l=rr({},l,d);break e;case 2:Eu=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,d=s.effects,d===null?s.effects=[o]:d.push(o))}else m={eventTime:m,lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(u=f=m,c=l):f=f.next=m,a|=d;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;d=o,o=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(f===null&&(c=l),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=f,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Fh|=a,t.lanes=a,t.memoizedState=l}}function c3(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=BP.transition;BP.transition={};try{t(!1),e()}finally{pn=n,BP.transition=r}}function UH(){return $o().memoizedState}function mue(t,e,n){var r=vd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},HH(t))VH(e,n);else if(n=EH(t,e,n,r),n!==null){var s=Ks();ba(n,t,r,s),WH(n,e,r)}}function gue(t,e,n){var r=vd(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(HH(t))VH(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,xa(o,a)){var c=e.interleaved;c===null?(s.next=s,DM(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=EH(t,e,s,r),n!==null&&(s=Ks(),ba(n,t,r,s),WH(n,e,r))}}function HH(t){var e=t.alternate;return t===nr||e!==null&&e===nr}function VH(t,e){ub=UE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function WH(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,vM(t,n)}}var HE={readContext:Io,useCallback:ys,useContext:ys,useEffect:ys,useImperativeHandle:ys,useInsertionEffect:ys,useLayoutEffect:ys,useMemo:ys,useReducer:ys,useRef:ys,useState:ys,useDebugValue:ys,useDeferredValue:ys,useTransition:ys,useMutableSource:ys,useSyncExternalStore:ys,useId:ys,unstable_isNewReconciler:!1},vue={readContext:Io,useCallback:function(t,e){return Ba().memoizedState=[t,e===void 0?null:e],t},useContext:Io,useEffect:d3,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,MS(4194308,4,$H.bind(null,e,t),n)},useLayoutEffect:function(t,e){return MS(4194308,4,t,e)},useInsertionEffect:function(t,e){return MS(4,2,t,e)},useMemo:function(t,e){var n=Ba();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Ba();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=mue.bind(null,nr,t),[r.memoizedState,t]},useRef:function(t){var e=Ba();return t={current:t},e.memoizedState=t},useState:u3,useDebugValue:zM,useDeferredValue:function(t){return Ba().memoizedState=t},useTransition:function(){var t=u3(!1),e=t[0];return t=pue.bind(null,t[1]),Ba().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=nr,s=Ba();if(qn){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=e(),Qr===null)throw Error(ke(349));$h&30||TH(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,d3(DH.bind(null,r,i,t),[t]),r.flags|=2048,zb(9,kH.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Ba(),e=Qr.identifierPrefix;if(qn){var n=Pc,r=Rc;n=(r&~(1<<32-ya(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Fb++,0")&&(c=c.replace("",t.displayName)),c}while(1<=a&&0<=o);break}}}finally{CP=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ny(t):""}function Qle(t){switch(t.tag){case 5:return Ny(t.type);case 16:return Ny("Lazy");case 13:return Ny("Suspense");case 19:return Ny("SuspenseList");case 0:case 2:case 15:return t=AP(t.type,!1),t;case 11:return t=AP(t.type.render,!1),t;case 1:return t=AP(t.type,!0),t;default:return""}}function Pk(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case cm:return"Fragment";case lm:return"Portal";case Ck:return"Profiler";case pM:return"StrictMode";case Ak:return"Suspense";case Rk:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case T5:return(t.displayName||"Context")+".Consumer";case P5:return(t._context.displayName||"Context")+".Provider";case mM:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gM:return e=t.displayName||null,e!==null?e:Pk(t.type)||"Memo";case Su:e=t._payload,t=t._init;try{return Pk(t(e))}catch{}}return null}function Zle(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Pk(e);case 8:return e===pM?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function _d(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function D5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Jle(t){var e=D5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Mx(t){t._valueTracker||(t._valueTracker=Jle(t))}function N5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=D5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function AE(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Tk(t,e){var n=e.checked;return rr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Oj(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=_d(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function O5(t,e){e=e.checked,e!=null&&hM(t,"checked",e,!1)}function kk(t,e){O5(t,e);var n=_d(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Dk(t,e.type,n):e.hasOwnProperty("defaultValue")&&Dk(t,e.type,_d(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Mj(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Dk(t,e,n){(e!=="number"||AE(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Oy=Array.isArray;function Em(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=Lx.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ab(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ib={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},ece=["Webkit","ms","Moz","O"];Object.keys(ib).forEach(function(t){ece.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ib[e]=ib[t]})});function $5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ib.hasOwnProperty(t)&&ib[t]?(""+e).trim():e+"px"}function F5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=$5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var tce=rr({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 Mk(t,e){if(e){if(tce[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ke(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ke(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ke(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ke(62))}}function Lk(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Ik=null;function vM(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var $k=null,Cm=null,Am=null;function $j(t){if(t=Zw(t)){if(typeof $k!="function")throw Error(ke(280));var e=t.stateNode;e&&(e=x1(e),$k(t.stateNode,t.type,e))}}function j5(t){Cm?Am?Am.push(t):Am=[t]:Cm=t}function z5(){if(Cm){var t=Cm,e=Am;if(Am=Cm=null,$j(t),e)for(t=0;t>>=0,t===0?32:31-(fce(t)/hce|0)|0}var Ix=64,$x=4194304;function My(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function kE(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,a=n&268435455;if(a!==0){var o=a&~s;o!==0?r=My(o):(i&=a,i!==0&&(r=My(i)))}else a=n&~s,a!==0?r=My(a):i!==0&&(r=My(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Xw(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ba(e),t[e]=n}function vce(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=ab),Gj=" ",qj=!1;function oH(t,e){switch(t){case"keyup":return Wce.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aH(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var um=!1;function qce(t,e){switch(t){case"compositionend":return aH(e);case"keypress":return e.which!==32?null:(qj=!0,Gj);case"textInput":return t=e.data,t===Gj&&qj?null:t;default:return null}}function Kce(t,e){if(um)return t==="compositionend"||!CM&&oH(t,e)?(t=sH(),DS=xM=ld=null,um=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qj(n)}}function dH(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?dH(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function fH(){for(var t=window,e=AE();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=AE(t.document)}return e}function AM(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function rue(t){var e=fH(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&dH(n.ownerDocument.documentElement,n)){if(r!==null&&AM(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=Zj(n,i);var a=Zj(n,r);s&&a&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,dm=null,Hk=null,cb=null,Vk=!1;function Jj(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vk||dm==null||dm!==AE(r)||(r=dm,"selectionStart"in r&&AM(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}),cb&&Nb(cb,r)||(cb=r,r=OE(Hk,"onSelect"),0pm||(t.current=Xk[pm],Xk[pm]=null,pm--)}function On(t,e){pm++,Xk[pm]=t.current,t.current=e}var xd={},Ns=Od(xd),wi=Od(!1),Ih=xd;function Jg(t,e){var n=t.type.contextTypes;if(!n)return xd;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function _i(t){return t=t.childContextTypes,t!=null}function LE(){Bn(wi),Bn(Ns)}function o3(t,e,n){if(Ns.current!==xd)throw Error(ke(168));On(Ns,e),On(wi,n)}function _H(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(ke(108,Zle(t)||"Unknown",s));return rr({},n,r)}function IE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||xd,Ih=Ns.current,On(Ns,t),On(wi,wi.current),!0}function a3(t,e,n){var r=t.stateNode;if(!r)throw Error(ke(169));n?(t=_H(t,e,Ih),r.__reactInternalMemoizedMergedChildContext=t,Bn(wi),Bn(Ns),On(Ns,t)):Bn(wi),On(wi,n)}var Zl=null,S1=!1,zP=!1;function xH(t){Zl===null?Zl=[t]:Zl.push(t)}function mue(t){S1=!0,xH(t)}function Md(){if(!zP&&Zl!==null){zP=!0;var t=0,e=pn;try{var n=Zl;for(pn=1;t>=a,s-=a,Pc=1<<32-ba(e)+s|n<E?(T=R,R=null):T=R.sibling;var D=d(g,R,w[E],x);if(D===null){R===null&&(R=T);break}t&&R&&D.alternate===null&&e(g,R),v=i(D,v,E),k===null?A=D:k.sibling=D,k=D,R=T}if(E===w.length)return n(g,R),qn&&lf(g,E),A;if(R===null){for(;EE?(T=R,R=null):T=R.sibling;var O=d(g,R,D.value,x);if(O===null){R===null&&(R=T);break}t&&R&&O.alternate===null&&e(g,R),v=i(O,v,E),k===null?A=O:k.sibling=O,k=O,R=T}if(D.done)return n(g,R),qn&&lf(g,E),A;if(R===null){for(;!D.done;E++,D=w.next())D=l(g,D.value,x),D!==null&&(v=i(D,v,E),k===null?A=D:k.sibling=D,k=D);return qn&&lf(g,E),A}for(R=r(g,R);!D.done;E++,D=w.next())D=m(R,g,E,D.value,x),D!==null&&(t&&D.alternate!==null&&R.delete(D.key===null?E:D.key),v=i(D,v,E),k===null?A=D:k.sibling=D,k=D);return t&&R.forEach(function(L){return e(g,L)}),qn&&lf(g,E),A}function y(g,v,w,x){if(typeof w=="object"&&w!==null&&w.type===cm&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ox:e:{for(var A=w.key,k=v;k!==null;){if(k.key===A){if(A=w.type,A===cm){if(k.tag===7){n(g,k.sibling),v=s(k,w.props.children),v.return=g,g=v;break e}}else if(k.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Su&&u3(A)===k.type){n(g,k.sibling),v=s(k,w.props),v.ref=cy(g,k,w),v.return=g,g=v;break e}n(g,k);break}else e(g,k);k=k.sibling}w.type===cm?(v=Dh(w.props.children,g.mode,x,w.key),v.return=g,g=v):(x=jS(w.type,w.key,w.props,null,g.mode,x),x.ref=cy(g,v,w),x.return=g,g=x)}return a(g);case lm:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(g,v.sibling),v=s(v,w.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else e(g,v);v=v.sibling}v=KP(w,g.mode,x),v.return=g,g=v}return a(g);case Su:return k=w._init,y(g,v,k(w._payload),x)}if(Oy(w))return p(g,v,w,x);if(sy(w))return h(g,v,w,x);Vx(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(g,v.sibling),v=s(v,w),v.return=g,g=v):(n(g,v),v=qP(w,g.mode,x),v.return=g,g=v),a(g)):n(g,v)}return y}var tv=AH(!0),RH=AH(!1),jE=Od(null),zE=null,vm=null,kM=null;function DM(){kM=vm=zE=null}function NM(t){var e=jE.current;Bn(jE),t._currentValue=e}function Jk(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Pm(t,e){zE=t,kM=vm=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(mi=!0),t.firstContext=null)}function $o(t){var e=t._currentValue;if(kM!==t)if(t={context:t,memoizedValue:e,next:null},vm===null){if(zE===null)throw Error(ke(308));vm=t,zE.dependencies={lanes:0,firstContext:t}}else vm=vm.next=t;return e}var wf=null;function OM(t){wf===null?wf=[t]:wf.push(t)}function PH(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,OM(e)):(n.next=s.next,s.next=n),e.interleaved=n,zc(t,r)}function zc(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Eu=!1;function MM(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function TH(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function kc(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function md(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,qt&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,zc(t,n)}return s=r.interleaved,s===null?(e.next=e,OM(r)):(e.next=s.next,s.next=e),r.interleaved=e,zc(t,n)}function OS(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bM(t,n)}}function d3(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function BE(t,e,n,r){var s=t.updateQueue;Eu=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var f=t.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==a&&(o===null?f.firstBaseUpdate=u:o.next=u,f.lastBaseUpdate=c))}if(i!==null){var l=s.baseState;a=0,f=u=c=null,o=i;do{var d=o.lane,m=o.eventTime;if((r&d)===d){f!==null&&(f=f.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var p=t,h=o;switch(d=e,m=n,h.tag){case 1:if(p=h.payload,typeof p=="function"){l=p.call(m,l,d);break e}l=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=h.payload,d=typeof p=="function"?p.call(m,l,d):p,d==null)break e;l=rr({},l,d);break e;case 2:Eu=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,d=s.effects,d===null?s.effects=[o]:d.push(o))}else m={eventTime:m,lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(u=f=m,c=l):f=f.next=m,a|=d;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;d=o,o=d.next,d.next=null,s.lastBaseUpdate=d,s.shared.pending=null}}while(!0);if(f===null&&(c=l),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=f,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);jh|=a,t.lanes=a,t.memoizedState=l}}function f3(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=UP.transition;UP.transition={};try{t(!1),e()}finally{pn=n,UP.transition=r}}function GH(){return Fo().memoizedState}function bue(t,e,n){var r=vd(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},qH(t))KH(e,n);else if(n=PH(t,e,n,r),n!==null){var s=Ks();wa(n,t,r,s),YH(n,e,r)}}function wue(t,e,n){var r=vd(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(qH(t))KH(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,n);if(s.hasEagerState=!0,s.eagerState=o,Sa(o,a)){var c=e.interleaved;c===null?(s.next=s,OM(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}n=PH(t,e,s,r),n!==null&&(s=Ks(),wa(n,t,r,s),YH(n,e,r))}}function qH(t){var e=t.alternate;return t===nr||e!==null&&e===nr}function KH(t,e){ub=HE=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function YH(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bM(t,n)}}var VE={readContext:$o,useCallback:ys,useContext:ys,useEffect:ys,useImperativeHandle:ys,useInsertionEffect:ys,useLayoutEffect:ys,useMemo:ys,useReducer:ys,useRef:ys,useState:ys,useDebugValue:ys,useDeferredValue:ys,useTransition:ys,useMutableSource:ys,useSyncExternalStore:ys,useId:ys,unstable_isNewReconciler:!1},_ue={readContext:$o,useCallback:function(t,e){return Ua().memoizedState=[t,e===void 0?null:e],t},useContext:$o,useEffect:p3,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,LS(4194308,4,BH.bind(null,e,t),n)},useLayoutEffect:function(t,e){return LS(4194308,4,t,e)},useInsertionEffect:function(t,e){return LS(4,2,t,e)},useMemo:function(t,e){var n=Ua();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Ua();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=bue.bind(null,nr,t),[r.memoizedState,t]},useRef:function(t){var e=Ua();return t={current:t},e.memoizedState=t},useState:h3,useDebugValue:UM,useDeferredValue:function(t){return Ua().memoizedState=t},useTransition:function(){var t=h3(!1),e=t[0];return t=yue.bind(null,t[1]),Ua().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=nr,s=Ua();if(qn){if(n===void 0)throw Error(ke(407));n=n()}else{if(n=e(),Qr===null)throw Error(ke(349));Fh&30||OH(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,p3(LH.bind(null,r,i,t),[t]),r.flags|=2048,zb(9,MH.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Ua(),e=Qr.identifierPrefix;if(qn){var n=Tc,r=Pc;n=(r&~(1<<32-ba(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Fb++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[ll]=e,t[Lb]=r,tV(t,e,!1,!1),e.stateNode=t;e:{switch(a=Mk(n,r),n){case"dialog":jn("cancel",t),jn("close",t),s=r;break;case"iframe":case"object":case"embed":jn("load",t),s=r;break;case"video":case"audio":for(s=0;ssv&&(e.flags|=128,r=!0,uy(i,!1),e.lanes=4194304)}else{if(!r)if(t=BE(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),uy(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qn)return bs(e),null}else 2*vr()-i.renderingStartTime>sv&&n!==1073741824&&(e.flags|=128,r=!0,uy(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=vr(),e.sibling=null,n=er.current,On(er,r?n&1|2:n&1),e):(bs(e),null);case 22:case 23:return GM(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ki&1073741824&&(bs(e),e.subtreeFlags&6&&(e.flags|=8192)):bs(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function Cue(t,e){switch(AM(e),e.tag){case 1:return _i(e.type)&&ME(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return nv(),Bn(wi),Bn(Ns),LM(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return MM(e),null;case 13:if(Bn(er),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));ev()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Bn(er),null;case 4:return nv(),null;case 10:return kM(e.type._context),null;case 22:case 23:return GM(),null;case 24:return null;default:return null}}var Wx=!1,Rs=!1,Aue=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function vm(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ur(t,e,r)}else n.current=null}function aD(t,e,n){try{n()}catch(r){ur(t,e,r)}}var x3=!1;function Rue(t,e){if(Vk=kE,t=lH(),EM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,f=0,l=t,d=null;t:for(;;){for(var m;l!==n||s!==0&&l.nodeType!==3||(o=a+s),l!==i||r!==0&&l.nodeType!==3||(c=a+r),l.nodeType===3&&(a+=l.nodeValue.length),(m=l.firstChild)!==null;)d=l,l=m;for(;;){if(l===t)break t;if(d===n&&++u===s&&(o=a),d===i&&++f===r&&(c=a),(m=l.nextSibling)!==null)break;l=d,d=l.parentNode}l=m}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Wk={focusedElem:t,selectionRange:n},kE=!1,Ge=e;Ge!==null;)if(e=Ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ge=t;else for(;Ge!==null;){e=Ge;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var h=p.memoizedProps,y=p.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?h:Xo(e.type,h),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(x){ur(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}return p=x3,x3=!1,p}function db(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&aD(e,n,i)}s=s.next}while(s!==r)}}function C1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function lD(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function sV(t){var e=t.alternate;e!==null&&(t.alternate=null,sV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ll],delete e[Lb],delete e[Kk],delete e[cue],delete e[uue])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function iV(t){return t.tag===5||t.tag===3||t.tag===4}function S3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||iV(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cD(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=OE));else if(r!==4&&(t=t.child,t!==null))for(cD(t,e,n),t=t.sibling;t!==null;)cD(t,e,n),t=t.sibling}function uD(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(uD(t,e,n),t=t.sibling;t!==null;)uD(t,e,n),t=t.sibling}var ls=null,ha=!1;function uu(t,e,n){for(n=n.child;n!==null;)oV(t,e,n),n=n.sibling}function oV(t,e,n){if(hl&&typeof hl.onCommitFiberUnmount=="function")try{hl.onCommitFiberUnmount(v1,n)}catch{}switch(n.tag){case 5:Rs||vm(n,e);case 6:var r=ls,s=ha;ls=null,uu(t,e,n),ls=r,ha=s,ls!==null&&(ha?(t=ls,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ls.removeChild(n.stateNode));break;case 18:ls!==null&&(ha?(t=ls,n=n.stateNode,t.nodeType===8?FP(t.parentNode,n):t.nodeType===1&&FP(t,n),kb(t)):FP(ls,n.stateNode));break;case 4:r=ls,s=ha,ls=n.stateNode.containerInfo,ha=!0,uu(t,e,n),ls=r,ha=s;break;case 0:case 11:case 14:case 15:if(!Rs&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&aD(n,e,a),s=s.next}while(s!==r)}uu(t,e,n);break;case 1:if(!Rs&&(vm(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ur(n,e,o)}uu(t,e,n);break;case 21:uu(t,e,n);break;case 22:n.mode&1?(Rs=(r=Rs)||n.memoizedState!==null,uu(t,e,n),Rs=r):uu(t,e,n);break;default:uu(t,e,n)}}function E3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Aue),e.forEach(function(r){var s=Iue.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Ko(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=vr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Tue(r/1960))-r,10t?16:t,cd===null)var r=!1;else{if(t=cd,cd=null,GE=0,qt&6)throw Error(ke(331));var s=qt;for(qt|=4,Ge=t.current;Ge!==null;){var i=Ge,a=i.child;if(Ge.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cvr()-VM?Th(t,0):HM|=n),xi(t,e)}function pV(t,e){e===0&&(t.mode&1?(e=Ix,Ix<<=1,!(Ix&130023424)&&(Ix=4194304)):e=1);var n=Ks();t=jc(t,e),t!==null&&(Yw(t,e,n),xi(t,n))}function Lue(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),pV(t,n)}function Iue(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ke(314))}r!==null&&r.delete(e),pV(t,n)}var mV;mV=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||wi.current)mi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return mi=!1,Sue(t,e,n);mi=!!(t.flags&131072)}else mi=!1,qn&&e.flags&1048576&&bH(e,$E,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;LS(t,e),t=e.pendingProps;var s=Jg(e,Ns.current);Pm(e,n),s=$M(null,e,r,t,s,n);var i=FM();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,_i(r)?(i=!0,LE(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,NM(e),s.updater=E1,e.stateNode=s,s._reactInternals=e,eD(e,r,t,n),e=rD(null,e,r,!0,i,n)):(e.tag=0,qn&&i&&CM(e),Hs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(LS(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=Fue(r),t=Xo(r,t),s){case 0:e=nD(null,e,r,t,n);break e;case 1:e=b3(null,e,r,t,n);break e;case 11:e=v3(null,e,r,t,n);break e;case 14:e=y3(null,e,r,Xo(r.type,t),n);break e}throw Error(ke(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Xo(r,s),nD(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Xo(r,s),b3(t,e,r,s,n);case 3:e:{if(ZH(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,CH(t,e),zE(e,r,null,n);var a=e.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=rv(Error(ke(423)),e),e=w3(t,e,r,n,s);break e}else if(r!==s){s=rv(Error(ke(424)),e),e=w3(t,e,r,n,s);break e}else for(eo=pd(e.stateNode.containerInfo.firstChild),to=e,qn=!0,ma=null,n=SH(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ev(),r===s){e=zc(t,e,n);break e}Hs(t,e,r,n)}e=e.child}return e;case 5:return AH(e),t===null&&Qk(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,Gk(r,s)?a=null:i!==null&&Gk(r,i)&&(e.flags|=32),QH(t,e),Hs(t,e,a,n),e.child;case 6:return t===null&&Qk(e),null;case 13:return JH(t,e,n);case 4:return OM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=tv(e,null,r,n):Hs(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Xo(r,s),v3(t,e,r,s,n);case 7:return Hs(t,e,e.pendingProps,n),e.child;case 8:return Hs(t,e,e.pendingProps.children,n),e.child;case 12:return Hs(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,a=s.value,On(FE,r._currentValue),r._currentValue=a,i!==null)if(xa(i.value,a)){if(i.children===s.children&&!wi.current){e=zc(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Tc(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Zk(i.return,n,e),o.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ke(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Zk(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Hs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Pm(e,n),s=Io(s),r=r(s),e.flags|=1,Hs(t,e,r,n),e.child;case 14:return r=e.type,s=Xo(r,e.pendingProps),s=Xo(r.type,s),y3(t,e,r,s,n);case 15:return YH(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Xo(r,s),LS(t,e),e.tag=1,_i(r)?(t=!0,LE(e)):t=!1,Pm(e,n),GH(e,r,s),eD(e,r,s,n),rD(null,e,r,!0,t,n);case 19:return eV(t,e,n);case 22:return XH(t,e,n)}throw Error(ke(156,e.tag))};function gV(t,e){return H5(t,e)}function $ue(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 Oo(t,e,n,r){return new $ue(t,e,n,r)}function KM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Fue(t){if(typeof t=="function")return KM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===hM)return 11;if(t===pM)return 14}return 2}function yd(t,e){var n=t.alternate;return n===null?(n=Oo(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function FS(t,e,n,r,s,i){var a=2;if(r=t,typeof t=="function")KM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case lm:return kh(n.children,s,i,e);case fM:a=8,s|=8;break;case Ek:return t=Oo(12,n,e,s|2),t.elementType=Ek,t.lanes=i,t;case Ck:return t=Oo(13,n,e,s),t.elementType=Ck,t.lanes=i,t;case Ak:return t=Oo(19,n,e,s),t.elementType=Ak,t.lanes=i,t;case A5:return R1(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E5:a=10;break e;case C5:a=9;break e;case hM:a=11;break e;case pM:a=14;break e;case Su:a=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Oo(a,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function kh(t,e,n,r){return t=Oo(7,t,r,e),t.lanes=n,t}function R1(t,e,n,r){return t=Oo(22,t,r,e),t.elementType=A5,t.lanes=n,t.stateNode={isHidden:!1},t}function GP(t,e,n){return t=Oo(6,t,null,e),t.lanes=n,t}function qP(t,e,n){return e=Oo(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function jue(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=RP(0),this.expirationTimes=RP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=RP(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function YM(t,e,n,r,s,i,a,o,c){return t=new jue(t,e,n,o,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Oo(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},NM(i),t}function zue(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wV)}catch(t){console.error(t)}}wV(),w5.exports=ao;var ks=w5.exports;const Jw=Dd(ks),Wue=l5({__proto__:null,default:Jw},[ks]);var N3=ks;xk.createRoot=N3.createRoot,xk.hydrateRoot=N3.hydrateRoot;const _V=_.createContext({}),Gue=({children:t,authActions:e})=>{const n=i=>{var a;try{return Promise.resolve((a=e.login)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},r=i=>{var a;try{return Promise.resolve((a=e.logout)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},s=async()=>{var i;try{return Promise.resolve((i=e.check)==null?void 0:i.call(e))}catch(a){return console.error(a),Promise.reject(a)}};return P.jsx(_V.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},xV=()=>{const t=_.useContext(_V);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var yv=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zh=typeof window>"u"||"Deno"in globalThis;function Eo(){}function que(t,e){return typeof t=="function"?t(e):t}function mD(t){return typeof t=="number"&&t>=0&&t!==1/0}function SV(t,e){return Math.max(t+(e||0)-Date.now(),0)}function km(t,e){return typeof t=="function"?t(e):t}function ga(t,e){return typeof t=="function"?t(e):t}function O3(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==JM(a,e.options))return!1}else if(!Ub(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||s&&s!==e.state.fetchStatus||i&&!i(e))}function M3(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Bh(e.options.mutationKey)!==Bh(i))return!1}else if(!Ub(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function JM(t,e){return((e==null?void 0:e.queryKeyHashFn)||Bh)(t)}function Bh(t){return JSON.stringify(t,(e,n)=>gD(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ub(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Ub(t[n],e[n])):!1}function EV(t,e){if(t===e)return t;const n=L3(t)&&L3(e);if(n||gD(t)&&gD(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),a=i.length,o=n?[]:{};let c=0;for(let u=0;u{setTimeout(e,t)})}function vD(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?EV(t,e):e}function D4e(t){return t}function Yue(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Xue(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var eL=Symbol();function CV(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===eL?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Af,Nu,Vm,XU,Que=(XU=class extends yv{constructor(){super();z(this,Af);z(this,Nu);z(this,Vm);$(this,Vm,e=>{if(!zh&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Nu)||this.setEventListener(C(this,Vm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Nu))==null||e.call(this),$(this,Nu,void 0))}setEventListener(e){var n;$(this,Vm,e),(n=C(this,Nu))==null||n.call(this),$(this,Nu,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){C(this,Af)!==e&&($(this,Af,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof C(this,Af)=="boolean"?C(this,Af):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Af=new WeakMap,Nu=new WeakMap,Vm=new WeakMap,XU),tL=new Que,Wm,Ou,Gm,QU,Zue=(QU=class extends yv{constructor(){super();z(this,Wm,!0);z(this,Ou);z(this,Gm);$(this,Gm,e=>{if(!zh&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,Ou)||this.setEventListener(C(this,Gm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Ou))==null||e.call(this),$(this,Ou,void 0))}setEventListener(e){var n;$(this,Gm,e),(n=C(this,Ou))==null||n.call(this),$(this,Ou,e(this.setOnline.bind(this)))}setOnline(e){C(this,Wm)!==e&&($(this,Wm,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return C(this,Wm)}},Wm=new WeakMap,Ou=new WeakMap,Gm=new WeakMap,QU),XE=new Zue;function yD(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function Jue(t){return Math.min(1e3*2**t,3e4)}function AV(t){return(t??"online")==="online"?XE.isOnline():!0}var RV=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function KP(t){return t instanceof RV}function PV(t){let e=!1,n=0,r=!1,s;const i=yD(),a=h=>{var y;r||(d(new RV(h)),(y=t.abort)==null||y.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>tL.isFocused()&&(t.networkMode==="always"||XE.isOnline())&&t.canRun(),f=()=>AV(t.networkMode)&&t.canRun(),l=h=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,h),s==null||s(),i.resolve(h))},d=h=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,h),s==null||s(),i.reject(h))},m=()=>new Promise(h=>{var y;s=g=>{(r||u())&&h(g)},(y=t.onPause)==null||y.call(t)}).then(()=>{var h;s=void 0,r||(h=t.onContinue)==null||h.call(t)}),p=()=>{if(r)return;let h;const y=n===0?t.initialPromise:void 0;try{h=y??t.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{var k;if(r)return;const v=t.retry??(zh?0:3),w=t.retryDelay??Jue,x=typeof w=="function"?w(n,g):w,A=v===!0||typeof v=="number"&&nu()?void 0:m()).then(()=>{e?d(g):p()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:o,continueRetry:c,canStart:f,start:()=>(f()?p():m().then(p),i)}}var ede=t=>setTimeout(t,0);function tde(){let t=[],e=0,n=o=>{o()},r=o=>{o()},s=ede;const i=o=>{e?t.push(o):s(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var zr=tde(),Rf,ZU,TV=(ZU=class{constructor(){z(this,Rf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mD(this.gcTime)&&$(this,Rf,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(zh?1/0:5*60*1e3))}clearGcTimeout(){C(this,Rf)&&(clearTimeout(C(this,Rf)),$(this,Rf,void 0))}},Rf=new WeakMap,ZU),qm,Km,bo,Pf,Ss,d0,Tf,Zo,Vl,JU,nde=(JU=class extends TV{constructor(e){super();z(this,Zo);z(this,qm);z(this,Km);z(this,bo);z(this,Pf);z(this,Ss);z(this,d0);z(this,Tf);$(this,Tf,!1),$(this,d0,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,Pf,e.client),$(this,bo,C(this,Pf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,qm,rde(this.options)),this.state=e.state??C(this,qm),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=C(this,Ss))==null?void 0:e.promise}setOptions(e){this.options={...C(this,d0),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,bo).remove(this)}setData(e,n){const r=vD(this.state.data,e,this.options);return B(this,Zo,Vl).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){B(this,Zo,Vl).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=C(this,Ss))==null?void 0:r.promise;return(s=C(this,Ss))==null||s.cancel(e),n?n.then(Eo).catch(Eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,qm))}isActive(){return this.observers.some(e=>ga(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===eL||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!SV(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Ss))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Ss))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,bo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(C(this,Ss)&&(C(this,Tf)?C(this,Ss).cancel({revert:!0}):C(this,Ss).cancelRetry()),this.scheduleGc()),C(this,bo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||B(this,Zo,Vl).call(this,{type:"invalidate"})}fetch(e,n){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ss))return C(this,Ss).continueRetry(),C(this,Ss).promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>($(this,Tf,!0),r.signal)})},i=()=>{const l=CV(this.options,n),d={client:C(this,Pf),queryKey:this.queryKey,meta:this.meta};return s(d),$(this,Tf,!1),this.options.persister?this.options.persister(l,d,this):l(d)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,Pf),state:this.state,fetchFn:i};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,Km,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&B(this,Zo,Vl).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const o=l=>{var d,m,p,h;KP(l)&&l.silent||B(this,Zo,Vl).call(this,{type:"error",error:l}),KP(l)||((m=(d=C(this,bo).config).onError)==null||m.call(d,l,this),(h=(p=C(this,bo).config).onSettled)==null||h.call(p,this.state.data,l,this)),this.scheduleGc()};return $(this,Ss,PV({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{var d,m,p,h;if(l===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(y){o(y);return}(m=(d=C(this,bo).config).onSuccess)==null||m.call(d,l,this),(h=(p=C(this,bo).config).onSettled)==null||h.call(p,l,this.state.error,this),this.scheduleGc()},onError:o,onFail:(l,d)=>{B(this,Zo,Vl).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{B(this,Zo,Vl).call(this,{type:"pause"})},onContinue:()=>{B(this,Zo,Vl).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,Ss).start()}},qm=new WeakMap,Km=new WeakMap,bo=new WeakMap,Pf=new WeakMap,Ss=new WeakMap,d0=new WeakMap,Tf=new WeakMap,Zo=new WeakSet,Vl=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...kV(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return KP(s)&&s.revert&&C(this,Km)?{...C(this,Km),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,bo).notify({query:this,type:"updated",action:e})})},JU);function kV(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:AV(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function rde(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ua,e5,sde=(e5=class extends yv{constructor(e={}){super();z(this,Ua);this.config=e,$(this,Ua,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??JM(s,n);let a=this.get(i);return a||(a=new nde({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){C(this,Ua).has(e.queryHash)||(C(this,Ua).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=C(this,Ua).get(e.queryHash);n&&(e.destroy(),n===e&&C(this,Ua).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Ua).get(e)}getAll(){return[...C(this,Ua).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>O3(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>O3(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ua=new WeakMap,e5),Ha,js,kf,Va,mu,t5,ide=(t5=class extends TV{constructor(e){super();z(this,Va);z(this,Ha);z(this,js);z(this,kf);this.mutationId=e.mutationId,$(this,js,e.mutationCache),$(this,Ha,[]),this.state=e.state||DV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,Ha).includes(e)||(C(this,Ha).push(e),this.clearGcTimeout(),C(this,js).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,Ha,C(this,Ha).filter(n=>n!==e)),this.scheduleGc(),C(this,js).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,Ha).length||(this.state.status==="pending"?this.scheduleGc():C(this,js).remove(this))}continue(){var e;return((e=C(this,kf))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,a,o,c,u,f,l,d,m,p,h,y,g,v,w,x,A,k,R;$(this,kf,PV({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,T)=>{B(this,Va,mu).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{B(this,Va,mu).call(this,{type:"pause"})},onContinue:()=>{B(this,Va,mu).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,js).canRun(this)}));const n=this.state.status==="pending",r=!C(this,kf).canStart();try{if(!n){B(this,Va,mu).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=C(this,js).config).onMutate)==null?void 0:i.call(s,e,this));const T=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));T!==this.state.context&&B(this,Va,mu).call(this,{type:"pending",context:T,variables:e,isPaused:r})}const E=await C(this,kf).start();return await((u=(c=C(this,js).config).onSuccess)==null?void 0:u.call(c,E,e,this.state.context,this)),await((l=(f=this.options).onSuccess)==null?void 0:l.call(f,E,e,this.state.context)),await((m=(d=C(this,js).config).onSettled)==null?void 0:m.call(d,E,null,this.state.variables,this.state.context,this)),await((h=(p=this.options).onSettled)==null?void 0:h.call(p,E,null,e,this.state.context)),B(this,Va,mu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=C(this,js).config).onError)==null?void 0:g.call(y,E,e,this.state.context,this)),await((w=(v=this.options).onError)==null?void 0:w.call(v,E,e,this.state.context)),await((A=(x=C(this,js).config).onSettled)==null?void 0:A.call(x,void 0,E,this.state.variables,this.state.context,this)),await((R=(k=this.options).onSettled)==null?void 0:R.call(k,void 0,E,e,this.state.context)),E}finally{B(this,Va,mu).call(this,{type:"error",error:E})}}finally{C(this,js).runNext(this)}}},Ha=new WeakMap,js=new WeakMap,kf=new WeakMap,Va=new WeakSet,mu=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zr.batch(()=>{C(this,Ha).forEach(r=>{r.onMutationUpdate(e)}),C(this,js).notify({mutation:this,type:"updated",action:e})})},t5);function DV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ec,Jo,f0,n5,ode=(n5=class extends yv{constructor(e={}){super();z(this,ec);z(this,Jo);z(this,f0);this.config=e,$(this,ec,new Set),$(this,Jo,new Map),$(this,f0,0)}build(e,n,r){const s=new ide({mutationCache:this,mutationId:++vs(this,f0)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){C(this,ec).add(e);const n=Kx(e);if(typeof n=="string"){const r=C(this,Jo).get(n);r?r.push(e):C(this,Jo).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,ec).delete(e)){const n=Kx(e);if(typeof n=="string"){const r=C(this,Jo).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&C(this,Jo).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Kx(e);if(typeof n=="string"){const r=C(this,Jo).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Kx(e);if(typeof n=="string"){const s=(r=C(this,Jo).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{C(this,ec).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,ec).clear(),C(this,Jo).clear()})}getAll(){return Array.from(C(this,ec))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>M3(n,r))}findAll(e={}){return this.getAll().filter(n=>M3(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Eo))))}},ec=new WeakMap,Jo=new WeakMap,f0=new WeakMap,n5);function Kx(t){var e;return(e=t.options.scope)==null?void 0:e.id}function $3(t){return{onFetch:(e,n)=>{var f,l,d,m,p;const r=e.options,s=(d=(l=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:l.fetchMore)==null?void 0:d.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],a=((p=e.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},g=CV(e.options,e.fetchOptions),v=async(w,x,A)=>{if(h)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const k={client:e.client,queryKey:e.queryKey,pageParam:x,direction:A?"backward":"forward",meta:e.options.meta};y(k);const R=await g(k),{maxPages:E}=e.options,T=A?Xue:Yue;return{pages:T(w.pages,R,E),pageParams:T(w.pageParams,x,E)}};if(s&&i.length){const w=s==="backward",x=w?ade:F3,A={pages:i,pageParams:a},k=x(r,A);o=await v(A,k,w)}else{const w=t??i.length;do{const x=c===0?a[0]??r.initialPageParam:F3(r,o);if(c>0&&x==null)break;o=await v(o,x),c++}while(c{var h,y;return(y=(h=e.options).persister)==null?void 0:y.call(h,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function F3(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function ade(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var lr,Mu,Lu,Ym,Xm,Iu,Qm,Zm,r5,lde=(r5=class{constructor(t={}){z(this,lr);z(this,Mu);z(this,Lu);z(this,Ym);z(this,Xm);z(this,Iu);z(this,Qm);z(this,Zm);$(this,lr,t.queryCache||new sde),$(this,Mu,t.mutationCache||new ode),$(this,Lu,t.defaultOptions||{}),$(this,Ym,new Map),$(this,Xm,new Map),$(this,Iu,0)}mount(){vs(this,Iu)._++,C(this,Iu)===1&&($(this,Qm,tL.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,lr).onFocus())})),$(this,Zm,XE.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,lr).onOnline())})))}unmount(){var t,e;vs(this,Iu)._--,C(this,Iu)===0&&((t=C(this,Qm))==null||t.call(this),$(this,Qm,void 0),(e=C(this,Zm))==null||e.call(this),$(this,Zm,void 0))}isFetching(t){return C(this,lr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,Mu).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,lr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=C(this,lr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(km(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return C(this,lr).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=C(this,lr).get(r.queryHash),i=s==null?void 0:s.state.data,a=que(e,i);if(a!==void 0)return C(this,lr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>C(this,lr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,lr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=C(this,lr);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=C(this,lr);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>C(this,lr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Eo).catch(Eo)}invalidateQueries(t,e={}){return zr.batch(()=>(C(this,lr).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>C(this,lr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Eo)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Eo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=C(this,lr).build(this,e);return n.isStaleByTime(km(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Eo).catch(Eo)}fetchInfiniteQuery(t){return t.behavior=$3(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Eo).catch(Eo)}ensureInfiniteQueryData(t){return t.behavior=$3(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return XE.isOnline()?C(this,Mu).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,lr)}getMutationCache(){return C(this,Mu)}getDefaultOptions(){return C(this,Lu)}setDefaultOptions(t){$(this,Lu,t)}setQueryDefaults(t,e){C(this,Ym).set(Bh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,Ym).values()],n={};return e.forEach(r=>{Ub(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){C(this,Xm).set(Bh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,Xm).values()],n={};return e.forEach(r=>{Ub(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,Lu).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=JM(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===eL&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,Lu).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,lr).clear(),C(this,Mu).clear()}},lr=new WeakMap,Mu=new WeakMap,Lu=new WeakMap,Ym=new WeakMap,Xm=new WeakMap,Iu=new WeakMap,Qm=new WeakMap,Zm=new WeakMap,r5),ai,jt,h0,zs,Df,Jm,$u,Wa,p0,eg,tg,Nf,Of,Fu,ng,sn,Iy,bD,wD,_D,xD,SD,ED,CD,NV,s5,cde=(s5=class extends yv{constructor(e,n){super();z(this,sn);z(this,ai);z(this,jt);z(this,h0);z(this,zs);z(this,Df);z(this,Jm);z(this,$u);z(this,Wa);z(this,p0);z(this,eg);z(this,tg);z(this,Nf);z(this,Of);z(this,Fu);z(this,ng,new Set);this.options=n,$(this,ai,e),$(this,Wa,null),$(this,$u,yD()),this.options.experimental_prefetchInRender||C(this,$u).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,jt).addObserver(this),j3(C(this,jt),this.options)?B(this,sn,Iy).call(this):this.updateResult(),B(this,sn,xD).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return AD(C(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return AD(C(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,B(this,sn,SD).call(this),B(this,sn,ED).call(this),C(this,jt).removeObserver(this)}setOptions(e){const n=this.options,r=C(this,jt);if(this.options=C(this,ai).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ga(this.options.enabled,C(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");B(this,sn,CD).call(this),C(this,jt).setOptions(this.options),n._defaulted&&!YE(this.options,n)&&C(this,ai).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,jt),observer:this});const s=this.hasListeners();s&&z3(C(this,jt),r,this.options,n)&&B(this,sn,Iy).call(this),this.updateResult(),s&&(C(this,jt)!==r||ga(this.options.enabled,C(this,jt))!==ga(n.enabled,C(this,jt))||km(this.options.staleTime,C(this,jt))!==km(n.staleTime,C(this,jt)))&&B(this,sn,bD).call(this);const i=B(this,sn,wD).call(this);s&&(C(this,jt)!==r||ga(this.options.enabled,C(this,jt))!==ga(n.enabled,C(this,jt))||i!==C(this,Fu))&&B(this,sn,_D).call(this,i)}getOptimisticResult(e){const n=C(this,ai).getQueryCache().build(C(this,ai),e),r=this.createResult(n,e);return dde(this,r)&&($(this,zs,r),$(this,Jm,this.options),$(this,Df,C(this,jt).state)),r}getCurrentResult(){return C(this,zs)}trackResult(e,n){const r={};return Object.keys(e).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),e[s])})}),r}trackProp(e){C(this,ng).add(e)}getCurrentQuery(){return C(this,jt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=C(this,ai).defaultQueryOptions(e),r=C(this,ai).getQueryCache().build(C(this,ai),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return B(this,sn,Iy).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,zs)))}createResult(e,n){var E;const r=C(this,jt),s=this.options,i=C(this,zs),a=C(this,Df),o=C(this,Jm),u=e!==r?e.state:C(this,h0),{state:f}=e;let l={...f},d=!1,m;if(n._optimisticResults){const T=this.hasListeners(),D=!T&&j3(e,n),O=T&&z3(e,r,n,s);(D||O)&&(l={...l,...kV(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:p,errorUpdatedAt:h,status:y}=l;if(n.select&&l.data!==void 0)if(i&&l.data===(a==null?void 0:a.data)&&n.select===C(this,p0))m=C(this,eg);else try{$(this,p0,n.select),m=n.select(l.data),m=vD(i==null?void 0:i.data,m,n),$(this,eg,m),$(this,Wa,null)}catch(T){$(this,Wa,T)}else m=l.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((E=C(this,tg))==null?void 0:E.state.data,C(this,tg)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),$(this,Wa,null)}catch(D){$(this,Wa,D)}T!==void 0&&(y="success",m=vD(i==null?void 0:i.data,T,n),d=!0)}C(this,Wa)&&(p=C(this,Wa),m=C(this,eg),h=Date.now(),y="error");const g=l.fetchStatus==="fetching",v=y==="pending",w=y==="error",x=v&&g,A=m!==void 0,R={status:y,fetchStatus:l.fetchStatus,isPending:v,isSuccess:y==="success",isError:w,isInitialLoading:x,isLoading:x,data:m,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:w&&!A,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&A,isStale:nL(e,n),refetch:this.refetch,promise:C(this,$u)};if(this.options.experimental_prefetchInRender){const T=L=>{R.status==="error"?L.reject(R.error):R.data!==void 0&&L.resolve(R.data)},D=()=>{const L=$(this,$u,R.promise=yD());T(L)},O=C(this,$u);switch(O.status){case"pending":e.queryHash===r.queryHash&&T(O);break;case"fulfilled":(R.status==="error"||R.data!==O.value)&&D();break;case"rejected":(R.status!=="error"||R.error!==O.reason)&&D();break}}return R}updateResult(){const e=C(this,zs),n=this.createResult(C(this,jt),this.options);if($(this,Df,C(this,jt).state),$(this,Jm,this.options),C(this,Df).data!==void 0&&$(this,tg,C(this,jt)),YE(n,e))return;$(this,zs,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,ng).size)return!0;const a=new Set(i??C(this,ng));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,zs)).some(o=>{const c=o;return C(this,zs)[c]!==e[c]&&a.has(c)})};B(this,sn,NV).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&B(this,sn,xD).call(this)}},ai=new WeakMap,jt=new WeakMap,h0=new WeakMap,zs=new WeakMap,Df=new WeakMap,Jm=new WeakMap,$u=new WeakMap,Wa=new WeakMap,p0=new WeakMap,eg=new WeakMap,tg=new WeakMap,Nf=new WeakMap,Of=new WeakMap,Fu=new WeakMap,ng=new WeakMap,sn=new WeakSet,Iy=function(e){B(this,sn,CD).call(this);let n=C(this,jt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Eo)),n},bD=function(){B(this,sn,SD).call(this);const e=km(this.options.staleTime,C(this,jt));if(zh||C(this,zs).isStale||!mD(e))return;const r=SV(C(this,zs).dataUpdatedAt,e)+1;$(this,Nf,setTimeout(()=>{C(this,zs).isStale||this.updateResult()},r))},wD=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,jt)):this.options.refetchInterval)??!1},_D=function(e){B(this,sn,ED).call(this),$(this,Fu,e),!(zh||ga(this.options.enabled,C(this,jt))===!1||!mD(C(this,Fu))||C(this,Fu)===0)&&$(this,Of,setInterval(()=>{(this.options.refetchIntervalInBackground||tL.isFocused())&&B(this,sn,Iy).call(this)},C(this,Fu)))},xD=function(){B(this,sn,bD).call(this),B(this,sn,_D).call(this,B(this,sn,wD).call(this))},SD=function(){C(this,Nf)&&(clearTimeout(C(this,Nf)),$(this,Nf,void 0))},ED=function(){C(this,Of)&&(clearInterval(C(this,Of)),$(this,Of,void 0))},CD=function(){const e=C(this,ai).getQueryCache().build(C(this,ai),this.options);if(e===C(this,jt))return;const n=C(this,jt);$(this,jt,e),$(this,h0,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},NV=function(e){zr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(C(this,zs))}),C(this,ai).getQueryCache().notify({query:C(this,jt),type:"observerResultsUpdated"})})},s5);function ude(t,e){return ga(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function j3(t,e){return ude(t,e)||t.state.data!==void 0&&AD(t,e,e.refetchOnMount)}function AD(t,e,n){if(ga(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&nL(t,e)}return!1}function z3(t,e,n,r){return(t!==e||ga(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&nL(t,n)}function nL(t,e){return ga(e.enabled,t)!==!1&&t.isStaleByTime(km(e.staleTime,t))}function dde(t,e){return!YE(t.getCurrentResult(),e)}var ju,zu,li,tc,Mc,jS,RD,i5,fde=(i5=class extends yv{constructor(n,r){super();z(this,Mc);z(this,ju);z(this,zu);z(this,li);z(this,tc);$(this,ju,n),this.setOptions(r),this.bindMethods(),B(this,Mc,jS).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=C(this,ju).defaultMutationOptions(n),YE(this.options,r)||C(this,ju).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,li),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Bh(r.mutationKey)!==Bh(this.options.mutationKey)?this.reset():((s=C(this,li))==null?void 0:s.state.status)==="pending"&&C(this,li).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,li))==null||n.removeObserver(this)}onMutationUpdate(n){B(this,Mc,jS).call(this),B(this,Mc,RD).call(this,n)}getCurrentResult(){return C(this,zu)}reset(){var n;(n=C(this,li))==null||n.removeObserver(this),$(this,li,void 0),B(this,Mc,jS).call(this),B(this,Mc,RD).call(this)}mutate(n,r){var s;return $(this,tc,r),(s=C(this,li))==null||s.removeObserver(this),$(this,li,C(this,ju).getMutationCache().build(C(this,ju),this.options)),C(this,li).addObserver(this),C(this,li).execute(n)}},ju=new WeakMap,zu=new WeakMap,li=new WeakMap,tc=new WeakMap,Mc=new WeakSet,jS=function(){var r;const n=((r=C(this,li))==null?void 0:r.state)??DV();$(this,zu,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},RD=function(n){zr.batch(()=>{var r,s,i,a,o,c,u,f;if(C(this,tc)&&this.hasListeners()){const l=C(this,zu).variables,d=C(this,zu).context;(n==null?void 0:n.type)==="success"?((s=(r=C(this,tc)).onSuccess)==null||s.call(r,n.data,l,d),(a=(i=C(this,tc)).onSettled)==null||a.call(i,n.data,null,l,d)):(n==null?void 0:n.type)==="error"&&((c=(o=C(this,tc)).onError)==null||c.call(o,n.error,l,d),(f=(u=C(this,tc)).onSettled)==null||f.call(u,void 0,n.error,l,d))}this.listeners.forEach(l=>{l(C(this,zu))})})},i5),OV=_.createContext(void 0),MV=t=>{const e=_.useContext(OV);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},hde=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P.jsx(OV.Provider,{value:t,children:e})),LV=_.createContext(!1),pde=()=>_.useContext(LV);LV.Provider;function mde(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var gde=_.createContext(mde()),vde=()=>_.useContext(gde);function IV(t,e){return typeof t=="function"?t(...e):!!t}function PD(){}var yde=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},bde=t=>{_.useEffect(()=>{t.clearReset()},[t])},wde=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||IV(n,[t.error,r])),_de=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},xde=(t,e)=>t.isLoading&&t.isFetching&&!e,Sde=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,B3=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Ede(t,e,n){var l,d,m,p,h;const r=MV(),s=pde(),i=vde(),a=r.defaultQueryOptions(t);(d=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_beforeQuery)==null||d.call(l,a),a._optimisticResults=s?"isRestoring":"optimistic",_de(a),yde(a,i),bde(i);const o=!r.getQueryCache().get(a.queryHash),[c]=_.useState(()=>new e(r,a)),u=c.getOptimisticResult(a),f=!s&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(y=>{const g=f?c.subscribe(zr.batchCalls(y)):PD;return c.updateResult(),g},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),Sde(a,u))throw B3(a,c,i);if(wde({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||p.call(m,a,u),a.experimental_prefetchInRender&&!zh&&xde(u,s)){const y=o?B3(a,c,i):(h=r.getQueryCache().get(a.queryHash))==null?void 0:h.promise;y==null||y.catch(PD).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function $V(t,e){return Ede(t,cde)}function Cde(t,e){const n=MV(),[r]=_.useState(()=>new fde(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(zr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=_.useCallback((a,o)=>{r.mutate(a,o).catch(PD)},[r]);if(s.error&&IV(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class Fo{constructor(e=[]){He(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class Ld extends Fo{params(e){return new Fo([...this.segments,e])}}class Ade extends Fo{id(e){return new Ld([...this.segments,e?String(e):void 0])}}class Rde extends Fo{ids(...e){return new Ld([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class Pde extends Fo{action(e){if(["one","report"].includes(e))return new Ade([...this.segments,e]);if(e==="many")return new Rde([...this.segments,e]);if(["list","infinite"].includes(e))return new Ld([...this.segments,e]);throw new Error("Invalid action type")}}class Tde extends Fo{resource(e){return new Pde([...this.segments,e])}mutation(e){return new Ld([...e==="custom"?this.segments:[this.segments[0]],e])}}class kde extends Fo{action(e){return new Ld([...this.segments,e])}}class Dde extends Fo{action(e){return new Ld([...this.segments,e])}}class Nde extends Fo{resource(e){return new Dde([...this.segments,e])}}class Ode extends Fo{action(e){return new Ld([...this.segments,e])}}class Mde extends Fo{resource(e){return new Ode([...this.segments,e])}action(e){return new Ld([...this.segments,e])}}class Lde extends Fo{data(e){return new Tde(["data",e||"default"])}auth(){return new kde(["auth"])}access(){return new Nde(["access"])}audit(){return new Mde(["audit"])}}const Ide=()=>new Lde([]),FV=()=>Ide,jV=t=>{const e=FV(),{getProfile:n}=xV();return $V({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},$de=t=>{const e=FV(),{check:n}=xV();return $V({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})};function Fde(t,e){const n=_.createContext(e);function r(i){const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})}function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,s]}function Pn(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];function u(l){const{scope:d,children:m,...p}=l,h=(d==null?void 0:d[t][c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})}function f(l,d){const m=(d==null?void 0:d[t][c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,jde(s,...e)]}function jde(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function zde(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function e_(...t){return e=>t.forEach(n=>zde(n,e))}function tt(...t){return _.useCallback(e_(...t),t)}var Sa=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(Bde);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(TD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(TD,{...r,ref:e,children:n})});Sa.displayName="Slot";var TD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=Hde(n);return _.cloneElement(n,{...Ude(r,n.props),ref:e?e_(e,s):s})}return _.Children.count(n)>1?_.Children.only(null):null});TD.displayName="SlotClone";var rL=({children:t})=>P.jsx(P.Fragment,{children:t});function Bde(t){return _.isValidElement(t)&&t.type===rL}function Ude(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function Hde(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function qc(t){const e=t+"CollectionProvider",[n,r]=Pn(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:p,children:h}=m,y=se.useRef(null),g=se.useRef(new Map).current;return P.jsx(s,{scope:p,itemMap:g,collectionRef:y,children:h})};a.displayName=e;const o=t+"CollectionSlot",c=se.forwardRef((m,p)=>{const{scope:h,children:y}=m,g=i(o,h),v=tt(p,g.collectionRef);return P.jsx(Sa,{ref:v,children:y})});c.displayName=o;const u=t+"CollectionItemSlot",f="data-radix-collection-item",l=se.forwardRef((m,p)=>{const{scope:h,children:y,...g}=m,v=se.useRef(null),w=tt(p,v),x=i(u,h);return se.useEffect(()=>(x.itemMap.set(v,{ref:v,...g}),()=>void x.itemMap.delete(v))),P.jsx(Sa,{[f]:"",ref:w,children:y})});l.displayName=u;function d(m){const p=i(t+"CollectionConsumer",m);return se.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(p.itemMap.values()).sort((x,A)=>g.indexOf(x.ref.current)-g.indexOf(A.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:c,ItemSlot:l},d,r]}function me(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Bt(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function sr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Vde({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Bt(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function Vde({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=Bt(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var Wde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],De=Wde.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?Sa:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Hb(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}var Mn=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Gde(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var Un=t=>{const{present:e,children:n}=t,r=qde(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=tt(r.ref,Kde(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};Un.displayName="Presence";function qde(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=Gde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Yx(r.current);i.current=o==="mounted"?u:"none"},[o]),Mn(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=Yx(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),Mn(()=>{if(e){const u=l=>{const m=Yx(r.current).includes(l.animationName);l.target===e&&m&&ks.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=Yx(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Yx(t){return(t==null?void 0:t.animationName)||"none"}function Kde(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Yde=Kw.useId||(()=>{}),Xde=0;function Hr(t){const[e,n]=_.useState(Yde());return Mn(()=>{n(r=>r??String(Xde++))},[t]),e?`radix-${e}`:""}var sL="Collapsible",[Qde,zV]=Pn(sL),[Zde,iL]=Qde(sL),BV=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...o}=t,[c=!1,u]=sr({prop:r,defaultProp:s,onChange:a});return P.jsx(Zde,{scope:n,disabled:i,contentId:Hr(),open:c,onOpenToggle:_.useCallback(()=>u(f=>!f),[u]),children:P.jsx(De.div,{"data-state":aL(c),"data-disabled":i?"":void 0,...o,ref:e})})});BV.displayName=sL;var UV="CollapsibleTrigger",HV=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=iL(UV,n);return P.jsx(De.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":aL(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:me(t.onClick,s.onOpenToggle)})});HV.displayName=UV;var oL="CollapsibleContent",VV=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=iL(oL,t.__scopeCollapsible);return P.jsx(Un,{present:n||s.open,children:({present:i})=>P.jsx(Jde,{...r,ref:e,present:i})})});VV.displayName=oL;var Jde=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=iL(oL,n),[o,c]=_.useState(r),u=_.useRef(null),f=tt(e,u),l=_.useRef(0),d=l.current,m=_.useRef(0),p=m.current,h=a.open||o,y=_.useRef(h),g=_.useRef();return _.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),Mn(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();l.current=w.height,m.current=w.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[a.open,r]),P.jsx(De.div,{"data-state":aL(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...i,ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style},children:h&&s})});function aL(t){return t?"open":"closed"}var efe=BV,tfe=HV,nfe=VV,rfe=_.createContext(void 0);function Ta(t){const e=_.useContext(rfe);return t||e||"ltr"}var Kc="Accordion",sfe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[lL,ife,ofe]=qc(Kc),[N1,O4e]=Pn(Kc,[ofe,zV]),cL=zV(),afe=se.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return P.jsx(lL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?P.jsx(dfe,{...i,ref:e}):P.jsx(ufe,{...s,ref:e})})});afe.displayName=Kc;var[WV,lfe]=N1(Kc),[GV,cfe]=N1(Kc,{collapsible:!1}),ufe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[o,c]=sr({prop:n,defaultProp:r,onChange:s});return P.jsx(WV,{scope:t.__scopeAccordion,value:o?[o]:[],onItemOpen:c,onItemClose:se.useCallback(()=>i&&c(""),[i,c]),children:P.jsx(GV,{scope:t.__scopeAccordion,collapsible:i,children:P.jsx(qV,{...a,ref:e})})})}),dfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=sr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(WV,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:P.jsx(GV,{scope:t.__scopeAccordion,collapsible:!0,children:P.jsx(qV,{...i,ref:e})})})}),[ffe,O1]=N1(Kc),qV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,o=se.useRef(null),c=tt(o,e),u=ife(n),l=Ta(s)==="ltr",d=me(t.onKeyDown,m=>{var E;if(!sfe.includes(m.key))return;const p=m.target,h=u().filter(T=>{var D;return!((D=T.ref.current)!=null&&D.disabled)}),y=h.findIndex(T=>T.ref.current===p),g=h.length;if(y===-1)return;m.preventDefault();let v=y;const w=0,x=g-1,A=()=>{v=y+1,v>x&&(v=w)},k=()=>{v=y-1,v{const{__scopeAccordion:n,value:r,...s}=t,i=O1(QE,n),a=lfe(QE,n),o=cL(n),c=Hr(),u=r&&a.value.includes(r)||!1,f=i.disabled||t.disabled;return P.jsx(hfe,{scope:n,open:u,disabled:f,triggerId:c,children:P.jsx(efe,{"data-orientation":i.orientation,"data-state":e6(u),...o,...s,ref:e,disabled:f,open:u,onOpenChange:l=>{l?a.onItemOpen(r):a.onItemClose(r)}})})});KV.displayName=QE;var YV="AccordionHeader",XV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=O1(Kc,n),i=uL(YV,n);return P.jsx(De.h3,{"data-orientation":s.orientation,"data-state":e6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});XV.displayName=YV;var kD="AccordionTrigger",QV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=O1(Kc,n),i=uL(kD,n),a=cfe(kD,n),o=cL(n);return P.jsx(lL.ItemSlot,{scope:n,children:P.jsx(tfe,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...o,...r,ref:e})})});QV.displayName=kD;var ZV="AccordionContent",JV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=O1(Kc,n),i=uL(ZV,n),a=cL(n);return P.jsx(nfe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});JV.displayName=ZV;function e6(t){return t?"open":"closed"}var pfe=KV,mfe=XV,t6=QV,n6=JV;/** +`+i.stack}return{value:t,source:e,stack:s,digest:null}}function WP(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function nD(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var Eue=typeof WeakMap=="function"?WeakMap:Map;function QH(t,e,n){n=kc(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){GE||(GE=!0,fD=r),nD(t,e)},n}function ZH(t,e,n){n=kc(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){nD(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){nD(t,e),typeof r!="function"&&(gd===null?gd=new Set([this]):gd.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),n}function v3(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new Eue;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=Fue.bind(null,t,e,n),e.then(t,t))}function y3(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function b3(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=kc(-1,1),e.tag=2,md(n,e,1))),n.lanes|=1),t)}var Cue=Gc.ReactCurrentOwner,mi=!1;function Hs(t,e,n,r){e.child=t===null?RH(e,null,n,r):tv(e,t.child,n,r)}function w3(t,e,n,r,s){n=n.render;var i=e.ref;return Pm(e,s),r=jM(t,e,n,r,i,s),n=zM(),t!==null&&!mi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Bc(t,e,s)):(qn&&n&&RM(e),e.flags|=1,Hs(t,e,r,s),e.child)}function _3(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!XM(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,JH(t,e,i,r,s)):(t=jS(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Nb,n(a,r)&&t.ref===e.ref)return Bc(t,e,s)}return e.flags|=1,t=yd(i,r),t.ref=e.ref,t.return=e,e.child=t}function JH(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(Nb(i,r)&&t.ref===e.ref)if(mi=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(mi=!0);else return e.lanes=t.lanes,Bc(t,e,s)}return rD(t,e,n,r,s)}function eV(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},On(bm,Ki),Ki|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,On(bm,Ki),Ki|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,On(bm,Ki),Ki|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,On(bm,Ki),Ki|=r;return Hs(t,e,s,n),e.child}function tV(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function rD(t,e,n,r,s){var i=_i(n)?Ih:Ns.current;return i=Jg(e,i),Pm(e,s),n=jM(t,e,n,r,i,s),r=zM(),t!==null&&!mi?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Bc(t,e,s)):(qn&&r&&RM(e),e.flags|=1,Hs(t,e,n,s),e.child)}function x3(t,e,n,r,s){if(_i(n)){var i=!0;IE(e)}else i=!1;if(Pm(e,s),e.stateNode===null)IS(t,e),XH(e,n,r),tD(e,n,r,s),r=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=$o(u):(u=_i(n)?Ih:Ns.current,u=Jg(e,u));var f=n.getDerivedStateFromProps,l=typeof f=="function"||typeof a.getSnapshotBeforeUpdate=="function";l||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==r||c!==u)&&g3(e,a,r,u),Eu=!1;var d=e.memoizedState;a.state=d,BE(e,r,a,s),c=e.memoizedState,o!==r||d!==c||wi.current||Eu?(typeof f=="function"&&(eD(e,n,f,r),c=e.memoizedState),(o=Eu||m3(e,n,o,r,d,c,u))?(l||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=c),a.props=r,a.state=c,a.context=u,r=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{a=e.stateNode,TH(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:Qo(e.type,o),a.props=u,l=e.pendingProps,d=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=$o(c):(c=_i(n)?Ih:Ns.current,c=Jg(e,c));var m=n.getDerivedStateFromProps;(f=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==l||d!==c)&&g3(e,a,r,c),Eu=!1,d=e.memoizedState,a.state=d,BE(e,r,a,s);var p=e.memoizedState;o!==l||d!==p||wi.current||Eu?(typeof m=="function"&&(eD(e,n,m,r),p=e.memoizedState),(u=Eu||m3(e,n,u,r,d,p,c)||!1)?(f||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),r=!1)}return sD(t,e,n,r,i,s)}function sD(t,e,n,r,s,i){tV(t,e);var a=(e.flags&128)!==0;if(!r&&!a)return s&&a3(e,n,!1),Bc(t,e,i);r=e.stateNode,Cue.current=e;var o=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&a?(e.child=tv(e,t.child,null,i),e.child=tv(e,null,o,i)):Hs(t,e,o,i),e.memoizedState=r.state,s&&a3(e,n,!0),e.child}function nV(t){var e=t.stateNode;e.pendingContext?o3(t,e.pendingContext,e.pendingContext!==e.context):e.context&&o3(t,e.context,!1),LM(t,e.containerInfo)}function S3(t,e,n,r,s){return ev(),TM(s),e.flags|=256,Hs(t,e,n,r),e.child}var iD={dehydrated:null,treeContext:null,retryLane:0};function oD(t){return{baseLanes:t,cachePool:null,transitions:null}}function rV(t,e,n){var r=e.pendingProps,s=er.current,i=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(s&2)!==0),o?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),On(er,s&1),t===null)return Zk(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(a=r.children,t=r.fallback,i?(r=e.mode,i=e.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=P1(a,r,0,null),t=Dh(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=oD(n),e.memoizedState=iD,t):HM(e,a));if(s=t.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return Aue(t,e,a,r,o,s,n);if(i){i=r.fallback,a=e.mode,s=t.child,o=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=c,e.deletions=null):(r=yd(s,c),r.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=yd(o,i):(i=Dh(i,a,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,a=t.child.memoizedState,a=a===null?oD(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=t.childLanes&~n,e.memoizedState=iD,r}return i=t.child,t=i.sibling,r=yd(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function HM(t,e){return e=P1({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Wx(t,e,n,r){return r!==null&&TM(r),tv(e,t.child,null,n),t=HM(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Aue(t,e,n,r,s,i,a){if(n)return e.flags&256?(e.flags&=-257,r=WP(Error(ke(422))),Wx(t,e,a,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=P1({mode:"visible",children:r.children},s,0,null),i=Dh(i,s,a,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&tv(e,t.child,null,a),e.child.memoizedState=oD(a),e.memoizedState=iD,i);if(!(e.mode&1))return Wx(t,e,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var o=r.dgst;return r=o,i=Error(ke(419)),r=WP(i,r,void 0),Wx(t,e,a,r)}if(o=(a&t.childLanes)!==0,mi||o){if(r=Qr,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,zc(t,s),wa(r,t,s,-1))}return YM(),r=WP(Error(ke(421))),Wx(t,e,a,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=jue.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,eo=pd(s.nextSibling),to=e,qn=!0,ga=null,t!==null&&(Po[To++]=Pc,Po[To++]=Tc,Po[To++]=$h,Pc=t.id,Tc=t.overflow,$h=e),e=HM(e,r.children),e.flags|=4096,e)}function E3(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Jk(t.return,e,n)}function GP(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function sV(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(Hs(t,e,r.children,n),r=er.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&E3(t,n,e);else if(t.tag===19)E3(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(On(er,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&UE(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),GP(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&UE(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}GP(e,!0,n,null,i);break;case"together":GP(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function IS(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Bc(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),jh|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ke(153));if(e.child!==null){for(t=e.child,n=yd(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=yd(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function Rue(t,e,n){switch(e.tag){case 3:nV(e),ev();break;case 5:kH(e);break;case 1:_i(e.type)&&IE(e);break;case 4:LM(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;On(jE,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(On(er,er.current&1),e.flags|=128,null):n&e.child.childLanes?rV(t,e,n):(On(er,er.current&1),t=Bc(t,e,n),t!==null?t.sibling:null);On(er,er.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return sV(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),On(er,er.current),r)break;return null;case 22:case 23:return e.lanes=0,eV(t,e,n)}return Bc(t,e,n)}var iV,aD,oV,aV;iV=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};aD=function(){};oV=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,_f(ml.current);var i=null;switch(n){case"input":s=Tk(t,s),r=Tk(t,r),i=[];break;case"select":s=rr({},s,{value:void 0}),r=rr({},r,{value:void 0}),i=[];break;case"textarea":s=Nk(t,s),r=Nk(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=ME)}Mk(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(a in o)o.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Cb.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(o=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==o&&(c!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&o[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Cb.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&jn("scroll",t),i||o===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};aV=function(t,e,n,r){n!==r&&(e.flags|=4)};function uy(t,e){if(!qn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function bs(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function Pue(t,e,n){var r=e.pendingProps;switch(PM(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bs(e),null;case 1:return _i(e.type)&&LE(),bs(e),null;case 3:return r=e.stateNode,nv(),Bn(wi),Bn(Ns),$M(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Hx(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ga!==null&&(mD(ga),ga=null))),aD(t,e),bs(e),null;case 5:IM(e);var s=_f($b.current);if(n=e.type,t!==null&&e.stateNode!=null)oV(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(ke(166));return bs(e),null}if(t=_f(ml.current),Hx(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[cl]=e,r[Lb]=i,t=(e.mode&1)!==0,n){case"dialog":jn("cancel",r),jn("close",r);break;case"iframe":case"object":case"embed":jn("load",r);break;case"video":case"audio":for(s=0;s<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=a.createElement(n,{is:r.is}):(t=a.createElement(n),n==="select"&&(a=t,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):t=a.createElementNS(t,n),t[cl]=e,t[Lb]=r,iV(t,e,!1,!1),e.stateNode=t;e:{switch(a=Lk(n,r),n){case"dialog":jn("cancel",t),jn("close",t),s=r;break;case"iframe":case"object":case"embed":jn("load",t),s=r;break;case"video":case"audio":for(s=0;ssv&&(e.flags|=128,r=!0,uy(i,!1),e.lanes=4194304)}else{if(!r)if(t=UE(a),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),uy(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!qn)return bs(e),null}else 2*vr()-i.renderingStartTime>sv&&n!==1073741824&&(e.flags|=128,r=!0,uy(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(n=i.last,n!==null?n.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=vr(),e.sibling=null,n=er.current,On(er,r?n&1|2:n&1),e):(bs(e),null);case 22:case 23:return KM(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ki&1073741824&&(bs(e),e.subtreeFlags&6&&(e.flags|=8192)):bs(e),null;case 24:return null;case 25:return null}throw Error(ke(156,e.tag))}function Tue(t,e){switch(PM(e),e.tag){case 1:return _i(e.type)&&LE(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return nv(),Bn(wi),Bn(Ns),$M(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return IM(e),null;case 13:if(Bn(er),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ke(340));ev()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Bn(er),null;case 4:return nv(),null;case 10:return NM(e.type._context),null;case 22:case 23:return KM(),null;case 24:return null;default:return null}}var Gx=!1,Rs=!1,kue=typeof WeakSet=="function"?WeakSet:Set,Ge=null;function ym(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ur(t,e,r)}else n.current=null}function lD(t,e,n){try{n()}catch(r){ur(t,e,r)}}var C3=!1;function Due(t,e){if(Wk=DE,t=fH(),AM(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,o=-1,c=-1,u=0,f=0,l=t,d=null;t:for(;;){for(var m;l!==n||s!==0&&l.nodeType!==3||(o=a+s),l!==i||r!==0&&l.nodeType!==3||(c=a+r),l.nodeType===3&&(a+=l.nodeValue.length),(m=l.firstChild)!==null;)d=l,l=m;for(;;){if(l===t)break t;if(d===n&&++u===s&&(o=a),d===i&&++f===r&&(c=a),(m=l.nextSibling)!==null)break;l=d,d=l.parentNode}l=m}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gk={focusedElem:t,selectionRange:n},DE=!1,Ge=e;Ge!==null;)if(e=Ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Ge=t;else for(;Ge!==null;){e=Ge;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var h=p.memoizedProps,y=p.memoizedState,g=e.stateNode,v=g.getSnapshotBeforeUpdate(e.elementType===e.type?h:Qo(e.type,h),y);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ke(163))}}catch(x){ur(e,e.return,x)}if(t=e.sibling,t!==null){t.return=e.return,Ge=t;break}Ge=e.return}return p=C3,C3=!1,p}function db(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&lD(e,n,i)}s=s.next}while(s!==r)}}function A1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function cD(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function lV(t){var e=t.alternate;e!==null&&(t.alternate=null,lV(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[cl],delete e[Lb],delete e[Yk],delete e[hue],delete e[pue])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function cV(t){return t.tag===5||t.tag===3||t.tag===4}function A3(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||cV(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function uD(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ME));else if(r!==4&&(t=t.child,t!==null))for(uD(t,e,n),t=t.sibling;t!==null;)uD(t,e,n),t=t.sibling}function dD(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(dD(t,e,n),t=t.sibling;t!==null;)dD(t,e,n),t=t.sibling}var ls=null,pa=!1;function uu(t,e,n){for(n=n.child;n!==null;)uV(t,e,n),n=n.sibling}function uV(t,e,n){if(pl&&typeof pl.onCommitFiberUnmount=="function")try{pl.onCommitFiberUnmount(y1,n)}catch{}switch(n.tag){case 5:Rs||ym(n,e);case 6:var r=ls,s=pa;ls=null,uu(t,e,n),ls=r,pa=s,ls!==null&&(pa?(t=ls,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):ls.removeChild(n.stateNode));break;case 18:ls!==null&&(pa?(t=ls,n=n.stateNode,t.nodeType===8?jP(t.parentNode,n):t.nodeType===1&&jP(t,n),kb(t)):jP(ls,n.stateNode));break;case 4:r=ls,s=pa,ls=n.stateNode.containerInfo,pa=!0,uu(t,e,n),ls=r,pa=s;break;case 0:case 11:case 14:case 15:if(!Rs&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&lD(n,e,a),s=s.next}while(s!==r)}uu(t,e,n);break;case 1:if(!Rs&&(ym(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){ur(n,e,o)}uu(t,e,n);break;case 21:uu(t,e,n);break;case 22:n.mode&1?(Rs=(r=Rs)||n.memoizedState!==null,uu(t,e,n),Rs=r):uu(t,e,n);break;default:uu(t,e,n)}}function R3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new kue),e.forEach(function(r){var s=zue.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Yo(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=vr()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Oue(r/1960))-r,10t?16:t,cd===null)var r=!1;else{if(t=cd,cd=null,qE=0,qt&6)throw Error(ke(331));var s=qt;for(qt|=4,Ge=t.current;Ge!==null;){var i=Ge,a=i.child;if(Ge.flags&16){var o=i.deletions;if(o!==null){for(var c=0;cvr()-GM?kh(t,0):WM|=n),xi(t,e)}function yV(t,e){e===0&&(t.mode&1?(e=$x,$x<<=1,!($x&130023424)&&($x=4194304)):e=1);var n=Ks();t=zc(t,e),t!==null&&(Xw(t,e,n),xi(t,n))}function jue(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),yV(t,n)}function zue(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(ke(314))}r!==null&&r.delete(e),yV(t,n)}var bV;bV=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||wi.current)mi=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return mi=!1,Rue(t,e,n);mi=!!(t.flags&131072)}else mi=!1,qn&&e.flags&1048576&&SH(e,FE,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;IS(t,e),t=e.pendingProps;var s=Jg(e,Ns.current);Pm(e,n),s=jM(null,e,r,t,s,n);var i=zM();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,_i(r)?(i=!0,IE(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,MM(e),s.updater=C1,e.stateNode=s,s._reactInternals=e,tD(e,r,t,n),e=sD(null,e,r,!0,i,n)):(e.tag=0,qn&&i&&RM(e),Hs(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(IS(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=Uue(r),t=Qo(r,t),s){case 0:e=rD(null,e,r,t,n);break e;case 1:e=x3(null,e,r,t,n);break e;case 11:e=w3(null,e,r,t,n);break e;case 14:e=_3(null,e,r,Qo(r.type,t),n);break e}throw Error(ke(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Qo(r,s),rD(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Qo(r,s),x3(t,e,r,s,n);case 3:e:{if(nV(e),t===null)throw Error(ke(387));r=e.pendingProps,i=e.memoizedState,s=i.element,TH(t,e),BE(e,r,null,n);var a=e.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=rv(Error(ke(423)),e),e=S3(t,e,r,n,s);break e}else if(r!==s){s=rv(Error(ke(424)),e),e=S3(t,e,r,n,s);break e}else for(eo=pd(e.stateNode.containerInfo.firstChild),to=e,qn=!0,ga=null,n=RH(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ev(),r===s){e=Bc(t,e,n);break e}Hs(t,e,r,n)}e=e.child}return e;case 5:return kH(e),t===null&&Zk(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,qk(r,s)?a=null:i!==null&&qk(r,i)&&(e.flags|=32),tV(t,e),Hs(t,e,a,n),e.child;case 6:return t===null&&Zk(e),null;case 13:return rV(t,e,n);case 4:return LM(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=tv(e,null,r,n):Hs(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Qo(r,s),w3(t,e,r,s,n);case 7:return Hs(t,e,e.pendingProps,n),e.child;case 8:return Hs(t,e,e.pendingProps.children,n),e.child;case 12:return Hs(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,a=s.value,On(jE,r._currentValue),r._currentValue=a,i!==null)if(Sa(i.value,a)){if(i.children===s.children&&!wi.current){e=Bc(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var c=o.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=kc(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?c.next=c:(c.next=f.next,f.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Jk(i.return,n,e),o.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ke(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),Jk(a,n,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Hs(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Pm(e,n),s=$o(s),r=r(s),e.flags|=1,Hs(t,e,r,n),e.child;case 14:return r=e.type,s=Qo(r,e.pendingProps),s=Qo(r.type,s),_3(t,e,r,s,n);case 15:return JH(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:Qo(r,s),IS(t,e),e.tag=1,_i(r)?(t=!0,IE(e)):t=!1,Pm(e,n),XH(e,r,s),tD(e,r,s,n),sD(null,e,r,!0,t,n);case 19:return sV(t,e,n);case 22:return eV(t,e,n)}throw Error(ke(156,e.tag))};function wV(t,e){return q5(t,e)}function Bue(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 Oo(t,e,n,r){return new Bue(t,e,n,r)}function XM(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Uue(t){if(typeof t=="function")return XM(t)?1:0;if(t!=null){if(t=t.$$typeof,t===mM)return 11;if(t===gM)return 14}return 2}function yd(t,e){var n=t.alternate;return n===null?(n=Oo(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function jS(t,e,n,r,s,i){var a=2;if(r=t,typeof t=="function")XM(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case cm:return Dh(n.children,s,i,e);case pM:a=8,s|=8;break;case Ck:return t=Oo(12,n,e,s|2),t.elementType=Ck,t.lanes=i,t;case Ak:return t=Oo(13,n,e,s),t.elementType=Ak,t.lanes=i,t;case Rk:return t=Oo(19,n,e,s),t.elementType=Rk,t.lanes=i,t;case k5:return P1(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case P5:a=10;break e;case T5:a=9;break e;case mM:a=11;break e;case gM:a=14;break e;case Su:a=16,r=null;break e}throw Error(ke(130,t==null?t:typeof t,""))}return e=Oo(a,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Dh(t,e,n,r){return t=Oo(7,t,r,e),t.lanes=n,t}function P1(t,e,n,r){return t=Oo(22,t,r,e),t.elementType=k5,t.lanes=n,t.stateNode={isHidden:!1},t}function qP(t,e,n){return t=Oo(6,t,null,e),t.lanes=n,t}function KP(t,e,n){return e=Oo(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Hue(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=PP(0),this.expirationTimes=PP(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=PP(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function QM(t,e,n,r,s,i,a,o,c){return t=new Hue(t,e,n,o,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Oo(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},MM(i),t}function Vue(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(EV)}catch(t){console.error(t)}}EV(),E5.exports=ao;var ks=E5.exports;const e_=Dd(ks),Yue=f5({__proto__:null,default:e_},[ks]);var L3=ks;Sk.createRoot=L3.createRoot,Sk.hydrateRoot=L3.hydrateRoot;const CV=_.createContext({}),Xue=({children:t,authActions:e})=>{const n=i=>{var a;try{return Promise.resolve((a=e.login)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},r=i=>{var a;try{return Promise.resolve((a=e.logout)==null?void 0:a.call(e,i))}catch(o){return console.error(o),Promise.reject(o)}},s=async()=>{var i;try{return Promise.resolve((i=e.check)==null?void 0:i.call(e))}catch(a){return console.error(a),Promise.reject(a)}};return P.jsx(CV.Provider,{value:{...e,login:n,logout:r,check:s},children:t})},AV=()=>{const t=_.useContext(CV);if(t===null)throw new Error("useAuth must be used within a AuthProvider");return t};var yv=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Bh=typeof window>"u"||"Deno"in globalThis;function Eo(){}function Que(t,e){return typeof t=="function"?t(e):t}function gD(t){return typeof t=="number"&&t>=0&&t!==1/0}function RV(t,e){return Math.max(t+(e||0)-Date.now(),0)}function km(t,e){return typeof t=="function"?t(e):t}function va(t,e){return typeof t=="function"?t(e):t}function I3(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:o}=t;if(a){if(r){if(e.queryHash!==tL(a,e.options))return!1}else if(!Ub(e.queryKey,a))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||s&&s!==e.state.fetchStatus||i&&!i(e))}function $3(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(Uh(e.options.mutationKey)!==Uh(i))return!1}else if(!Ub(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function tL(t,e){return((e==null?void 0:e.queryKeyHashFn)||Uh)(t)}function Uh(t){return JSON.stringify(t,(e,n)=>vD(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ub(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Ub(t[n],e[n])):!1}function PV(t,e){if(t===e)return t;const n=F3(t)&&F3(e);if(n||vD(t)&&vD(e)){const r=n?t:Object.keys(t),s=r.length,i=n?e:Object.keys(e),a=i.length,o=n?[]:{};let c=0;for(let u=0;u{setTimeout(e,t)})}function yD(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?PV(t,e):e}function F4e(t){return t}function Jue(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function ede(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var nL=Symbol();function TV(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===nL?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Rf,Nu,Vm,e5,tde=(e5=class extends yv{constructor(){super();z(this,Rf);z(this,Nu);z(this,Vm);$(this,Vm,e=>{if(!Bh&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Nu)||this.setEventListener(C(this,Vm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Nu))==null||e.call(this),$(this,Nu,void 0))}setEventListener(e){var n;$(this,Vm,e),(n=C(this,Nu))==null||n.call(this),$(this,Nu,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){C(this,Rf)!==e&&($(this,Rf,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof C(this,Rf)=="boolean"?C(this,Rf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Rf=new WeakMap,Nu=new WeakMap,Vm=new WeakMap,e5),rL=new tde,Wm,Ou,Gm,t5,nde=(t5=class extends yv{constructor(){super();z(this,Wm,!0);z(this,Ou);z(this,Gm);$(this,Gm,e=>{if(!Bh&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,Ou)||this.setEventListener(C(this,Gm))}onUnsubscribe(){var e;this.hasListeners()||((e=C(this,Ou))==null||e.call(this),$(this,Ou,void 0))}setEventListener(e){var n;$(this,Gm,e),(n=C(this,Ou))==null||n.call(this),$(this,Ou,e(this.setOnline.bind(this)))}setOnline(e){C(this,Wm)!==e&&($(this,Wm,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return C(this,Wm)}},Wm=new WeakMap,Ou=new WeakMap,Gm=new WeakMap,t5),QE=new nde;function bD(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}function rde(t){return Math.min(1e3*2**t,3e4)}function kV(t){return(t??"online")==="online"?QE.isOnline():!0}var DV=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function YP(t){return t instanceof DV}function NV(t){let e=!1,n=0,r=!1,s;const i=bD(),a=h=>{var y;r||(d(new DV(h)),(y=t.abort)==null||y.call(t))},o=()=>{e=!0},c=()=>{e=!1},u=()=>rL.isFocused()&&(t.networkMode==="always"||QE.isOnline())&&t.canRun(),f=()=>kV(t.networkMode)&&t.canRun(),l=h=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,h),s==null||s(),i.resolve(h))},d=h=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,h),s==null||s(),i.reject(h))},m=()=>new Promise(h=>{var y;s=g=>{(r||u())&&h(g)},(y=t.onPause)==null||y.call(t)}).then(()=>{var h;s=void 0,r||(h=t.onContinue)==null||h.call(t)}),p=()=>{if(r)return;let h;const y=n===0?t.initialPromise:void 0;try{h=y??t.fn()}catch(g){h=Promise.reject(g)}Promise.resolve(h).then(l).catch(g=>{var k;if(r)return;const v=t.retry??(Bh?0:3),w=t.retryDelay??rde,x=typeof w=="function"?w(n,g):w,A=v===!0||typeof v=="number"&&nu()?void 0:m()).then(()=>{e?d(g):p()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:o,continueRetry:c,canStart:f,start:()=>(f()?p():m().then(p),i)}}var sde=t=>setTimeout(t,0);function ide(){let t=[],e=0,n=o=>{o()},r=o=>{o()},s=sde;const i=o=>{e?t.push(o):s(()=>{n(o)})},a=()=>{const o=t;t=[],o.length&&s(()=>{r(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||a()}return c},batchCalls:o=>(...c)=>{i(()=>{o(...c)})},schedule:i,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{s=o}}}var zr=ide(),Pf,n5,OV=(n5=class{constructor(){z(this,Pf)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),gD(this.gcTime)&&$(this,Pf,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Bh?1/0:5*60*1e3))}clearGcTimeout(){C(this,Pf)&&(clearTimeout(C(this,Pf)),$(this,Pf,void 0))}},Pf=new WeakMap,n5),qm,Km,bo,Tf,Ss,f0,kf,Jo,Wl,r5,ode=(r5=class extends OV{constructor(e){super();z(this,Jo);z(this,qm);z(this,Km);z(this,bo);z(this,Tf);z(this,Ss);z(this,f0);z(this,kf);$(this,kf,!1),$(this,f0,e.defaultOptions),this.setOptions(e.options),this.observers=[],$(this,Tf,e.client),$(this,bo,C(this,Tf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,$(this,qm,ade(this.options)),this.state=e.state??C(this,qm),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=C(this,Ss))==null?void 0:e.promise}setOptions(e){this.options={...C(this,f0),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,bo).remove(this)}setData(e,n){const r=yD(this.state.data,e,this.options);return B(this,Jo,Wl).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){B(this,Jo,Wl).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,s;const n=(r=C(this,Ss))==null?void 0:r.promise;return(s=C(this,Ss))==null||s.cancel(e),n?n.then(Eo).catch(Eo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,qm))}isActive(){return this.observers.some(e=>va(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===nL||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!RV(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Ss))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=C(this,Ss))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),C(this,bo).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(C(this,Ss)&&(C(this,kf)?C(this,Ss).cancel({revert:!0}):C(this,Ss).cancelRetry()),this.scheduleGc()),C(this,bo).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||B(this,Jo,Wl).call(this,{type:"invalidate"})}fetch(e,n){var c,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,Ss))return C(this,Ss).continueRetry(),C(this,Ss).promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(d=>d.options.queryFn);l&&this.setOptions(l.options)}const r=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>($(this,kf,!0),r.signal)})},i=()=>{const l=TV(this.options,n),d={client:C(this,Tf),queryKey:this.queryKey,meta:this.meta};return s(d),$(this,kf,!1),this.options.persister?this.options.persister(l,d,this):l(d)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,Tf),state:this.state,fetchFn:i};s(a),(c=this.options.behavior)==null||c.onFetch(a,this),$(this,Km,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&B(this,Jo,Wl).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const o=l=>{var d,m,p,h;YP(l)&&l.silent||B(this,Jo,Wl).call(this,{type:"error",error:l}),YP(l)||((m=(d=C(this,bo).config).onError)==null||m.call(d,l,this),(h=(p=C(this,bo).config).onSettled)==null||h.call(p,this.state.data,l,this)),this.scheduleGc()};return $(this,Ss,NV({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:l=>{var d,m,p,h;if(l===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(y){o(y);return}(m=(d=C(this,bo).config).onSuccess)==null||m.call(d,l,this),(h=(p=C(this,bo).config).onSettled)==null||h.call(p,l,this.state.error,this),this.scheduleGc()},onError:o,onFail:(l,d)=>{B(this,Jo,Wl).call(this,{type:"failed",failureCount:l,error:d})},onPause:()=>{B(this,Jo,Wl).call(this,{type:"pause"})},onContinue:()=>{B(this,Jo,Wl).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,Ss).start()}},qm=new WeakMap,Km=new WeakMap,bo=new WeakMap,Tf=new WeakMap,Ss=new WeakMap,f0=new WeakMap,kf=new WeakMap,Jo=new WeakSet,Wl=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...MV(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return YP(s)&&s.revert&&C(this,Km)?{...C(this,Km),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),zr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,bo).notify({query:this,type:"updated",action:e})})},r5);function MV(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:kV(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function ade(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ha,s5,lde=(s5=class extends yv{constructor(e={}){super();z(this,Ha);this.config=e,$(this,Ha,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??tL(s,n);let a=this.get(i);return a||(a=new ode({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){C(this,Ha).has(e.queryHash)||(C(this,Ha).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=C(this,Ha).get(e.queryHash);n&&(e.destroy(),n===e&&C(this,Ha).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){zr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Ha).get(e)}getAll(){return[...C(this,Ha).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>I3(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>I3(e,r)):n}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){zr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){zr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ha=new WeakMap,s5),Va,js,Df,Wa,mu,i5,cde=(i5=class extends OV{constructor(e){super();z(this,Wa);z(this,Va);z(this,js);z(this,Df);this.mutationId=e.mutationId,$(this,js,e.mutationCache),$(this,Va,[]),this.state=e.state||LV(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){C(this,Va).includes(e)||(C(this,Va).push(e),this.clearGcTimeout(),C(this,js).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){$(this,Va,C(this,Va).filter(n=>n!==e)),this.scheduleGc(),C(this,js).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){C(this,Va).length||(this.state.status==="pending"?this.scheduleGc():C(this,js).remove(this))}continue(){var e;return((e=C(this,Df))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var s,i,a,o,c,u,f,l,d,m,p,h,y,g,v,w,x,A,k,R;$(this,Df,NV({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(E,T)=>{B(this,Wa,mu).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{B(this,Wa,mu).call(this,{type:"pause"})},onContinue:()=>{B(this,Wa,mu).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,js).canRun(this)}));const n=this.state.status==="pending",r=!C(this,Df).canStart();try{if(!n){B(this,Wa,mu).call(this,{type:"pending",variables:e,isPaused:r}),await((i=(s=C(this,js).config).onMutate)==null?void 0:i.call(s,e,this));const T=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,e));T!==this.state.context&&B(this,Wa,mu).call(this,{type:"pending",context:T,variables:e,isPaused:r})}const E=await C(this,Df).start();return await((u=(c=C(this,js).config).onSuccess)==null?void 0:u.call(c,E,e,this.state.context,this)),await((l=(f=this.options).onSuccess)==null?void 0:l.call(f,E,e,this.state.context)),await((m=(d=C(this,js).config).onSettled)==null?void 0:m.call(d,E,null,this.state.variables,this.state.context,this)),await((h=(p=this.options).onSettled)==null?void 0:h.call(p,E,null,e,this.state.context)),B(this,Wa,mu).call(this,{type:"success",data:E}),E}catch(E){try{throw await((g=(y=C(this,js).config).onError)==null?void 0:g.call(y,E,e,this.state.context,this)),await((w=(v=this.options).onError)==null?void 0:w.call(v,E,e,this.state.context)),await((A=(x=C(this,js).config).onSettled)==null?void 0:A.call(x,void 0,E,this.state.variables,this.state.context,this)),await((R=(k=this.options).onSettled)==null?void 0:R.call(k,void 0,E,e,this.state.context)),E}finally{B(this,Wa,mu).call(this,{type:"error",error:E})}}finally{C(this,js).runNext(this)}}},Va=new WeakMap,js=new WeakMap,Df=new WeakMap,Wa=new WeakSet,mu=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),zr.batch(()=>{C(this,Va).forEach(r=>{r.onMutationUpdate(e)}),C(this,js).notify({mutation:this,type:"updated",action:e})})},i5);function LV(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var tc,ea,h0,o5,ude=(o5=class extends yv{constructor(e={}){super();z(this,tc);z(this,ea);z(this,h0);this.config=e,$(this,tc,new Set),$(this,ea,new Map),$(this,h0,0)}build(e,n,r){const s=new cde({mutationCache:this,mutationId:++vs(this,h0)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){C(this,tc).add(e);const n=Yx(e);if(typeof n=="string"){const r=C(this,ea).get(n);r?r.push(e):C(this,ea).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,tc).delete(e)){const n=Yx(e);if(typeof n=="string"){const r=C(this,ea).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&C(this,ea).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Yx(e);if(typeof n=="string"){const r=C(this,ea).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=Yx(e);if(typeof n=="string"){const s=(r=C(this,ea).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){zr.batch(()=>{C(this,tc).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,tc).clear(),C(this,ea).clear()})}getAll(){return Array.from(C(this,tc))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>$3(n,r))}findAll(e={}){return this.getAll().filter(n=>$3(e,n))}notify(e){zr.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return zr.batch(()=>Promise.all(e.map(n=>n.continue().catch(Eo))))}},tc=new WeakMap,ea=new WeakMap,h0=new WeakMap,o5);function Yx(t){var e;return(e=t.options.scope)==null?void 0:e.id}function z3(t){return{onFetch:(e,n)=>{var f,l,d,m,p;const r=e.options,s=(d=(l=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:l.fetchMore)==null?void 0:d.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],a=((p=e.state.data)==null?void 0:p.pageParams)||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const y=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},g=TV(e.options,e.fetchOptions),v=async(w,x,A)=>{if(h)return Promise.reject();if(x==null&&w.pages.length)return Promise.resolve(w);const k={client:e.client,queryKey:e.queryKey,pageParam:x,direction:A?"backward":"forward",meta:e.options.meta};y(k);const R=await g(k),{maxPages:E}=e.options,T=A?ede:Jue;return{pages:T(w.pages,R,E),pageParams:T(w.pageParams,x,E)}};if(s&&i.length){const w=s==="backward",x=w?dde:B3,A={pages:i,pageParams:a},k=x(r,A);o=await v(A,k,w)}else{const w=t??i.length;do{const x=c===0?a[0]??r.initialPageParam:B3(r,o);if(c>0&&x==null)break;o=await v(o,x),c++}while(c{var h,y;return(y=(h=e.options).persister)==null?void 0:y.call(h,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function B3(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function dde(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var lr,Mu,Lu,Ym,Xm,Iu,Qm,Zm,a5,fde=(a5=class{constructor(t={}){z(this,lr);z(this,Mu);z(this,Lu);z(this,Ym);z(this,Xm);z(this,Iu);z(this,Qm);z(this,Zm);$(this,lr,t.queryCache||new lde),$(this,Mu,t.mutationCache||new ude),$(this,Lu,t.defaultOptions||{}),$(this,Ym,new Map),$(this,Xm,new Map),$(this,Iu,0)}mount(){vs(this,Iu)._++,C(this,Iu)===1&&($(this,Qm,rL.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,lr).onFocus())})),$(this,Zm,QE.subscribe(async t=>{t&&(await this.resumePausedMutations(),C(this,lr).onOnline())})))}unmount(){var t,e;vs(this,Iu)._--,C(this,Iu)===0&&((t=C(this,Qm))==null||t.call(this),$(this,Qm,void 0),(e=C(this,Zm))==null||e.call(this),$(this,Zm,void 0))}isFetching(t){return C(this,lr).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return C(this,Mu).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,lr).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=C(this,lr).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(km(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return C(this,lr).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=C(this,lr).get(r.queryHash),i=s==null?void 0:s.state.data,a=Que(e,i);if(a!==void 0)return C(this,lr).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(t,e,n){return zr.batch(()=>C(this,lr).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=C(this,lr).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=C(this,lr);zr.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=C(this,lr);return zr.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=zr.batch(()=>C(this,lr).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(Eo).catch(Eo)}invalidateQueries(t,e={}){return zr.batch(()=>(C(this,lr).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=zr.batch(()=>C(this,lr).findAll(t).filter(s=>!s.isDisabled()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Eo)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Eo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=C(this,lr).build(this,e);return n.isStaleByTime(km(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Eo).catch(Eo)}fetchInfiniteQuery(t){return t.behavior=z3(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Eo).catch(Eo)}ensureInfiniteQueryData(t){return t.behavior=z3(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return QE.isOnline()?C(this,Mu).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,lr)}getMutationCache(){return C(this,Mu)}getDefaultOptions(){return C(this,Lu)}setDefaultOptions(t){$(this,Lu,t)}setQueryDefaults(t,e){C(this,Ym).set(Uh(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...C(this,Ym).values()],n={};return e.forEach(r=>{Ub(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){C(this,Xm).set(Uh(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...C(this,Xm).values()],n={};return e.forEach(r=>{Ub(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...C(this,Lu).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=tL(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===nL&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...C(this,Lu).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){C(this,lr).clear(),C(this,Mu).clear()}},lr=new WeakMap,Mu=new WeakMap,Lu=new WeakMap,Ym=new WeakMap,Xm=new WeakMap,Iu=new WeakMap,Qm=new WeakMap,Zm=new WeakMap,a5),ai,jt,p0,zs,Nf,Jm,$u,Ga,m0,eg,tg,Of,Mf,Fu,ng,sn,Iy,wD,_D,xD,SD,ED,CD,AD,IV,l5,hde=(l5=class extends yv{constructor(e,n){super();z(this,sn);z(this,ai);z(this,jt);z(this,p0);z(this,zs);z(this,Nf);z(this,Jm);z(this,$u);z(this,Ga);z(this,m0);z(this,eg);z(this,tg);z(this,Of);z(this,Mf);z(this,Fu);z(this,ng,new Set);this.options=n,$(this,ai,e),$(this,Ga,null),$(this,$u,bD()),this.options.experimental_prefetchInRender||C(this,$u).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,jt).addObserver(this),U3(C(this,jt),this.options)?B(this,sn,Iy).call(this):this.updateResult(),B(this,sn,SD).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return RD(C(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return RD(C(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,B(this,sn,ED).call(this),B(this,sn,CD).call(this),C(this,jt).removeObserver(this)}setOptions(e){const n=this.options,r=C(this,jt);if(this.options=C(this,ai).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof va(this.options.enabled,C(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");B(this,sn,AD).call(this),C(this,jt).setOptions(this.options),n._defaulted&&!XE(this.options,n)&&C(this,ai).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,jt),observer:this});const s=this.hasListeners();s&&H3(C(this,jt),r,this.options,n)&&B(this,sn,Iy).call(this),this.updateResult(),s&&(C(this,jt)!==r||va(this.options.enabled,C(this,jt))!==va(n.enabled,C(this,jt))||km(this.options.staleTime,C(this,jt))!==km(n.staleTime,C(this,jt)))&&B(this,sn,wD).call(this);const i=B(this,sn,_D).call(this);s&&(C(this,jt)!==r||va(this.options.enabled,C(this,jt))!==va(n.enabled,C(this,jt))||i!==C(this,Fu))&&B(this,sn,xD).call(this,i)}getOptimisticResult(e){const n=C(this,ai).getQueryCache().build(C(this,ai),e),r=this.createResult(n,e);return mde(this,r)&&($(this,zs,r),$(this,Jm,this.options),$(this,Nf,C(this,jt).state)),r}getCurrentResult(){return C(this,zs)}trackResult(e,n){const r={};return Object.keys(e).forEach(s=>{Object.defineProperty(r,s,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(s),n==null||n(s),e[s])})}),r}trackProp(e){C(this,ng).add(e)}getCurrentQuery(){return C(this,jt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=C(this,ai).defaultQueryOptions(e),r=C(this,ai).getQueryCache().build(C(this,ai),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return B(this,sn,Iy).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,zs)))}createResult(e,n){var E;const r=C(this,jt),s=this.options,i=C(this,zs),a=C(this,Nf),o=C(this,Jm),u=e!==r?e.state:C(this,p0),{state:f}=e;let l={...f},d=!1,m;if(n._optimisticResults){const T=this.hasListeners(),D=!T&&U3(e,n),O=T&&H3(e,r,n,s);(D||O)&&(l={...l,...MV(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:p,errorUpdatedAt:h,status:y}=l;if(n.select&&l.data!==void 0)if(i&&l.data===(a==null?void 0:a.data)&&n.select===C(this,m0))m=C(this,eg);else try{$(this,m0,n.select),m=n.select(l.data),m=yD(i==null?void 0:i.data,m,n),$(this,eg,m),$(this,Ga,null)}catch(T){$(this,Ga,T)}else m=l.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))T=i.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((E=C(this,tg))==null?void 0:E.state.data,C(this,tg)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),$(this,Ga,null)}catch(D){$(this,Ga,D)}T!==void 0&&(y="success",m=yD(i==null?void 0:i.data,T,n),d=!0)}C(this,Ga)&&(p=C(this,Ga),m=C(this,eg),h=Date.now(),y="error");const g=l.fetchStatus==="fetching",v=y==="pending",w=y==="error",x=v&&g,A=m!==void 0,R={status:y,fetchStatus:l.fetchStatus,isPending:v,isSuccess:y==="success",isError:w,isInitialLoading:x,isLoading:x,data:m,dataUpdatedAt:l.dataUpdatedAt,error:p,errorUpdatedAt:h,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>u.dataUpdateCount||l.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:w&&!A,isPaused:l.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:w&&A,isStale:sL(e,n),refetch:this.refetch,promise:C(this,$u)};if(this.options.experimental_prefetchInRender){const T=L=>{R.status==="error"?L.reject(R.error):R.data!==void 0&&L.resolve(R.data)},D=()=>{const L=$(this,$u,R.promise=bD());T(L)},O=C(this,$u);switch(O.status){case"pending":e.queryHash===r.queryHash&&T(O);break;case"fulfilled":(R.status==="error"||R.data!==O.value)&&D();break;case"rejected":(R.status!=="error"||R.error!==O.reason)&&D();break}}return R}updateResult(){const e=C(this,zs),n=this.createResult(C(this,jt),this.options);if($(this,Nf,C(this,jt).state),$(this,Jm,this.options),C(this,Nf).data!==void 0&&$(this,tg,C(this,jt)),XE(n,e))return;$(this,zs,n);const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!C(this,ng).size)return!0;const a=new Set(i??C(this,ng));return this.options.throwOnError&&a.add("error"),Object.keys(C(this,zs)).some(o=>{const c=o;return C(this,zs)[c]!==e[c]&&a.has(c)})};B(this,sn,IV).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&B(this,sn,SD).call(this)}},ai=new WeakMap,jt=new WeakMap,p0=new WeakMap,zs=new WeakMap,Nf=new WeakMap,Jm=new WeakMap,$u=new WeakMap,Ga=new WeakMap,m0=new WeakMap,eg=new WeakMap,tg=new WeakMap,Of=new WeakMap,Mf=new WeakMap,Fu=new WeakMap,ng=new WeakMap,sn=new WeakSet,Iy=function(e){B(this,sn,AD).call(this);let n=C(this,jt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Eo)),n},wD=function(){B(this,sn,ED).call(this);const e=km(this.options.staleTime,C(this,jt));if(Bh||C(this,zs).isStale||!gD(e))return;const r=RV(C(this,zs).dataUpdatedAt,e)+1;$(this,Of,setTimeout(()=>{C(this,zs).isStale||this.updateResult()},r))},_D=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,jt)):this.options.refetchInterval)??!1},xD=function(e){B(this,sn,CD).call(this),$(this,Fu,e),!(Bh||va(this.options.enabled,C(this,jt))===!1||!gD(C(this,Fu))||C(this,Fu)===0)&&$(this,Mf,setInterval(()=>{(this.options.refetchIntervalInBackground||rL.isFocused())&&B(this,sn,Iy).call(this)},C(this,Fu)))},SD=function(){B(this,sn,wD).call(this),B(this,sn,xD).call(this,B(this,sn,_D).call(this))},ED=function(){C(this,Of)&&(clearTimeout(C(this,Of)),$(this,Of,void 0))},CD=function(){C(this,Mf)&&(clearInterval(C(this,Mf)),$(this,Mf,void 0))},AD=function(){const e=C(this,ai).getQueryCache().build(C(this,ai),this.options);if(e===C(this,jt))return;const n=C(this,jt);$(this,jt,e),$(this,p0,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},IV=function(e){zr.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(C(this,zs))}),C(this,ai).getQueryCache().notify({query:C(this,jt),type:"observerResultsUpdated"})})},l5);function pde(t,e){return va(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function U3(t,e){return pde(t,e)||t.state.data!==void 0&&RD(t,e,e.refetchOnMount)}function RD(t,e,n){if(va(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&sL(t,e)}return!1}function H3(t,e,n,r){return(t!==e||va(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&sL(t,n)}function sL(t,e){return va(e.enabled,t)!==!1&&t.isStaleByTime(km(e.staleTime,t))}function mde(t,e){return!XE(t.getCurrentResult(),e)}var ju,zu,li,nc,Lc,zS,PD,c5,gde=(c5=class extends yv{constructor(n,r){super();z(this,Lc);z(this,ju);z(this,zu);z(this,li);z(this,nc);$(this,ju,n),this.setOptions(r),this.bindMethods(),B(this,Lc,zS).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=C(this,ju).defaultMutationOptions(n),XE(this.options,r)||C(this,ju).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,li),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Uh(r.mutationKey)!==Uh(this.options.mutationKey)?this.reset():((s=C(this,li))==null?void 0:s.state.status)==="pending"&&C(this,li).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=C(this,li))==null||n.removeObserver(this)}onMutationUpdate(n){B(this,Lc,zS).call(this),B(this,Lc,PD).call(this,n)}getCurrentResult(){return C(this,zu)}reset(){var n;(n=C(this,li))==null||n.removeObserver(this),$(this,li,void 0),B(this,Lc,zS).call(this),B(this,Lc,PD).call(this)}mutate(n,r){var s;return $(this,nc,r),(s=C(this,li))==null||s.removeObserver(this),$(this,li,C(this,ju).getMutationCache().build(C(this,ju),this.options)),C(this,li).addObserver(this),C(this,li).execute(n)}},ju=new WeakMap,zu=new WeakMap,li=new WeakMap,nc=new WeakMap,Lc=new WeakSet,zS=function(){var r;const n=((r=C(this,li))==null?void 0:r.state)??LV();$(this,zu,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},PD=function(n){zr.batch(()=>{var r,s,i,a,o,c,u,f;if(C(this,nc)&&this.hasListeners()){const l=C(this,zu).variables,d=C(this,zu).context;(n==null?void 0:n.type)==="success"?((s=(r=C(this,nc)).onSuccess)==null||s.call(r,n.data,l,d),(a=(i=C(this,nc)).onSettled)==null||a.call(i,n.data,null,l,d)):(n==null?void 0:n.type)==="error"&&((c=(o=C(this,nc)).onError)==null||c.call(o,n.error,l,d),(f=(u=C(this,nc)).onSettled)==null||f.call(u,void 0,n.error,l,d))}this.listeners.forEach(l=>{l(C(this,zu))})})},c5),$V=_.createContext(void 0),FV=t=>{const e=_.useContext($V);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},vde=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),P.jsx($V.Provider,{value:t,children:e})),jV=_.createContext(!1),yde=()=>_.useContext(jV);jV.Provider;function bde(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var wde=_.createContext(bde()),_de=()=>_.useContext(wde);function zV(t,e){return typeof t=="function"?t(...e):!!t}function TD(){}var xde=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},Sde=t=>{_.useEffect(()=>{t.clearReset()},[t])},Ede=({result:t,errorResetBoundary:e,throwOnError:n,query:r,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&(s&&t.data===void 0||zV(n,[t.error,r])),Cde=t=>{const e=t.staleTime;t.suspense&&(t.staleTime=typeof e=="function"?(...n)=>Math.max(e(...n),1e3):Math.max(e??1e3,1e3),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3)))},Ade=(t,e)=>t.isLoading&&t.isFetching&&!e,Rde=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,V3=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function Pde(t,e,n){var l,d,m,p,h;const r=FV(),s=yde(),i=_de(),a=r.defaultQueryOptions(t);(d=(l=r.getDefaultOptions().queries)==null?void 0:l._experimental_beforeQuery)==null||d.call(l,a),a._optimisticResults=s?"isRestoring":"optimistic",Cde(a),xde(a,i),Sde(i);const o=!r.getQueryCache().get(a.queryHash),[c]=_.useState(()=>new e(r,a)),u=c.getOptimisticResult(a),f=!s&&t.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(y=>{const g=f?c.subscribe(zr.batchCalls(y)):TD;return c.updateResult(),g},[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),_.useEffect(()=>{c.setOptions(a)},[a,c]),Rde(a,u))throw V3(a,c,i);if(Ede({result:u,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw u.error;if((p=(m=r.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||p.call(m,a,u),a.experimental_prefetchInRender&&!Bh&&Ade(u,s)){const y=o?V3(a,c,i):(h=r.getQueryCache().get(a.queryHash))==null?void 0:h.promise;y==null||y.catch(TD).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?u:c.trackResult(u)}function BV(t,e){return Pde(t,hde)}function Tde(t,e){const n=FV(),[r]=_.useState(()=>new gde(n,t));_.useEffect(()=>{r.setOptions(t)},[r,t]);const s=_.useSyncExternalStore(_.useCallback(a=>r.subscribe(zr.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=_.useCallback((a,o)=>{r.mutate(a,o).catch(TD)},[r]);if(s.error&&zV(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}class jo{constructor(e=[]){He(this,"segments",[]);this.segments=e}key(){return this.segments}get(){return this.segments}}class Ld extends jo{params(e){return new jo([...this.segments,e])}}class kde extends jo{id(e){return new Ld([...this.segments,e?String(e):void 0])}}class Dde extends jo{ids(...e){return new Ld([...this.segments,...e.length?[e.map(n=>String(n))]:[]])}}class Nde extends jo{action(e){if(["one","report"].includes(e))return new kde([...this.segments,e]);if(e==="many")return new Dde([...this.segments,e]);if(["list","infinite"].includes(e))return new Ld([...this.segments,e]);throw new Error("Invalid action type")}}class Ode extends jo{resource(e){return new Nde([...this.segments,e])}mutation(e){return new Ld([...e==="custom"?this.segments:[this.segments[0]],e])}}class Mde extends jo{action(e){return new Ld([...this.segments,e])}}class Lde extends jo{action(e){return new Ld([...this.segments,e])}}class Ide extends jo{resource(e){return new Lde([...this.segments,e])}}class $de extends jo{action(e){return new Ld([...this.segments,e])}}class Fde extends jo{resource(e){return new $de([...this.segments,e])}action(e){return new Ld([...this.segments,e])}}class jde extends jo{data(e){return new Ode(["data",e||"default"])}auth(){return new Mde(["auth"])}access(){return new Ide(["access"])}audit(){return new Fde(["audit"])}}const zde=()=>new jde([]),UV=()=>zde,HV=t=>{const e=UV(),{getProfile:n}=AV();return BV({queryKey:e().auth().action("profile").get(),queryFn:n,...t})},Bde=t=>{const e=UV(),{check:n}=AV();return BV({queryKey:e().auth().action("check").get(),queryFn:n,retry:!1,...t})};function Ude(t,e){const n=_.createContext(e);function r(i){const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})}function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return r.displayName=t+"Provider",[r,s]}function Pn(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];function u(l){const{scope:d,children:m,...p}=l,h=(d==null?void 0:d[t][c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})}function f(l,d){const m=(d==null?void 0:d[t][c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,Hde(s,...e)]}function Hde(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function Vde(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function t_(...t){return e=>t.forEach(n=>Vde(n,e))}function tt(...t){return _.useCallback(t_(...t),t)}var Ea=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(Wde);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(kD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(kD,{...r,ref:e,children:n})});Ea.displayName="Slot";var kD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=qde(n);return _.cloneElement(n,{...Gde(r,n.props),ref:e?t_(e,s):s})}return _.Children.count(n)>1?_.Children.only(null):null});kD.displayName="SlotClone";var iL=({children:t})=>P.jsx(P.Fragment,{children:t});function Wde(t){return _.isValidElement(t)&&t.type===iL}function Gde(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function qde(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function qc(t){const e=t+"CollectionProvider",[n,r]=Pn(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:p,children:h}=m,y=se.useRef(null),g=se.useRef(new Map).current;return P.jsx(s,{scope:p,itemMap:g,collectionRef:y,children:h})};a.displayName=e;const o=t+"CollectionSlot",c=se.forwardRef((m,p)=>{const{scope:h,children:y}=m,g=i(o,h),v=tt(p,g.collectionRef);return P.jsx(Ea,{ref:v,children:y})});c.displayName=o;const u=t+"CollectionItemSlot",f="data-radix-collection-item",l=se.forwardRef((m,p)=>{const{scope:h,children:y,...g}=m,v=se.useRef(null),w=tt(p,v),x=i(u,h);return se.useEffect(()=>(x.itemMap.set(v,{ref:v,...g}),()=>void x.itemMap.delete(v))),P.jsx(Ea,{[f]:"",ref:w,children:y})});l.displayName=u;function d(m){const p=i(t+"CollectionConsumer",m);return se.useCallback(()=>{const y=p.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(p.itemMap.values()).sort((x,A)=>g.indexOf(x.ref.current)-g.indexOf(A.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:a,Slot:c,ItemSlot:l},d,r]}function me(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Bt(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function sr({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Kde({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Bt(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function Kde({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=Bt(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var Yde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],De=Yde.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?Ea:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Hb(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}var Mn=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Xde(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var Un=t=>{const{present:e,children:n}=t,r=Qde(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=tt(r.ref,Zde(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};Un.displayName="Presence";function Qde(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=Xde(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=Xx(r.current);i.current=o==="mounted"?u:"none"},[o]),Mn(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=Xx(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),Mn(()=>{if(e){const u=l=>{const m=Xx(r.current).includes(l.animationName);l.target===e&&m&&ks.flushSync(()=>c("ANIMATION_END"))},f=l=>{l.target===e&&(i.current=Xx(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",u),e.addEventListener("animationend",u),()=>{e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",u),e.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Xx(t){return(t==null?void 0:t.animationName)||"none"}function Zde(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Jde=Yw.useId||(()=>{}),efe=0;function Hr(t){const[e,n]=_.useState(Jde());return Mn(()=>{n(r=>r??String(efe++))},[t]),e?`radix-${e}`:""}var oL="Collapsible",[tfe,VV]=Pn(oL),[nfe,aL]=tfe(oL),WV=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...o}=t,[c=!1,u]=sr({prop:r,defaultProp:s,onChange:a});return P.jsx(nfe,{scope:n,disabled:i,contentId:Hr(),open:c,onOpenToggle:_.useCallback(()=>u(f=>!f),[u]),children:P.jsx(De.div,{"data-state":cL(c),"data-disabled":i?"":void 0,...o,ref:e})})});WV.displayName=oL;var GV="CollapsibleTrigger",qV=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,s=aL(GV,n);return P.jsx(De.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":cL(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:e,onClick:me(t.onClick,s.onOpenToggle)})});qV.displayName=GV;var lL="CollapsibleContent",KV=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=aL(lL,t.__scopeCollapsible);return P.jsx(Un,{present:n||s.open,children:({present:i})=>P.jsx(rfe,{...r,ref:e,present:i})})});KV.displayName=lL;var rfe=_.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=t,a=aL(lL,n),[o,c]=_.useState(r),u=_.useRef(null),f=tt(e,u),l=_.useRef(0),d=l.current,m=_.useRef(0),p=m.current,h=a.open||o,y=_.useRef(h),g=_.useRef();return _.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),Mn(()=>{const v=u.current;if(v){g.current=g.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();l.current=w.height,m.current=w.width,y.current||(v.style.transitionDuration=g.current.transitionDuration,v.style.animationName=g.current.animationName),c(r)}},[a.open,r]),P.jsx(De.div,{"data-state":cL(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!h,...i,ref:f,style:{"--radix-collapsible-content-height":d?`${d}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style},children:h&&s})});function cL(t){return t?"open":"closed"}var sfe=WV,ife=qV,ofe=KV,afe=_.createContext(void 0);function ka(t){const e=_.useContext(afe);return t||e||"ltr"}var Kc="Accordion",lfe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[uL,cfe,ufe]=qc(Kc),[O1,z4e]=Pn(Kc,[ufe,VV]),dL=VV(),dfe=se.forwardRef((t,e)=>{const{type:n,...r}=t,s=r,i=r;return P.jsx(uL.Provider,{scope:t.__scopeAccordion,children:n==="multiple"?P.jsx(mfe,{...i,ref:e}):P.jsx(pfe,{...s,ref:e})})});dfe.displayName=Kc;var[YV,ffe]=O1(Kc),[XV,hfe]=O1(Kc,{collapsible:!1}),pfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...a}=t,[o,c]=sr({prop:n,defaultProp:r,onChange:s});return P.jsx(YV,{scope:t.__scopeAccordion,value:o?[o]:[],onItemOpen:c,onItemClose:se.useCallback(()=>i&&c(""),[i,c]),children:P.jsx(XV,{scope:t.__scopeAccordion,collapsible:i,children:P.jsx(QV,{...a,ref:e})})})}),mfe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=sr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(YV,{scope:t.__scopeAccordion,value:a,onItemOpen:c,onItemClose:u,children:P.jsx(XV,{scope:t.__scopeAccordion,collapsible:!0,children:P.jsx(QV,{...i,ref:e})})})}),[gfe,M1]=O1(Kc),QV=se.forwardRef((t,e)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...a}=t,o=se.useRef(null),c=tt(o,e),u=cfe(n),l=ka(s)==="ltr",d=me(t.onKeyDown,m=>{var E;if(!lfe.includes(m.key))return;const p=m.target,h=u().filter(T=>{var D;return!((D=T.ref.current)!=null&&D.disabled)}),y=h.findIndex(T=>T.ref.current===p),g=h.length;if(y===-1)return;m.preventDefault();let v=y;const w=0,x=g-1,A=()=>{v=y+1,v>x&&(v=w)},k=()=>{v=y-1,v{const{__scopeAccordion:n,value:r,...s}=t,i=M1(ZE,n),a=ffe(ZE,n),o=dL(n),c=Hr(),u=r&&a.value.includes(r)||!1,f=i.disabled||t.disabled;return P.jsx(vfe,{scope:n,open:u,disabled:f,triggerId:c,children:P.jsx(sfe,{"data-orientation":i.orientation,"data-state":s6(u),...o,...s,ref:e,disabled:f,open:u,onOpenChange:l=>{l?a.onItemOpen(r):a.onItemClose(r)}})})});ZV.displayName=ZE;var JV="AccordionHeader",e6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=M1(Kc,n),i=fL(JV,n);return P.jsx(De.h3,{"data-orientation":s.orientation,"data-state":s6(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:e})});e6.displayName=JV;var DD="AccordionTrigger",t6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=M1(Kc,n),i=fL(DD,n),a=hfe(DD,n),o=dL(n);return P.jsx(uL.ItemSlot,{scope:n,children:P.jsx(ife,{"aria-disabled":i.open&&!a.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...o,...r,ref:e})})});t6.displayName=DD;var n6="AccordionContent",r6=se.forwardRef((t,e)=>{const{__scopeAccordion:n,...r}=t,s=M1(Kc,n),i=fL(n6,n),a=dL(n);return P.jsx(ofe,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...a,...r,ref:e,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});r6.displayName=n6;function s6(t){return t?"open":"closed"}var yfe=ZV,bfe=e6,i6=t6,o6=r6;/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gfe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r6=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/** + */const wfe=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a6=(...t)=>t.filter((e,n,r)=>!!e&&r.indexOf(e)===n).join(" ");/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var vfe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var _fe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yfe=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>_.createElement("svg",{ref:c,...vfe,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:r6("lucide",s),...o},[...a.map(([u,f])=>_.createElement(u,f)),...Array.isArray(i)?i:[i]]));/** + */const xfe=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},c)=>_.createElement("svg",{ref:c,..._fe,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:a6("lucide",s),...o},[...a.map(([u,f])=>_.createElement(u,f)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Zr=(t,e)=>{const n=_.forwardRef(({className:r,...s},i)=>_.createElement(yfe,{ref:i,iconNode:e,className:r6(`lucide-${gfe(t)}`,r),...s}));return n.displayName=`${t}`,n};/** + */const Zr=(t,e)=>{const n=_.forwardRef(({className:r,...s},i)=>_.createElement(xfe,{ref:i,iconNode:e,className:a6(`lucide-${wfe(t)}`,r),...s}));return n.displayName=`${t}`,n};/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bfe=Zr("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** + */const Sfe=Zr("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t_=Zr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const n_=Zr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const M1=Zr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const L1=Zr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dL=Zr("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const hL=Zr("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const n_=Zr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const r_=Zr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wfe=Zr("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const Efe=Zr("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _fe=Zr("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const Cfe=Zr("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xfe=Zr("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** + */const Afe=Zr("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const L1=Zr("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const I1=Zr("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sfe=Zr("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + */const Rfe=Zr("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Efe=Zr("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** + */const Pfe=Zr("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cfe=Zr("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const Tfe=Zr("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Afe=Zr("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** + */const kfe=Zr("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rfe=Zr("Package2",[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]]);/** + */const Dfe=Zr("Package2",[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pfe=Zr("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const Nfe=Zr("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tfe=Zr("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const Ofe=Zr("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kfe=Zr("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Mfe=Zr("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.427.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fL=Zr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function s6(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const e=Ofe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const o=a.split(hL);return o[0]===""&&o.length!==1&&o.shift(),i6(o,e)||Nfe(a)},getConflictingClassGroupIds:(a,o)=>{const c=n[a]||[];return o&&r[a]?[...c,...r[a]]:c}}},i6=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?i6(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(hL);return(a=e.validators.find(({validator:o})=>o(i)))==null?void 0:a.classGroupId},U3=/^\[(.+)\]$/,Nfe=t=>{if(U3.test(t)){const e=U3.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Ofe=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return Lfe(Object.entries(t.classGroups),n).forEach(([i,a])=>{DD(a,r,i,e)}),r},DD=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:H3(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(Mfe(s)){DD(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{DD(a,H3(e,i),n,r)})})},H3=(t,e)=>{let n=t;return e.split(hL).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Mfe=t=>t.isThemeGetter,Lfe=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,o])=>[e+a,o])):i);return[n,s]}):t,Ife=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},o6="!",$fe=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,a=o=>{const c=[];let u=0,f=0,l;for(let y=0;yf?l-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:h}};return n?o=>n({className:o,parseClassName:a}):a},Ffe=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},jfe=t=>({cache:Ife(t.cacheSize),parseClassName:$fe(t),...Dfe(t)}),zfe=/\s+/,Bfe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],a=t.trim().split(zfe);let o="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:f,hasImportantModifier:l,baseClassName:d,maybePostfixModifierPosition:m}=n(u);let p=!!m,h=r(p?d.substring(0,m):d);if(!h){if(!p){o=u+(o.length>0?" "+o:o);continue}if(h=r(d),!h){o=u+(o.length>0?" "+o:o);continue}p=!1}const y=Ffe(f).join(":"),g=l?y+o6:y,v=g+h;if(i.includes(v))continue;i.push(v);const w=s(h,p);for(let x=0;x0?" "+o:o)}return o};function Ufe(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rl(f),t());return n=jfe(u),r=n.cache.get,s=n.cache.set,i=o,o(c)}function o(c){const u=r(c);if(u)return u;const f=Bfe(c,n);return s(c,f),f}return function(){return i(Ufe.apply(null,arguments))}}const $n=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},l6=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vfe=/^\d+\/\d+$/,Wfe=new Set(["px","full","screen"]),Gfe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qfe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kfe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Yfe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Xfe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jl=t=>Dm(t)||Wfe.has(t)||Vfe.test(t),du=t=>bv(t,"length",she),Dm=t=>!!t&&!Number.isNaN(Number(t)),YP=t=>bv(t,"number",Dm),fy=t=>!!t&&Number.isInteger(Number(t)),Qfe=t=>t.endsWith("%")&&Dm(t.slice(0,-1)),xt=t=>l6.test(t),fu=t=>Gfe.test(t),Zfe=new Set(["length","size","percentage"]),Jfe=t=>bv(t,Zfe,c6),ehe=t=>bv(t,"position",c6),the=new Set(["image","url"]),nhe=t=>bv(t,the,ohe),rhe=t=>bv(t,"",ihe),hy=()=>!0,bv=(t,e,n)=>{const r=l6.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},she=t=>qfe.test(t)&&!Kfe.test(t),c6=()=>!1,ihe=t=>Yfe.test(t),ohe=t=>Xfe.test(t),ahe=()=>{const t=$n("colors"),e=$n("spacing"),n=$n("blur"),r=$n("brightness"),s=$n("borderColor"),i=$n("borderRadius"),a=$n("borderSpacing"),o=$n("borderWidth"),c=$n("contrast"),u=$n("grayscale"),f=$n("hueRotate"),l=$n("invert"),d=$n("gap"),m=$n("gradientColorStops"),p=$n("gradientColorStopPositions"),h=$n("inset"),y=$n("margin"),g=$n("opacity"),v=$n("padding"),w=$n("saturate"),x=$n("scale"),A=$n("sepia"),k=$n("skew"),R=$n("space"),E=$n("translate"),T=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",xt,e],L=()=>[xt,e],I=()=>["",jl,du],F=()=>["auto",Dm,xt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",xt],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Dm,xt];return{cacheSize:500,separator:":",theme:{colors:[hy],spacing:[jl,du],blur:["none","",fu,xt],brightness:X(),borderColor:[t],borderRadius:["none","","full",fu,xt],borderSpacing:L(),borderWidth:I(),contrast:X(),grayscale:ee(),hueRotate:X(),invert:ee(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[Qfe,du],inset:O(),margin:O(),opacity:X(),padding:L(),saturate:X(),scale:X(),sepia:ee(),skew:X(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[fu]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),xt]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fy,xt]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xt]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",fy,xt]}],"grid-cols":[{"grid-cols":[hy]}],"col-start-end":[{col:["auto",{span:["full",fy,xt]},xt]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[hy]}],"row-start-end":[{row:["auto",{span:[fy,xt]},xt]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xt]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xt,e]}],"min-w":[{"min-w":[xt,e,"min","max","fit"]}],"max-w":[{"max-w":[xt,e,"none","full","min","max","fit","prose",{screen:[fu]},fu]}],h:[{h:[xt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",fu,du]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",YP]}],"font-family":[{font:[hy]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xt]}],"line-clamp":[{"line-clamp":["none",Dm,YP]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",jl,xt]}],"list-image":[{"list-image":["none",xt]}],"list-style-type":[{list:["none","disc","decimal",xt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",jl,du]}],"underline-offset":[{"underline-offset":["auto",jl,xt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),ehe]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Jfe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nhe]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[jl,xt]}],"outline-w":[{outline:[jl,du]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[jl,du]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",fu,rhe]}],"shadow-color":[{shadow:[hy]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",fu,xt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[l]}],saturate:[{saturate:[w]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xt]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",xt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[fy,xt]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[jl,du,YP]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},lhe=Hfe(ahe);function ce(...t){return lhe(cp(t))}const che=_.forwardRef(({className:t,...e},n)=>P.jsx(pfe,{ref:n,className:ce("border-b",t),...e}));che.displayName="AccordionItem";const uhe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsx(mfe,{className:"flex",children:P.jsxs(t6,{ref:r,className:ce("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,P.jsx(M1,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));uhe.displayName=t6.displayName;const dhe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsx(n6,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:P.jsx("div",{className:ce("pb-4 pt-0",t),children:e})}));dhe.displayName=n6.displayName;const V3=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,W3=cp,jo=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return W3(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(u=>{const f=n==null?void 0:n[u],l=i==null?void 0:i[u];if(f===null)return null;const d=V3(f)||V3(l);return s[u][d]}),o=n&&Object.entries(n).reduce((u,f)=>{let[l,d]=f;return d===void 0||(u[l]=d),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:l,className:d,...m}=f;return Object.entries(m).every(p=>{let[h,y]=p;return Array.isArray(y)?y.includes({...i,...o}[h]):{...i,...o}[h]===y})?[...u,l,d]:u},[]);return W3(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},fhe=jo("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),hhe=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx("div",{ref:r,role:"alert",className:ce(fhe({variant:e}),t),...n}));hhe.displayName="Alert";const phe=_.forwardRef(({className:t,...e},n)=>P.jsx("h5",{ref:n,className:ce("mb-1 font-medium leading-none tracking-tight",t),...e}));phe.displayName="AlertTitle";const mhe=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("text-sm [&_p]:leading-relaxed",t),...e}));mhe.displayName="AlertDescription";function u6(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var ghe="DismissableLayer",ND="dismissableLayer.update",vhe="dismissableLayer.pointerDownOutside",yhe="dismissableLayer.focusOutside",G3,d6=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(d6),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=tt(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=whe(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=_he(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return u6(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(G3=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),q3(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=G3)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),q3())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(ND,R),()=>document.removeEventListener(ND,R)},[]),P.jsx(De.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:me(t.onFocusCapture,k.onFocusCapture),onBlurCapture:me(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:me(t.onPointerDownCapture,A.onPointerDownCapture)})});Yc.displayName=ghe;var bhe="DismissableLayerBranch",f6=_.forwardRef((t,e)=>{const n=_.useContext(d6),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(De.div,{...t,ref:s})});f6.displayName=bhe;function whe(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){h6(vhe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function _he(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&h6(yhe,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function q3(){const t=new CustomEvent(ND);document.dispatchEvent(t)}function h6(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Hb(s,i):s.dispatchEvent(i)}var xhe=Yc,She=f6,XP="focusScope.autoFocusOnMount",QP="focusScope.autoFocusOnUnmount",K3={bubbles:!1,cancelable:!0},Ehe="FocusScope",r_=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Bt(s),f=Bt(i),l=_.useRef(null),d=tt(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:gu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||gu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&gu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){X3.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(XP,K3);o.addEventListener(XP,u),o.dispatchEvent(g),g.defaultPrevented||(Che(khe(p6(o)),{select:!0}),document.activeElement===h&&gu(o))}return()=>{o.removeEventListener(XP,u),setTimeout(()=>{const g=new CustomEvent(QP,K3);o.addEventListener(QP,f),o.dispatchEvent(g),g.defaultPrevented||gu(h??document.body,{select:!0}),o.removeEventListener(QP,f),X3.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=Ahe(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&gu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&gu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(De.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});r_.displayName=Ehe;function Che(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(gu(r,{select:e}),document.activeElement!==n)return}function Ahe(t){const e=p6(t),n=Y3(e,t),r=Y3(e.reverse(),t);return[n,r]}function p6(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Y3(t,e){for(const n of t)if(!Rhe(n,{upTo:e}))return n}function Rhe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Phe(t){return t instanceof HTMLInputElement&&"select"in t}function gu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Phe(t)&&e&&t.select()}}var X3=The();function The(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Q3(t,e),t.unshift(e)},remove(e){var n;t=Q3(t,e),(n=t[0])==null||n.resume()}}}function Q3(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function khe(t){return t.filter(e=>e.tagName!=="A")}var Dhe="Portal",wv=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);Mn(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?Jw.createPortal(P.jsx(De.div,{...r,ref:e}),a):null});wv.displayName=Dhe;var ZP=0;function I1(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Z3()),document.body.insertAdjacentElement("beforeend",t[1]??Z3()),ZP++,()=>{ZP===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ZP--}},[])}function Z3(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var fr=function(){return fr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r"u")return Vhe;var e=Whe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},qhe=j1(),Mm="data-scroll-locked",Khe=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,o=t.gap;return n===void 0&&(n="margin"),` - .`.concat(Nhe,` { + */const pL=Zr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function l6(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e{const e=$fe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:a=>{const o=a.split(mL);return o[0]===""&&o.length!==1&&o.shift(),c6(o,e)||Ife(a)},getConflictingClassGroupIds:(a,o)=>{const c=n[a]||[];return o&&r[a]?[...c,...r[a]]:c}}},c6=(t,e)=>{var a;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?c6(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(mL);return(a=e.validators.find(({validator:o})=>o(i)))==null?void 0:a.classGroupId},W3=/^\[(.+)\]$/,Ife=t=>{if(W3.test(t)){const e=W3.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},$fe=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return jfe(Object.entries(t.classGroups),n).forEach(([i,a])=>{ND(a,r,i,e)}),r},ND=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:G3(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(Ffe(s)){ND(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{ND(a,G3(e,i),n,r)})})},G3=(t,e)=>{let n=t;return e.split(mL).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ffe=t=>t.isThemeGetter,jfe=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,o])=>[e+a,o])):i);return[n,s]}):t,zfe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},u6="!",Bfe=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,a=o=>{const c=[];let u=0,f=0,l;for(let y=0;yf?l-f:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:h}};return n?o=>n({className:o,parseClassName:a}):a},Ufe=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},Hfe=t=>({cache:zfe(t.cacheSize),parseClassName:Bfe(t),...Lfe(t)}),Vfe=/\s+/,Wfe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],a=t.trim().split(Vfe);let o="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:f,hasImportantModifier:l,baseClassName:d,maybePostfixModifierPosition:m}=n(u);let p=!!m,h=r(p?d.substring(0,m):d);if(!h){if(!p){o=u+(o.length>0?" "+o:o);continue}if(h=r(d),!h){o=u+(o.length>0?" "+o:o);continue}p=!1}const y=Ufe(f).join(":"),g=l?y+u6:y,v=g+h;if(i.includes(v))continue;i.push(v);const w=s(h,p);for(let x=0;x0?" "+o:o)}return o};function Gfe(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rl(f),t());return n=Hfe(u),r=n.cache.get,s=n.cache.set,i=o,o(c)}function o(c){const u=r(c);if(u)return u;const f=Wfe(c,n);return s(c,f),f}return function(){return i(Gfe.apply(null,arguments))}}const $n=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},f6=/^\[(?:([a-z-]+):)?(.+)\]$/i,Kfe=/^\d+\/\d+$/,Yfe=new Set(["px","full","screen"]),Xfe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Qfe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zfe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Jfe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ehe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zl=t=>Dm(t)||Yfe.has(t)||Kfe.test(t),du=t=>bv(t,"length",lhe),Dm=t=>!!t&&!Number.isNaN(Number(t)),XP=t=>bv(t,"number",Dm),fy=t=>!!t&&Number.isInteger(Number(t)),the=t=>t.endsWith("%")&&Dm(t.slice(0,-1)),xt=t=>f6.test(t),fu=t=>Xfe.test(t),nhe=new Set(["length","size","percentage"]),rhe=t=>bv(t,nhe,h6),she=t=>bv(t,"position",h6),ihe=new Set(["image","url"]),ohe=t=>bv(t,ihe,uhe),ahe=t=>bv(t,"",che),hy=()=>!0,bv=(t,e,n)=>{const r=f6.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},lhe=t=>Qfe.test(t)&&!Zfe.test(t),h6=()=>!1,che=t=>Jfe.test(t),uhe=t=>ehe.test(t),dhe=()=>{const t=$n("colors"),e=$n("spacing"),n=$n("blur"),r=$n("brightness"),s=$n("borderColor"),i=$n("borderRadius"),a=$n("borderSpacing"),o=$n("borderWidth"),c=$n("contrast"),u=$n("grayscale"),f=$n("hueRotate"),l=$n("invert"),d=$n("gap"),m=$n("gradientColorStops"),p=$n("gradientColorStopPositions"),h=$n("inset"),y=$n("margin"),g=$n("opacity"),v=$n("padding"),w=$n("saturate"),x=$n("scale"),A=$n("sepia"),k=$n("skew"),R=$n("space"),E=$n("translate"),T=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",xt,e],L=()=>[xt,e],I=()=>["",zl,du],F=()=>["auto",Dm,xt],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Y=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],ee=()=>["","0",xt],re=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Dm,xt];return{cacheSize:500,separator:":",theme:{colors:[hy],spacing:[zl,du],blur:["none","",fu,xt],brightness:X(),borderColor:[t],borderRadius:["none","","full",fu,xt],borderSpacing:L(),borderWidth:I(),contrast:X(),grayscale:ee(),hueRotate:X(),invert:ee(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[the,du],inset:O(),margin:O(),opacity:X(),padding:L(),saturate:X(),scale:X(),sepia:ee(),skew:X(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",xt]}],container:["container"],columns:[{columns:[fu]}],"break-after":[{"break-after":re()}],"break-before":[{"break-before":re()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),xt]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fy,xt]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",xt]}],grow:[{grow:ee()}],shrink:[{shrink:ee()}],order:[{order:["first","last","none",fy,xt]}],"grid-cols":[{"grid-cols":[hy]}],"col-start-end":[{col:["auto",{span:["full",fy,xt]},xt]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[hy]}],"row-start-end":[{row:["auto",{span:[fy,xt]},xt]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",xt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",xt]}],gap:[{gap:[d]}],"gap-x":[{"gap-x":[d]}],"gap-y":[{"gap-y":[d]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",xt,e]}],"min-w":[{"min-w":[xt,e,"min","max","fit"]}],"max-w":[{"max-w":[xt,e,"none","full","min","max","fit","prose",{screen:[fu]},fu]}],h:[{h:[xt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[xt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[xt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",fu,du]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",XP]}],"font-family":[{font:[hy]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",xt]}],"line-clamp":[{"line-clamp":["none",Dm,XP]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",zl,xt]}],"list-image":[{"list-image":["none",xt]}],"list-style-type":[{list:["none","disc","decimal",xt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",zl,du]}],"underline-offset":[{"underline-offset":["auto",zl,xt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),she]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",rhe]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ohe]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[o]}],"border-w-x":[{"border-x":[o]}],"border-w-y":[{"border-y":[o]}],"border-w-s":[{"border-s":[o]}],"border-w-e":[{"border-e":[o]}],"border-w-t":[{"border-t":[o]}],"border-w-r":[{"border-r":[o]}],"border-w-b":[{"border-b":[o]}],"border-w-l":[{"border-l":[o]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Y(),"hidden"]}],"divide-x":[{"divide-x":[o]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[o]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Y()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...Y()]}],"outline-offset":[{"outline-offset":[zl,xt]}],"outline-w":[{outline:[zl,du]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[zl,du]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",fu,ahe]}],"shadow-color":[{shadow:[hy]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",fu,xt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[l]}],saturate:[{saturate:[w]}],sepia:[{sepia:[A]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[l]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[A]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",xt]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",xt]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",xt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[fy,xt]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",xt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[zl,du,XP]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},fhe=qfe(dhe);function ce(...t){return fhe(up(t))}const hhe=_.forwardRef(({className:t,...e},n)=>P.jsx(yfe,{ref:n,className:ce("border-b",t),...e}));hhe.displayName="AccordionItem";const phe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsx(bfe,{className:"flex",children:P.jsxs(i6,{ref:r,className:ce("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...n,children:[e,P.jsx(L1,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));phe.displayName=i6.displayName;const mhe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsx(o6,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:P.jsx("div",{className:ce("pb-4 pt-0",t),children:e})}));mhe.displayName=o6.displayName;const q3=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,K3=up,zo=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return K3(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,a=Object.keys(s).map(u=>{const f=n==null?void 0:n[u],l=i==null?void 0:i[u];if(f===null)return null;const d=q3(f)||q3(l);return s[u][d]}),o=n&&Object.entries(n).reduce((u,f)=>{let[l,d]=f;return d===void 0||(u[l]=d),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:l,className:d,...m}=f;return Object.entries(m).every(p=>{let[h,y]=p;return Array.isArray(y)?y.includes({...i,...o}[h]):{...i,...o}[h]===y})?[...u,l,d]:u},[]);return K3(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},ghe=zo("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),vhe=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx("div",{ref:r,role:"alert",className:ce(ghe({variant:e}),t),...n}));vhe.displayName="Alert";const yhe=_.forwardRef(({className:t,...e},n)=>P.jsx("h5",{ref:n,className:ce("mb-1 font-medium leading-none tracking-tight",t),...e}));yhe.displayName="AlertTitle";const bhe=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("text-sm [&_p]:leading-relaxed",t),...e}));bhe.displayName="AlertDescription";function p6(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var whe="DismissableLayer",OD="dismissableLayer.update",_he="dismissableLayer.pointerDownOutside",xhe="dismissableLayer.focusOutside",Y3,m6=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Yc=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(m6),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=tt(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=Ehe(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=Che(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return p6(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Y3=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),X3(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Y3)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),X3())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(OD,R),()=>document.removeEventListener(OD,R)},[]),P.jsx(De.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:me(t.onFocusCapture,k.onFocusCapture),onBlurCapture:me(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:me(t.onPointerDownCapture,A.onPointerDownCapture)})});Yc.displayName=whe;var She="DismissableLayerBranch",g6=_.forwardRef((t,e)=>{const n=_.useContext(m6),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(De.div,{...t,ref:s})});g6.displayName=She;function Ehe(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){v6(_he,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function Che(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&v6(xhe,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function X3(){const t=new CustomEvent(OD);document.dispatchEvent(t)}function v6(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Hb(s,i):s.dispatchEvent(i)}var Ahe=Yc,Rhe=g6,QP="focusScope.autoFocusOnMount",ZP="focusScope.autoFocusOnUnmount",Q3={bubbles:!1,cancelable:!0},Phe="FocusScope",s_=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Bt(s),f=Bt(i),l=_.useRef(null),d=tt(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:gu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||gu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&gu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){J3.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(QP,Q3);o.addEventListener(QP,u),o.dispatchEvent(g),g.defaultPrevented||(The(Mhe(y6(o)),{select:!0}),document.activeElement===h&&gu(o))}return()=>{o.removeEventListener(QP,u),setTimeout(()=>{const g=new CustomEvent(ZP,Q3);o.addEventListener(ZP,f),o.dispatchEvent(g),g.defaultPrevented||gu(h??document.body,{select:!0}),o.removeEventListener(ZP,f),J3.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=khe(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&gu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&gu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(De.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});s_.displayName=Phe;function The(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(gu(r,{select:e}),document.activeElement!==n)return}function khe(t){const e=y6(t),n=Z3(e,t),r=Z3(e.reverse(),t);return[n,r]}function y6(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Z3(t,e){for(const n of t)if(!Dhe(n,{upTo:e}))return n}function Dhe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Nhe(t){return t instanceof HTMLInputElement&&"select"in t}function gu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Nhe(t)&&e&&t.select()}}var J3=Ohe();function Ohe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=ez(t,e),t.unshift(e)},remove(e){var n;t=ez(t,e),(n=t[0])==null||n.resume()}}}function ez(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Mhe(t){return t.filter(e=>e.tagName!=="A")}var Lhe="Portal",wv=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);Mn(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?e_.createPortal(P.jsx(De.div,{...r,ref:e}),a):null});wv.displayName=Lhe;var JP=0;function $1(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??tz()),document.body.insertAdjacentElement("beforeend",t[1]??tz()),JP++,()=>{JP===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),JP--}},[])}function tz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}var fr=function(){return fr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r"u")return Khe;var e=Yhe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Qhe=z1(),Mm="data-scroll-locked",Zhe=function(t,e,n,r){var s=t.left,i=t.top,a=t.right,o=t.gap;return n===void 0&&(n="margin"),` + .`.concat(Ihe,` { overflow: hidden `).concat(r,`; padding-right: `).concat(o,"px ").concat(r,`; } @@ -183,22 +183,22 @@ Error generating stack: `+i.message+` } body[`).concat(Mm,`] { - `).concat(Ohe,": ").concat(o,`px; + `).concat($he,": ").concat(o,`px; } -`)},ez=function(){var t=parseInt(document.body.getAttribute(Mm)||"0",10);return isFinite(t)?t:0},Yhe=function(){_.useEffect(function(){return document.body.setAttribute(Mm,(ez()+1).toString()),function(){var t=ez()-1;t<=0?document.body.removeAttribute(Mm):document.body.setAttribute(Mm,t.toString())}},[])},yL=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;Yhe();var i=_.useMemo(function(){return Ghe(s)},[s]);return _.createElement(qhe,{styles:Khe(i,!e,s,n?"":"!important")})},OD=!1;if(typeof window<"u")try{var Xx=Object.defineProperty({},"passive",{get:function(){return OD=!0,!0}});window.addEventListener("test",Xx,Xx),window.removeEventListener("test",Xx,Xx)}catch{OD=!1}var Op=OD?{passive:!1}:!1,Xhe=function(t){return t.tagName==="TEXTAREA"},v6=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Xhe(t)&&n[e]==="visible")},Qhe=function(t){return v6(t,"overflowY")},Zhe=function(t){return v6(t,"overflowX")},tz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=y6(t,r);if(s){var i=b6(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Jhe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},epe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},y6=function(t,e){return t==="v"?Qhe(e):Zhe(e)},b6=function(t,e){return t==="v"?Jhe(e):epe(e)},tpe=function(t,e){return t==="h"&&e==="rtl"?-1:1},npe=function(t,e,n,r,s){var i=tpe(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=b6(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&y6(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},Qx=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},nz=function(t){return[t.deltaX,t.deltaY]},rz=function(t){return t&&"current"in t?t.current:t},rpe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},spe=function(t){return` +`)},rz=function(){var t=parseInt(document.body.getAttribute(Mm)||"0",10);return isFinite(t)?t:0},Jhe=function(){_.useEffect(function(){return document.body.setAttribute(Mm,(rz()+1).toString()),function(){var t=rz()-1;t<=0?document.body.removeAttribute(Mm):document.body.setAttribute(Mm,t.toString())}},[])},wL=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,s=r===void 0?"margin":r;Jhe();var i=_.useMemo(function(){return Xhe(s)},[s]);return _.createElement(Qhe,{styles:Zhe(i,!e,s,n?"":"!important")})},MD=!1;if(typeof window<"u")try{var Qx=Object.defineProperty({},"passive",{get:function(){return MD=!0,!0}});window.addEventListener("test",Qx,Qx),window.removeEventListener("test",Qx,Qx)}catch{MD=!1}var Mp=MD?{passive:!1}:!1,epe=function(t){return t.tagName==="TEXTAREA"},_6=function(t,e){var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!epe(t)&&n[e]==="visible")},tpe=function(t){return _6(t,"overflowY")},npe=function(t){return _6(t,"overflowX")},sz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=x6(t,r);if(s){var i=S6(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rpe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},spe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},x6=function(t,e){return t==="v"?tpe(e):npe(e)},S6=function(t,e){return t==="v"?rpe(e):spe(e)},ipe=function(t,e){return t==="h"&&e==="rtl"?-1:1},ope=function(t,e,n,r,s){var i=ipe(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=S6(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&x6(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},Zx=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},iz=function(t){return[t.deltaX,t.deltaY]},oz=function(t){return t&&"current"in t?t.current:t},ape=function(t,e){return t[0]===e[0]&&t[1]===e[1]},lpe=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},ipe=0,Mp=[];function ope(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(ipe++)[0],i=_.useState(j1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=pL([t.lockRef.current],(t.shards||[]).map(rz),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2)return!a.current.allowPinchZoom;var g=Qx(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=tz(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=tz(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return npe(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Mp.length||Mp[Mp.length-1]!==i)){var g="deltaY"in y?nz(y):Qx(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&rpe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(rz).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:ape(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=Qx(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,nz(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,Qx(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Mp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Op),document.addEventListener("touchmove",c,Op),document.addEventListener("touchstart",f,Op),function(){Mp=Mp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Op),document.removeEventListener("touchmove",c,Op),document.removeEventListener("touchstart",f,Op)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:spe(s)}):null,m?_.createElement(yL,{gapMode:t.gapMode}):null)}function ape(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const lpe=vL(g6,ope);var s_=_.forwardRef(function(t,e){return _.createElement(F1,fr({},t,{ref:e,sideCar:lpe}))});s_.classNames=F1.classNames;var cpe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Lp=new WeakMap,Zx=new WeakMap,Jx={},nT=0,w6=function(t){return t&&(t.host||w6(t.parentNode))},upe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=w6(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},dpe=function(t,e,n,r){var s=upe(e,Array.isArray(t)?t:[t]);Jx[n]||(Jx[n]=new WeakMap);var i=Jx[n],a=[],o=new Set,c=new Set(s),u=function(l){!l||o.has(l)||(o.add(l),u(l.parentNode))};s.forEach(u);var f=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(d){if(o.has(d))f(d);else try{var m=d.getAttribute(r),p=m!==null&&m!=="false",h=(Lp.get(d)||0)+1,y=(i.get(d)||0)+1;Lp.set(d,h),i.set(d,y),a.push(d),h===1&&p&&Zx.set(d,!0),y===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return f(e),o.clear(),nT++,function(){a.forEach(function(l){var d=Lp.get(l)-1,m=i.get(l)-1;Lp.set(l,d),i.set(l,m),d||(Zx.has(l)||l.removeAttribute(r),Zx.delete(l)),m||l.removeAttribute(n)}),nT--,nT||(Lp=new WeakMap,Lp=new WeakMap,Zx=new WeakMap,Jx={})}},_v=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=cpe(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),dpe(r,s,n,"aria-hidden")):function(){return null}},bL="Dialog",[_6,x6]=Pn(bL),[fpe,ka]=_6(bL),S6=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(fpe,{scope:e,triggerRef:o,contentRef:c,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};S6.displayName=bL;var E6="DialogTrigger",C6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ka(E6,n),i=tt(e,s.triggerRef);return P.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":xL(s.open),...r,ref:i,onClick:me(t.onClick,s.onOpenToggle)})});C6.displayName=E6;var wL="DialogPortal",[hpe,A6]=_6(wL,{forceMount:void 0}),R6=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=ka(wL,e);return P.jsx(hpe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(Un,{present:n||i.open,children:P.jsx(wv,{asChild:!0,container:s,children:a})}))})};R6.displayName=wL;var ZE="DialogOverlay",P6=_.forwardRef((t,e)=>{const n=A6(ZE,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=ka(ZE,t.__scopeDialog);return i.modal?P.jsx(Un,{present:r||i.open,children:P.jsx(ppe,{...s,ref:e})}):null});P6.displayName=ZE;var ppe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ka(ZE,n);return P.jsx(s_,{as:Sa,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(De.div,{"data-state":xL(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Uh="DialogContent",T6=_.forwardRef((t,e)=>{const n=A6(Uh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=ka(Uh,t.__scopeDialog);return P.jsx(Un,{present:r||i.open,children:i.modal?P.jsx(mpe,{...s,ref:e}):P.jsx(gpe,{...s,ref:e})})});T6.displayName=Uh;var mpe=_.forwardRef((t,e)=>{const n=ka(Uh,t.__scopeDialog),r=_.useRef(null),s=tt(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(k6,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault())})}),gpe=_.forwardRef((t,e)=>{const n=ka(Uh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(k6,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),k6=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=ka(Uh,n),c=_.useRef(null),u=tt(e,c);return I1(),P.jsxs(P.Fragment,{children:[P.jsx(r_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Yc,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":xL(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(ype,{titleId:o.titleId}),P.jsx(wpe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),_L="DialogTitle",D6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ka(_L,n);return P.jsx(De.h2,{id:s.titleId,...r,ref:e})});D6.displayName=_L;var N6="DialogDescription",O6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ka(N6,n);return P.jsx(De.p,{id:s.descriptionId,...r,ref:e})});O6.displayName=N6;var M6="DialogClose",L6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=ka(M6,n);return P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});L6.displayName=M6;function xL(t){return t?"open":"closed"}var I6="DialogTitleWarning",[vpe,$6]=Fde(I6,{contentName:Uh,titleName:_L,docsSlug:"dialog"}),ype=({titleId:t})=>{const e=$6(I6),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},cpe=0,Lp=[];function upe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(cpe++)[0],i=_.useState(z1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=gL([t.lockRef.current],(t.shards||[]).map(oz),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2)return!a.current.allowPinchZoom;var g=Zx(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=sz(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=sz(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return ope(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Lp.length||Lp[Lp.length-1]!==i)){var g="deltaY"in y?iz(y):Zx(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&ape(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(oz).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:dpe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=Zx(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,iz(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,Zx(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Lp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Mp),document.addEventListener("touchmove",c,Mp),document.addEventListener("touchstart",f,Mp),function(){Lp=Lp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Mp),document.removeEventListener("touchmove",c,Mp),document.removeEventListener("touchstart",f,Mp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:lpe(s)}):null,m?_.createElement(wL,{gapMode:t.gapMode}):null)}function dpe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const fpe=bL(w6,upe);var i_=_.forwardRef(function(t,e){return _.createElement(j1,fr({},t,{ref:e,sideCar:fpe}))});i_.classNames=j1.classNames;var hpe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ip=new WeakMap,Jx=new WeakMap,eS={},rT=0,E6=function(t){return t&&(t.host||E6(t.parentNode))},ppe=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=E6(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},mpe=function(t,e,n,r){var s=ppe(e,Array.isArray(t)?t:[t]);eS[n]||(eS[n]=new WeakMap);var i=eS[n],a=[],o=new Set,c=new Set(s),u=function(l){!l||o.has(l)||(o.add(l),u(l.parentNode))};s.forEach(u);var f=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(d){if(o.has(d))f(d);else try{var m=d.getAttribute(r),p=m!==null&&m!=="false",h=(Ip.get(d)||0)+1,y=(i.get(d)||0)+1;Ip.set(d,h),i.set(d,y),a.push(d),h===1&&p&&Jx.set(d,!0),y===1&&d.setAttribute(n,"true"),p||d.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",d,g)}})};return f(e),o.clear(),rT++,function(){a.forEach(function(l){var d=Ip.get(l)-1,m=i.get(l)-1;Ip.set(l,d),i.set(l,m),d||(Jx.has(l)||l.removeAttribute(r),Jx.delete(l)),m||l.removeAttribute(n)}),rT--,rT||(Ip=new WeakMap,Ip=new WeakMap,Jx=new WeakMap,eS={})}},_v=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),s=hpe(t);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),mpe(r,s,n,"aria-hidden")):function(){return null}},_L="Dialog",[C6,A6]=Pn(_L),[gpe,Da]=C6(_L),R6=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(gpe,{scope:e,triggerRef:o,contentRef:c,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};R6.displayName=_L;var P6="DialogTrigger",T6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(P6,n),i=tt(e,s.triggerRef);return P.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":EL(s.open),...r,ref:i,onClick:me(t.onClick,s.onOpenToggle)})});T6.displayName=P6;var xL="DialogPortal",[vpe,k6]=C6(xL,{forceMount:void 0}),D6=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Da(xL,e);return P.jsx(vpe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(Un,{present:n||i.open,children:P.jsx(wv,{asChild:!0,container:s,children:a})}))})};D6.displayName=xL;var JE="DialogOverlay",N6=_.forwardRef((t,e)=>{const n=k6(JE,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Da(JE,t.__scopeDialog);return i.modal?P.jsx(Un,{present:r||i.open,children:P.jsx(ype,{...s,ref:e})}):null});N6.displayName=JE;var ype=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(JE,n);return P.jsx(i_,{as:Ea,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(De.div,{"data-state":EL(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Hh="DialogContent",O6=_.forwardRef((t,e)=>{const n=k6(Hh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Da(Hh,t.__scopeDialog);return P.jsx(Un,{present:r||i.open,children:i.modal?P.jsx(bpe,{...s,ref:e}):P.jsx(wpe,{...s,ref:e})})});O6.displayName=Hh;var bpe=_.forwardRef((t,e)=>{const n=Da(Hh,t.__scopeDialog),r=_.useRef(null),s=tt(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(M6,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault())})}),wpe=_.forwardRef((t,e)=>{const n=Da(Hh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(M6,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),M6=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Da(Hh,n),c=_.useRef(null),u=tt(e,c);return $1(),P.jsxs(P.Fragment,{children:[P.jsx(s_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Yc,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":EL(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(xpe,{titleId:o.titleId}),P.jsx(Epe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),SL="DialogTitle",L6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(SL,n);return P.jsx(De.h2,{id:s.titleId,...r,ref:e})});L6.displayName=SL;var I6="DialogDescription",$6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(I6,n);return P.jsx(De.p,{id:s.descriptionId,...r,ref:e})});$6.displayName=I6;var F6="DialogClose",j6=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(F6,n);return P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});j6.displayName=F6;function EL(t){return t?"open":"closed"}var z6="DialogTitleWarning",[_pe,B6]=Ude(z6,{contentName:Hh,titleName:SL,docsSlug:"dialog"}),xpe=({titleId:t})=>{const e=B6(z6),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},bpe="DialogDescriptionWarning",wpe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${$6(bpe).contentName}}.`;return _.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},SL=S6,EL=C6,CL=R6,i_=P6,o_=T6,a_=D6,l_=O6,c_=L6,F6="AlertDialog",[_pe,M4e]=Pn(F6,[x6]),Xc=x6(),j6=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xc(e);return P.jsx(SL,{...r,...n,modal:!0})};j6.displayName=F6;var xpe="AlertDialogTrigger",z6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(EL,{...s,...r,ref:e})});z6.displayName=xpe;var Spe="AlertDialogPortal",B6=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xc(e);return P.jsx(CL,{...r,...n})};B6.displayName=Spe;var Epe="AlertDialogOverlay",U6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(i_,{...s,...r,ref:e})});U6.displayName=Epe;var Lm="AlertDialogContent",[Cpe,Ape]=_pe(Lm),H6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Xc(n),a=_.useRef(null),o=tt(e,a),c=_.useRef(null);return P.jsx(vpe,{contentName:Lm,titleName:V6,docsSlug:"alert-dialog",children:P.jsx(Cpe,{scope:n,cancelRef:c,children:P.jsxs(o_,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:me(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[P.jsx(rL,{children:r}),P.jsx(Ppe,{contentRef:a})]})})})});H6.displayName=Lm;var V6="AlertDialogTitle",W6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(a_,{...s,...r,ref:e})});W6.displayName=V6;var G6="AlertDialogDescription",q6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(l_,{...s,...r,ref:e})});q6.displayName=G6;var Rpe="AlertDialogAction",K6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(c_,{...s,...r,ref:e})});K6.displayName=Rpe;var Y6="AlertDialogCancel",X6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=Ape(Y6,n),i=Xc(n),a=tt(e,s);return P.jsx(c_,{...i,...r,ref:a})});X6.displayName=Y6;var Ppe=({contentRef:t})=>{const e=`\`${Lm}\` requires a description for the component to be accessible for screen reader users. +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Spe="DialogDescriptionWarning",Epe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B6(Spe).contentName}}.`;return _.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},CL=R6,AL=T6,RL=D6,o_=N6,a_=O6,l_=L6,c_=$6,u_=j6,U6="AlertDialog",[Cpe,B4e]=Pn(U6,[A6]),Xc=A6(),H6=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xc(e);return P.jsx(CL,{...r,...n,modal:!0})};H6.displayName=U6;var Ape="AlertDialogTrigger",V6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(AL,{...s,...r,ref:e})});V6.displayName=Ape;var Rpe="AlertDialogPortal",W6=t=>{const{__scopeAlertDialog:e,...n}=t,r=Xc(e);return P.jsx(RL,{...r,...n})};W6.displayName=Rpe;var Ppe="AlertDialogOverlay",G6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(o_,{...s,...r,ref:e})});G6.displayName=Ppe;var Lm="AlertDialogContent",[Tpe,kpe]=Cpe(Lm),q6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,children:r,...s}=t,i=Xc(n),a=_.useRef(null),o=tt(e,a),c=_.useRef(null);return P.jsx(_pe,{contentName:Lm,titleName:K6,docsSlug:"alert-dialog",children:P.jsx(Tpe,{scope:n,cancelRef:c,children:P.jsxs(a_,{role:"alertdialog",...i,...s,ref:o,onOpenAutoFocus:me(s.onOpenAutoFocus,u=>{var f;u.preventDefault(),(f=c.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[P.jsx(iL,{children:r}),P.jsx(Npe,{contentRef:a})]})})})});q6.displayName=Lm;var K6="AlertDialogTitle",Y6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(l_,{...s,...r,ref:e})});Y6.displayName=K6;var X6="AlertDialogDescription",Q6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(c_,{...s,...r,ref:e})});Q6.displayName=X6;var Dpe="AlertDialogAction",Z6=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,s=Xc(n);return P.jsx(u_,{...s,...r,ref:e})});Z6.displayName=Dpe;var J6="AlertDialogCancel",eW=_.forwardRef((t,e)=>{const{__scopeAlertDialog:n,...r}=t,{cancelRef:s}=kpe(J6,n),i=Xc(n),a=tt(e,s);return P.jsx(u_,{...i,...r,ref:a})});eW.displayName=J6;var Npe=({contentRef:t})=>{const e=`\`${Lm}\` requires a description for the component to be accessible for screen reader users. -You can add a description to the \`${Lm}\` by passing a \`${G6}\` component as a child, which also benefits sighted users by adding visible context to the dialog. +You can add a description to the \`${Lm}\` by passing a \`${X6}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Lm}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return _.useEffect(()=>{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Tpe=j6,kpe=z6,Dpe=B6,Q6=U6,Z6=H6,J6=K6,eW=X6,tW=W6,nW=q6;const Vb=jo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),no=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Sa:"button";return P.jsx(a,{className:ce(Vb({variant:e,size:n,className:t})),ref:i,...s})});no.displayName="Button";const rW=Tpe,L4e=kpe,Npe=Dpe,sW=_.forwardRef(({className:t,...e},n)=>P.jsx(Q6,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));sW.displayName=Q6.displayName;const AL=_.forwardRef(({className:t,...e},n)=>P.jsxs(Npe,{children:[P.jsx(sW,{}),P.jsx(Z6,{ref:n,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));AL.displayName=Z6.displayName;const RL=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",t),...e});RL.displayName="AlertDialogHeader";const PL=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});PL.displayName="AlertDialogFooter";const TL=_.forwardRef(({className:t,...e},n)=>P.jsx(tW,{ref:n,className:ce("text-lg font-semibold",t),...e}));TL.displayName=tW.displayName;const kL=_.forwardRef(({className:t,...e},n)=>P.jsx(nW,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));kL.displayName=nW.displayName;const DL=_.forwardRef(({className:t,...e},n)=>P.jsx(J6,{ref:n,className:ce(Vb(),t),...e}));DL.displayName=J6.displayName;const NL=_.forwardRef(({className:t,...e},n)=>P.jsx(eW,{ref:n,className:ce(Vb({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));NL.displayName=eW.displayName;const Ope=({textAreaRef:t,triggerAutoSize:e,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=_.useState(!0);_.useEffect(()=>{if(t){s&&(t.style.minHeight=`${r+2}px`,n>r&&(t.style.maxHeight=`${n}px`),i(!1)),t.style.height=`${r+2}px`;const o=t.scrollHeight;o>n?t.style.height=`${n}px`:t.style.height=`${o+2}px`}},[t,e,s,n,r])},iW=_.forwardRef(({maxHeight:t=Number.MAX_SAFE_INTEGER,minHeight:e=52,className:n,onChange:r,value:s,...i},a)=>{const o=_.useRef(null),[c,u]=_.useState("");return Ope({textAreaRef:o.current,triggerAutoSize:c,maxHeight:t,minHeight:e}),_.useImperativeHandle(a,()=>({textArea:o.current,focus:()=>{var f;return(f=o.current)==null?void 0:f.focus()},maxHeight:t,minHeight:e})),_.useEffect(()=>{(s||i!=null&&i.defaultValue)&&u(s)},[s||(i==null?void 0:i.defaultValue)]),P.jsx("textarea",{...i,value:s,ref:o,className:ce("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),onChange:f=>{u(f.target.value),r==null||r(f)}})});iW.displayName="AutosizeTextarea";var OL="Avatar",[Mpe,I4e]=Pn(OL),[Lpe,oW]=Mpe(OL),aW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=_.useState("idle");return P.jsx(Lpe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:P.jsx(De.span,{...r,ref:e})})});aW.displayName=OL;var lW="AvatarImage",cW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=oW(lW,n),o=Ipe(r),c=Bt(u=>{s(u),a.onImageLoadingStatusChange(u)});return Mn(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?P.jsx(De.img,{...i,ref:e,src:r}):null});cW.displayName=lW;var uW="AvatarFallback",dW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=oW(uW,n),[a,o]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?P.jsx(De.span,{...s,ref:e}):null});dW.displayName=uW;function Ipe(t){const[e,n]=_.useState("idle");return Mn(()=>{if(!t){n("error");return}let r=!0;const s=new window.Image,i=a=>()=>{r&&n(a)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=t,()=>{r=!1}},[t]),e}var fW=aW,hW=cW,pW=dW;const $pe=_.forwardRef(({className:t,...e},n)=>P.jsx(fW,{ref:n,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));$pe.displayName=fW.displayName;const Fpe=_.forwardRef(({className:t,...e},n)=>P.jsx(hW,{ref:n,className:ce("aspect-square h-full w-full",t),...e}));Fpe.displayName=hW.displayName;const jpe=_.forwardRef(({className:t,...e},n)=>P.jsx(pW,{ref:n,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));jpe.displayName=pW.displayName;const zpe=jo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Bpe({className:t,variant:e,...n}){return P.jsx("div",{className:ce(zpe({variant:e}),t),...n})}const Upe=_.forwardRef(({...t},e)=>P.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));Upe.displayName="Breadcrumb";const Hpe=_.forwardRef(({className:t,...e},n)=>P.jsx("ol",{ref:n,className:ce("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));Hpe.displayName="BreadcrumbList";const Vpe=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:ce("inline-flex items-center gap-1.5",t),...e}));Vpe.displayName="BreadcrumbItem";const Wpe=_.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Sa:"a";return P.jsx(s,{ref:r,className:ce("transition-colors hover:text-foreground",e),...n})});Wpe.displayName="BreadcrumbLink";const Gpe=_.forwardRef(({className:t,...e},n)=>P.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ce("font-normal text-foreground",t),...e}));Gpe.displayName="BreadcrumbPage";function Kt(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function oo(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Vs(t,e){const n=Kt(t);return isNaN(e)?oo(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ea(t,e){const n=Kt(t);if(isNaN(e))return oo(t,NaN);if(!e)return n;const r=n.getDate(),s=oo(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const ML=6048e5,qpe=864e5;let Kpe={};function u_(){return Kpe}function yl(t,e){var o,c,u,f;const n=u_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function iv(t){const e=Kt(t);return e.setHours(0,0,0,0),e}function JE(t){const e=Kt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function cl(t,e){const n=iv(t),r=iv(e),s=+n-JE(n),i=+r-JE(r);return Math.round((s-i)/qpe)}function Ype(t){const e=mW(t),n=oo(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Hh(n)}function MD(t,e){const n=e*7;return Vs(t,n)}function Xpe(t,e){return Ea(t,e*12)}function Qpe(t){let e;return t.forEach(function(n){const r=Kt(n);(e===void 0||e{const r=Kt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function gi(t,e){const n=iv(t),r=iv(e);return+n==+r}function LL(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Jpe(t){if(!LL(t)&&typeof t!="number")return!1;const e=Kt(t);return!isNaN(Number(e))}function Wb(t,e){const n=Kt(t),r=Kt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function eme(t,e,n){const r=yl(t,n),s=yl(e,n),i=+r-JE(r),a=+s-JE(s);return Math.round((i-a)/ML)}function IL(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Si(t){const e=Kt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function gW(t){const e=Kt(t),n=oo(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function $L(t,e){var o,c,u,f;const n=u_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i{let r;const s=tme[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function rT(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const rme={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},sme={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ime={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ome={date:rT({formats:rme,defaultWidth:"full"}),time:rT({formats:sme,defaultWidth:"full"}),dateTime:rT({formats:ime,defaultWidth:"full"})},ame={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lme=(t,e,n,r)=>ame[t];function py(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):a;s=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[o]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const cme={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ume={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dme={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fme={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hme={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},pme={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},mme=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},gme={ordinalNumber:mme,era:py({values:cme,defaultWidth:"wide"}),quarter:py({values:ume,defaultWidth:"wide",argumentCallback:t=>t-1}),month:py({values:dme,defaultWidth:"wide"}),day:py({values:fme,defaultWidth:"wide"}),dayPeriod:py({values:hme,defaultWidth:"wide",formattingValues:pme,defaultFormattingWidth:"wide"})};function my(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?yme(o,l=>l.test(a)):vme(o,l=>l.test(a));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=e.slice(a.length);return{value:u,rest:f}}}function vme(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function yme(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(s.length);return{value:a,rest:o}}}const wme=/^(\d+)(th|st|nd|rd)?/i,_me=/\d+/i,xme={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Sme={any:[/^b/i,/^(a|c)/i]},Eme={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Cme={any:[/1/i,/2/i,/3/i,/4/i]},Ame={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Rme={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Pme={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Tme={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},kme={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Dme={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nme={ordinalNumber:bme({matchPattern:wme,parsePattern:_me,valueCallback:t=>parseInt(t,10)}),era:my({matchPatterns:xme,defaultMatchWidth:"wide",parsePatterns:Sme,defaultParseWidth:"any"}),quarter:my({matchPatterns:Eme,defaultMatchWidth:"wide",parsePatterns:Cme,defaultParseWidth:"any",valueCallback:t=>t+1}),month:my({matchPatterns:Ame,defaultMatchWidth:"wide",parsePatterns:Rme,defaultParseWidth:"any"}),day:my({matchPatterns:Pme,defaultMatchWidth:"wide",parsePatterns:Tme,defaultParseWidth:"any"}),dayPeriod:my({matchPatterns:kme,defaultMatchWidth:"any",parsePatterns:Dme,defaultParseWidth:"any"})},yW={code:"en-US",formatDistance:nme,formatLong:ome,formatRelative:lme,localize:gme,match:Nme,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ome(t){const e=Kt(t);return cl(e,gW(e))+1}function bW(t){const e=Kt(t),n=+Hh(e)-+Ype(e);return Math.round(n/ML)+1}function wW(t,e){var f,l,d,m;const n=Kt(t),r=n.getFullYear(),s=u_(),i=(e==null?void 0:e.firstWeekContainsDate)??((l=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(d=s.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=oo(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=yl(a,e),c=oo(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=yl(c,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Mme(t,e){var o,c,u,f;const n=u_(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=wW(t,e),i=oo(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),yl(i,e)}function _W(t,e){const n=Kt(t),r=+yl(n,e)-+Mme(n,e);return Math.round(r/ML)+1}function dn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const hu={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return dn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):dn(n+1,2)},d(t,e){return dn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return dn(t.getHours()%12||12,e.length)},H(t,e){return dn(t.getHours(),e.length)},m(t,e){return dn(t.getMinutes(),e.length)},s(t,e){return dn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return dn(s,e.length)}},Ip={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sz={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return hu.y(t,e)},Y:function(t,e,n,r){const s=wW(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return dn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):dn(i,e.length)},R:function(t,e){const n=mW(t);return dn(n,e.length)},u:function(t,e){const n=t.getFullYear();return dn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return dn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return dn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return hu.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return dn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=_W(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):dn(s,e.length)},I:function(t,e,n){const r=bW(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):dn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):hu.d(t,e)},D:function(t,e,n){const r=Ome(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return dn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return dn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return dn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=Ip.noon:r===0?s=Ip.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=Ip.evening:r>=12?s=Ip.afternoon:r>=4?s=Ip.morning:s=Ip.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return hu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):hu.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):hu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):hu.s(t,e)},S:function(t,e){return hu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return oz(r);case"XXXX":case"XX":return uf(r);case"XXXXX":case"XXX":default:return uf(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return oz(r);case"xxxx":case"xx":return uf(r);case"xxxxx":case"xxx":default:return uf(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+iz(r,":");case"OOOO":default:return"GMT"+uf(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+iz(r,":");case"zzzz":default:return"GMT"+uf(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return dn(r,e.length)},T:function(t,e,n){const r=t.getTime();return dn(r,e.length)}};function iz(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+dn(i,2)}function oz(t,e){return t%60===0?(t>0?"-":"+")+dn(Math.abs(t)/60,2):uf(t,e)}function uf(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=dn(Math.trunc(r/60),2),i=dn(r%60,2);return n+s+e+i}const az=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},xW=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Lme=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return az(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",az(r,e)).replace("{{time}}",xW(s,e))},Ime={p:xW,P:Lme},$me=/^D+$/,Fme=/^Y+$/,jme=["D","DD","YY","YYYY"];function zme(t){return $me.test(t)}function Bme(t){return Fme.test(t)}function Ume(t,e,n){const r=Hme(t,e,n);if(console.warn(r),jme.includes(t))throw new RangeError(r)}function Hme(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vme=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wme=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Gme=/^'([^]*?)'?$/,qme=/''/g,Kme=/[a-zA-Z]/;function up(t,e,n){var f,l,d,m,p,h,y,g;const r=u_(),s=(n==null?void 0:n.locale)??r.locale??yW,i=(n==null?void 0:n.firstWeekContainsDate)??((l=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(d=r.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((h=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((g=(y=r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??0,o=Kt(t);if(!Jpe(o))throw new RangeError("Invalid time value");let c=e.match(Wme).map(v=>{const w=v[0];if(w==="p"||w==="P"){const x=Ime[w];return x(v,s.formatLong)}return v}).join("").match(Vme).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:Yme(v)};if(sz[w])return{isToken:!0,value:v};if(w.match(Kme))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(o,c));const u={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const w=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Bme(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&zme(w))&&Ume(w,e,String(t));const x=sz[w[0]];return x(o,w,s.localize,u)}).join("")}function Yme(t){const e=t.match(Gme);return e?e[1].replace(qme,"'"):t}function Xme(t){const e=Kt(t),n=e.getFullYear(),r=e.getMonth(),s=oo(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function Qme(t){return Math.trunc(+Kt(t)/1e3)}function Zme(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function Jme(t,e){return eme(Zme(t),Si(t),e)+1}function LD(t,e){const n=Kt(t),r=Kt(e);return n.getTime()>r.getTime()}function SW(t,e){const n=Kt(t),r=Kt(e);return+n<+r}function FL(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function ege(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()}function sT(t,e){return Vs(t,-e)}function iT(t,e){const n=Kt(t),r=n.getFullYear(),s=n.getDate(),i=oo(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=Xme(i);return n.setMonth(e,Math.min(s,a)),n}function lz(t,e){const n=Kt(t);return isNaN(+n)?oo(t,NaN):(n.setFullYear(e),n)}var dt=function(){return dt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1&&(c||!u),l=e>1&&(u||!c),d=function(){r&&i(r)},m=function(){s&&i(s)};return P.jsx(Oge,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:d,onNextClick:m})}function Mge(t){var e,n=Ln(),r=n.classNames,s=n.disableNavigation,i=n.styles,a=n.captionLayout,o=n.components,c=(e=o==null?void 0:o.CaptionLabel)!==null&&e!==void 0?e:AW,u;return s?u=P.jsx(c,{id:t.id,displayMonth:t.displayMonth}):a==="dropdown"?u=P.jsx(cz,{displayMonth:t.displayMonth,id:t.id}):a==="dropdown-buttons"?u=P.jsxs(P.Fragment,{children:[P.jsx(cz,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),P.jsx(uz,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=P.jsxs(P.Fragment,{children:[P.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(uz,{displayMonth:t.displayMonth,id:t.id})]}),P.jsx("div",{className:r.caption,style:i.caption,children:u})}function Lge(t){var e=Ln(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?P.jsx("tfoot",{className:s,style:r.tfoot,children:P.jsx("tr",{children:P.jsx("td",{colSpan:8,children:n})})}):P.jsx(P.Fragment,{})}function Ige(t,e,n){for(var r=n?Hh(new Date):yl(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var a=Vs(r,i);s.push(a)}return s}function $ge(){var t=Ln(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,a=t.ISOWeek,o=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,u=Ige(s,i,a);return P.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&P.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(f,l){return P.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:o(f,{locale:s})},l)})]})}function Fge(){var t,e=Ln(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:$ge;return P.jsx("thead",{style:r.head,className:n.head,children:P.jsx(i,{})})}function jge(t){var e=Ln(),n=e.locale,r=e.formatters.formatDay;return P.jsx(P.Fragment,{children:r(t.date,{locale:n})})}var jL=_.createContext(void 0);function zge(t){if(!d_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return P.jsx(jL.Provider,{value:e,children:t.children})}return P.jsx(Bge,{initialProps:t.initialProps,children:t.children})}function Bge(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,a=function(u,f,l){var d,m;(d=e.onDayClick)===null||d===void 0||d.call(e,u,f,l);var p=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!p){var h=!!(!f.selected&&i&&(r==null?void 0:r.length)===i);if(!h){var y=r?EW([],r):[];if(f.selected){var g=y.findIndex(function(v){return gi(u,v)});y.splice(g,1)}else y.push(u);(m=e.onSelect)===null||m===void 0||m.call(e,y,u,f,l)}}},o={disabled:[]};r&&o.disabled.push(function(u){var f=i&&r.length>i-1,l=r.some(function(d){return gi(d,u)});return!!(f&&!l)});var c={selected:r,onDayClick:a,modifiers:o};return P.jsx(jL.Provider,{value:c,children:n})}function zL(){var t=_.useContext(jL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Uge(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?gi(s,t)&&gi(r,t)?void 0:gi(s,t)?{from:s,to:void 0}:gi(r,t)?void 0:LD(r,t)?{from:t,to:s}:{from:r,to:t}:s?LD(t,s)?{from:s,to:t}:{from:t,to:s}:r?SW(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var BL=_.createContext(void 0);function Hge(t){if(!f_(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return P.jsx(BL.Provider,{value:e,children:t.children})}return P.jsx(Vge,{initialProps:t.initialProps,children:t.children})}function Vge(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,a=s.to,o=e.min,c=e.max,u=function(m,p,h){var y,g;(y=e.onDayClick)===null||y===void 0||y.call(e,m,p,h);var v=Uge(m,r);(g=e.onSelect)===null||g===void 0||g.call(e,v,m,p,h)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(f.range_start=[i],a?(f.range_end=[a],gi(i,a)||(f.range_middle=[{after:i,before:a}])):f.range_end=[i]):a&&(f.range_start=[a],f.range_end=[a]),o&&(i&&!a&&f.disabled.push({after:sT(i,o-1),before:Vs(i,o-1)}),i&&a&&f.disabled.push({after:i,before:Vs(i,o-1)}),!i&&a&&f.disabled.push({after:sT(a,o-1),before:Vs(a,o-1)})),c){if(i&&!a&&(f.disabled.push({before:Vs(i,-c+1)}),f.disabled.push({after:Vs(i,c-1)})),i&&a){var l=cl(a,i)+1,d=c-l;f.disabled.push({before:sT(i,d)}),f.disabled.push({after:Vs(a,d)})}!i&&a&&(f.disabled.push({before:Vs(a,-c+1)}),f.disabled.push({after:Vs(a,c-1)}))}return P.jsx(BL.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function UL(){var t=_.useContext(BL);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function zS(t){return Array.isArray(t)?EW([],t):t!==void 0?[t]:[]}function Wge(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=zS(s)}),e}var Ca;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Ca||(Ca={}));var Gge=Ca.Selected,zl=Ca.Disabled,qge=Ca.Hidden,Kge=Ca.Today,oT=Ca.RangeEnd,aT=Ca.RangeMiddle,lT=Ca.RangeStart,Yge=Ca.Outside;function Xge(t,e,n){var r,s=(r={},r[Gge]=zS(t.selected),r[zl]=zS(t.disabled),r[qge]=zS(t.hidden),r[Kge]=[t.today],r[oT]=[],r[aT]=[],r[lT]=[],r[Yge]=[],r);return t.fromDate&&s[zl].push({before:t.fromDate}),t.toDate&&s[zl].push({after:t.toDate}),d_(t)?s[zl]=s[zl].concat(e.modifiers[zl]):f_(t)&&(s[zl]=s[zl].concat(n.modifiers[zl]),s[lT]=n.modifiers[lT],s[aT]=n.modifiers[aT],s[oT]=n.modifiers[oT]),s}var TW=_.createContext(void 0);function Qge(t){var e=Ln(),n=zL(),r=UL(),s=Xge(e,n,r),i=Wge(e.modifiers),a=dt(dt({},s),i);return P.jsx(TW.Provider,{value:a,children:t.children})}function kW(){var t=_.useContext(TW);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function Zge(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Jge(t){return!!(t&&typeof t=="object"&&"from"in t)}function eve(t){return!!(t&&typeof t=="object"&&"after"in t)}function tve(t){return!!(t&&typeof t=="object"&&"before"in t)}function nve(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function rve(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=cl(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var a=cl(t,r)>=0&&cl(s,t)>=0;return a}return s?gi(s,t):r?gi(r,t):!1}function sve(t){return LL(t)}function ive(t){return Array.isArray(t)&&t.every(LL)}function ove(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(sve(n))return gi(t,n);if(ive(n))return n.includes(t);if(Jge(n))return rve(t,n);if(nve(n))return n.dayOfWeek.includes(t.getDay());if(Zge(n)){var r=cl(n.before,t),s=cl(n.after,t),i=r>0,a=s<0,o=LD(n.before,n.after);return o?a&&i:i||a}return eve(n)?cl(t,n.after)>0:tve(n)?cl(n.before,t)>0:typeof n=="function"?n(t):!1})}function HL(t,e,n){var r=Object.keys(e).reduce(function(i,a){var o=e[a];return ove(t,o)&&i.push(a),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!FL(t,n)&&(s.outside=!0),s}function ave(t,e){for(var n=Si(t[0]),r=IL(t[t.length-1]),s,i,a=n;a<=r;){var o=HL(a,e),c=!o.disabled&&!o.hidden;if(!c){a=Vs(a,1);continue}if(o.selected)return a;o.today&&!i&&(i=a),s||(s=a),a=Vs(a,1)}return i||s}var lve=365;function DW(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,a=e.retry,o=a===void 0?{count:0,lastFocused:t}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,l=s.locale,d={day:Vs,week:MD,month:Ea,year:Xpe,startOfWeek:function(y){return s.ISOWeek?Hh(y):yl(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?vW(y):$L(y,{locale:l,weekStartsOn:c})}},m=d[n](t,r==="after"?1:-1);r==="before"&&u?m=Qpe([u,m]):r==="after"&&f&&(m=Zpe([f,m]));var p=!0;if(i){var h=HL(m,i);p=!h.disabled&&!h.hidden}return p?m:o.count>lve?o.lastFocused:DW(m,{moveBy:n,direction:r,context:s,modifiers:i,retry:dt(dt({},o),{count:o.count+1})})}var NW=_.createContext(void 0);function cve(t){var e=h_(),n=kW(),r=_.useState(),s=r[0],i=r[1],a=_.useState(),o=a[0],c=a[1],u=ave(e.displayMonths,n),f=s??(o&&e.isDateDisplayed(o))?o:u,l=function(){c(s),i(void 0)},d=function(y){i(y)},m=Ln(),p=function(y,g){if(s){var v=DW(s,{moveBy:y,direction:g,context:m,modifiers:n});gi(s,v)||(e.goToDate(v,s),d(v))}},h={focusedDay:s,focusTarget:f,blur:l,focus:d,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return P.jsx(NW.Provider,{value:h,children:t.children})}function VL(){var t=_.useContext(NW);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function uve(t,e){var n=kW(),r=HL(t,n,e);return r}var WL=_.createContext(void 0);function dve(t){if(!z1(t.initialProps)){var e={selected:void 0};return P.jsx(WL.Provider,{value:e,children:t.children})}return P.jsx(fve,{initialProps:t.initialProps,children:t.children})}function fve(t){var e=t.initialProps,n=t.children,r=function(i,a,o){var c,u,f;if((c=e.onDayClick)===null||c===void 0||c.call(e,i,a,o),a.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,i,a,o);return}(f=e.onSelect)===null||f===void 0||f.call(e,i,i,a,o)},s={selected:e.selected,onDayClick:r};return P.jsx(WL.Provider,{value:s,children:n})}function OW(){var t=_.useContext(WL);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function hve(t,e){var n=Ln(),r=OW(),s=zL(),i=UL(),a=VL(),o=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,l=a.blur,d=a.focus,m=a.focusMonthBefore,p=a.focusMonthAfter,h=a.focusYearBefore,y=a.focusYearAfter,g=a.focusStartOfWeek,v=a.focusEndOfWeek,w=function(V){var H,ee,re,X;z1(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,t,e,V):d_(n)?(ee=s.onDayClick)===null||ee===void 0||ee.call(s,t,e,V):f_(n)?(re=i.onDayClick)===null||re===void 0||re.call(i,t,e,V):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,V)},x=function(V){var H;d(t),(H=n.onDayFocus)===null||H===void 0||H.call(n,t,e,V)},A=function(V){var H;l(),(H=n.onDayBlur)===null||H===void 0||H.call(n,t,e,V)},k=function(V){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,t,e,V)},R=function(V){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,t,e,V)},E=function(V){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,t,e,V)},T=function(V){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,t,e,V)},D=function(V){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,t,e,V)},O=function(V){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,t,e,V)},L=function(V){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,t,e,V)},I=function(V){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,t,e,V)},F=function(V){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,t,e,V)},U=function(V){var H;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?o():c();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?c():o();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),u();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),f();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?h():m();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():p();break;case"Home":V.preventDefault(),V.stopPropagation(),g();break;case"End":V.preventDefault(),V.stopPropagation(),v();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,t,e,V)},Y={onClick:w,onFocus:x,onBlur:A,onKeyDown:U,onKeyUp:F,onMouseEnter:k,onMouseLeave:R,onPointerEnter:E,onPointerLeave:T,onTouchCancel:D,onTouchEnd:O,onTouchMove:L,onTouchStart:I};return Y}function pve(){var t=Ln(),e=OW(),n=zL(),r=UL(),s=z1(t)?e.selected:d_(t)?n.selected:f_(t)?r.selected:void 0;return s}function mve(t){return Object.values(Ca).includes(t)}function gve(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(r){var s=t.modifiersClassNames[r];if(s)n.push(s);else if(mve(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function vve(t,e){var n=dt({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=dt(dt({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function yve(t,e,n){var r,s,i,a=Ln(),o=VL(),c=uve(t,e),u=hve(t,c),f=pve(),l=!!(a.onDayClick||a.mode!=="default");_.useEffect(function(){var k;c.outside||o.focusedDay&&l&&gi(o.focusedDay,t)&&((k=n.current)===null||k===void 0||k.focus())},[o.focusedDay,t,n,l,c.outside]);var d=gve(a,c).join(" "),m=vve(a,c),p=!!(c.outside&&!a.showOutsideDays||c.hidden),h=(i=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:jge,y=P.jsx(h,{date:t,displayMonth:e,activeModifiers:c}),g={style:m,className:d,children:y,role:"gridcell"},v=o.focusTarget&&gi(o.focusTarget,t)&&!c.outside,w=o.focusedDay&&gi(o.focusedDay,t),x=dt(dt(dt({},g),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||v?0:-1,r)),u),A={isButton:l,isHidden:p,activeModifiers:c,selectedDays:f,buttonProps:x,divProps:g};return A}function bve(t){var e=_.useRef(null),n=yve(t.date,t.displayMonth,e);return n.isHidden?P.jsx("div",{role:"gridcell"}):n.isButton?P.jsx(eC,dt({name:"day",ref:e},n.buttonProps)):P.jsx("div",dt({},n.divProps))}function wve(t){var e=t.number,n=t.dates,r=Ln(),s=r.onWeekNumberClick,i=r.styles,a=r.classNames,o=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(e),{locale:o});if(!s)return P.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:f});var l=c(Number(e),{locale:o}),d=function(m){s(e,n,m)};return P.jsx(eC,{name:"week-number","aria-label":l,className:a.weeknumber,style:i.weeknumber,onClick:d,children:f})}function _ve(t){var e,n,r=Ln(),s=r.styles,i=r.classNames,a=r.showWeekNumber,o=r.components,c=(e=o==null?void 0:o.Day)!==null&&e!==void 0?e:bve,u=(n=o==null?void 0:o.WeekNumber)!==null&&n!==void 0?n:wve,f;return a&&(f=P.jsx("td",{className:i.cell,style:s.cell,children:P.jsx(u,{number:t.weekNumber,dates:t.dates})})),P.jsxs("tr",{className:i.row,style:s.row,children:[f,t.dates.map(function(l){return P.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:P.jsx(c,{displayMonth:t.displayMonth,date:l})},Qme(l))})]})}function dz(t,e,n){for(var r=n!=null&&n.ISOWeek?vW(e):$L(e,n),s=n!=null&&n.ISOWeek?Hh(t):yl(t,n),i=cl(r,s),a=[],o=0;o<=i;o++)a.push(Vs(s,o));var c=a.reduce(function(u,f){var l=n!=null&&n.ISOWeek?bW(f):_W(f,n),d=u.find(function(m){return m.weekNumber===l});return d?(d.dates.push(f),u):(u.push({weekNumber:l,dates:[f]}),u)},[]);return c}function xve(t,e){var n=dz(Si(t),IL(t),e);if(e!=null&&e.useFixedWeeks){var r=Jme(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],a=MD(i,6-r),o=dz(MD(i,1),a,e);n.push.apply(n,o)}}return n}function Sve(t){var e,n,r,s=Ln(),i=s.locale,a=s.classNames,o=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,l=s.weekStartsOn,d=s.firstWeekContainsDate,m=s.ISOWeek,p=xve(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:i,weekStartsOn:l,firstWeekContainsDate:d}),h=(e=f==null?void 0:f.Head)!==null&&e!==void 0?e:Fge,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:_ve,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:Lge;return P.jsxs("table",{id:t.id,className:a.table,style:o.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&P.jsx(h,{}),P.jsx("tbody",{className:a.tbody,style:o.tbody,children:p.map(function(v){return P.jsx(y,{displayMonth:t.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),P.jsx(g,{displayMonth:t.displayMonth})]})}function Eve(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Cve=Eve()?_.useLayoutEffect:_.useEffect,cT=!1,Ave=0;function fz(){return"react-day-picker-".concat(++Ave)}function Rve(t){var e,n=t??(cT?fz():null),r=_.useState(n),s=r[0],i=r[1];return Cve(function(){s===null&&i(fz())},[]),_.useEffect(function(){cT===!1&&(cT=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Pve(t){var e,n,r=Ln(),s=r.dir,i=r.classNames,a=r.styles,o=r.components,c=h_().displayMonths,u=Rve(r.id?"".concat(r.id,"-").concat(t.displayIndex):void 0),f=r.id?"".concat(r.id,"-grid-").concat(t.displayIndex):void 0,l=[i.month],d=a.month,m=t.displayIndex===0,p=t.displayIndex===c.length-1,h=!m&&!p;s==="rtl"&&(e=[m,p],p=e[0],m=e[1]),m&&(l.push(i.caption_start),d=dt(dt({},d),a.caption_start)),p&&(l.push(i.caption_end),d=dt(dt({},d),a.caption_end)),h&&(l.push(i.caption_between),d=dt(dt({},d),a.caption_between));var y=(n=o==null?void 0:o.Caption)!==null&&n!==void 0?n:Mge;return P.jsxs("div",{className:l.join(" "),style:d,children:[P.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(Sve,{id:f,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function Tve(t){var e=Ln(),n=e.classNames,r=e.styles;return P.jsx("div",{className:n.months,style:r.months,children:t.children})}function kve(t){var e,n,r=t.initialProps,s=Ln(),i=VL(),a=h_(),o=_.useState(!1),c=o[0],u=o[1];_.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var f=[s.classNames.root,s.className];s.numberOfMonths>1&&f.push(s.classNames.multiple_months),s.showWeekNumber&&f.push(s.classNames.with_weeknumber);var l=dt(dt({},s.styles.root),s.style),d=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,h){var y;return dt(dt({},p),(y={},y[h]=r[h],y))},{}),m=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Tve;return P.jsx("div",dt({className:f.join(" "),style:l,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},d,{children:P.jsx(m,{children:a.displayMonths.map(function(p,h){return P.jsx(Pve,{displayIndex:h,displayMonth:p},h)})})}))}function Dve(t){var e=t.children,n=tge(t,["children"]);return P.jsx(wge,{initialProps:n,children:P.jsx(kge,{children:P.jsx(dve,{initialProps:n,children:P.jsx(zge,{initialProps:n,children:P.jsx(Hge,{initialProps:n,children:P.jsx(Qge,{children:P.jsx(cve,{children:e})})})})})})})}function Nve(t){return P.jsx(Dve,dt({},t,{children:P.jsx(kve,{initialProps:t})}))}function MW({className:t,classNames:e,showOutsideDays:n=!0,...r}){return P.jsx(Nve,{showOutsideDays:n,className:ce("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ce(Vb({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ce(Vb({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:()=>P.jsx(dL,{className:"w-4 h-4"}),IconRight:()=>P.jsx(n_,{className:"w-4 h-4"})},...r})}MW.displayName="Calendar";const LW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("rounded-md border bg-card text-card-foreground shadow",t),...e}));LW.displayName="Card";const IW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",t),...e}));IW.displayName="CardHeader";const $W=_.forwardRef(({className:t,...e},n)=>P.jsx("h3",{ref:n,className:ce("font-semibold leading-none tracking-tight",t),...e}));$W.displayName="CardTitle";const FW=_.forwardRef(({className:t,...e},n)=>P.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));FW.displayName="CardDescription";const jW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("p-6 pt-0",t),...e}));jW.displayName="CardContent";const zW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",t),...e}));zW.displayName="CardFooter";var Ove=Array.isArray,Mve=Ove,Lve=typeof yr=="object"&&yr&&yr.Object===Object&&yr,Ive=Lve,$ve=Ive,Fve=typeof self=="object"&&self&&self.Object===Object&&self,jve=$ve||Fve||Function("return this")(),B1=jve,zve=B1,Bve=zve.Symbol,GL=Bve,hz=GL,BW=Object.prototype,Uve=BW.hasOwnProperty,Hve=BW.toString,gy=hz?hz.toStringTag:void 0;function Vve(t){var e=Uve.call(t,gy),n=t[gy];try{t[gy]=void 0;var r=!0}catch{}var s=Hve.call(t);return r&&(e?t[gy]=n:delete t[gy]),s}var Wve=Vve,Gve=Object.prototype,qve=Gve.toString;function Kve(t){return qve.call(t)}var Yve=Kve,pz=GL,Xve=Wve,Qve=Yve,Zve="[object Null]",Jve="[object Undefined]",mz=pz?pz.toStringTag:void 0;function eye(t){return t==null?t===void 0?Jve:Zve:mz&&mz in Object(t)?Xve(t):Qve(t)}var qL=eye;function tye(t){return t!=null&&typeof t=="object"}var UW=tye,nye=qL,rye=UW,sye="[object Symbol]";function iye(t){return typeof t=="symbol"||rye(t)&&nye(t)==sye}var oye=iye;function aye(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var p_=aye,lye=qL,cye=p_,uye="[object AsyncFunction]",dye="[object Function]",fye="[object GeneratorFunction]",hye="[object Proxy]";function pye(t){if(!cye(t))return!1;var e=lye(t);return e==dye||e==fye||e==uye||e==hye}var mye=pye,gye=B1,vye=gye["__core-js_shared__"],yye=vye,uT=yye,gz=function(){var t=/[^.]+$/.exec(uT&&uT.keys&&uT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function bye(t){return!!gz&&gz in t}var wye=bye,_ye=Function.prototype,xye=_ye.toString;function Sye(t){if(t!=null){try{return xye.call(t)}catch{}try{return t+""}catch{}}return""}var Eye=Sye,Cye=mye,Aye=wye,Rye=p_,Pye=Eye,Tye=/[\\^$.*+?()[\]{}|]/g,kye=/^\[object .+?Constructor\]$/,Dye=Function.prototype,Nye=Object.prototype,Oye=Dye.toString,Mye=Nye.hasOwnProperty,Lye=RegExp("^"+Oye.call(Mye).replace(Tye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Iye(t){if(!Rye(t)||Aye(t))return!1;var e=Cye(t)?Lye:kye;return e.test(Pye(t))}var $ye=Iye;function Fye(t,e){return t==null?void 0:t[e]}var jye=Fye,zye=$ye,Bye=jye;function Uye(t,e){var n=Bye(t,e);return zye(n)?n:void 0}var HW=Uye,Hye=HW,Vye=Hye(Object,"create"),U1=Vye,vz=U1;function Wye(){this.__data__=vz?vz(null):{},this.size=0}var Gye=Wye;function qye(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Kye=qye,Yye=U1,Xye="__lodash_hash_undefined__",Qye=Object.prototype,Zye=Qye.hasOwnProperty;function Jye(t){var e=this.__data__;if(Yye){var n=e[t];return n===Xye?void 0:n}return Zye.call(e,t)?e[t]:void 0}var ebe=Jye,tbe=U1,nbe=Object.prototype,rbe=nbe.hasOwnProperty;function sbe(t){var e=this.__data__;return tbe?e[t]!==void 0:rbe.call(e,t)}var ibe=sbe,obe=U1,abe="__lodash_hash_undefined__";function lbe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=obe&&e===void 0?abe:e,this}var cbe=lbe,ube=Gye,dbe=Kye,fbe=ebe,hbe=ibe,pbe=cbe;function xv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Nbe=Dbe,Obe=H1;function Mbe(t,e){var n=this.__data__,r=Obe(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var Lbe=Mbe,Ibe=vbe,$be=Abe,Fbe=Tbe,jbe=Nbe,zbe=Lbe;function Sv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e{var r;document.getElementById((r=t.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},Ope=H6,Mpe=V6,Lpe=W6,tW=G6,nW=q6,rW=Z6,sW=eW,iW=Y6,oW=Q6;const Vb=zo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),no=_.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const a=r?Ea:"button";return P.jsx(a,{className:ce(Vb({variant:e,size:n,className:t})),ref:i,...s})});no.displayName="Button";const aW=Ope,U4e=Mpe,Ipe=Lpe,lW=_.forwardRef(({className:t,...e},n)=>P.jsx(tW,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));lW.displayName=tW.displayName;const PL=_.forwardRef(({className:t,...e},n)=>P.jsxs(Ipe,{children:[P.jsx(lW,{}),P.jsx(nW,{ref:n,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));PL.displayName=nW.displayName;const TL=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col space-y-2 text-center sm:text-left",t),...e});TL.displayName="AlertDialogHeader";const kL=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});kL.displayName="AlertDialogFooter";const DL=_.forwardRef(({className:t,...e},n)=>P.jsx(iW,{ref:n,className:ce("text-lg font-semibold",t),...e}));DL.displayName=iW.displayName;const NL=_.forwardRef(({className:t,...e},n)=>P.jsx(oW,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));NL.displayName=oW.displayName;const OL=_.forwardRef(({className:t,...e},n)=>P.jsx(rW,{ref:n,className:ce(Vb(),t),...e}));OL.displayName=rW.displayName;const ML=_.forwardRef(({className:t,...e},n)=>P.jsx(sW,{ref:n,className:ce(Vb({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));ML.displayName=sW.displayName;const $pe=({textAreaRef:t,triggerAutoSize:e,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[s,i]=_.useState(!0);_.useEffect(()=>{if(t){s&&(t.style.minHeight=`${r+2}px`,n>r&&(t.style.maxHeight=`${n}px`),i(!1)),t.style.height=`${r+2}px`;const o=t.scrollHeight;o>n?t.style.height=`${n}px`:t.style.height=`${o+2}px`}},[t,e,s,n,r])},cW=_.forwardRef(({maxHeight:t=Number.MAX_SAFE_INTEGER,minHeight:e=52,className:n,onChange:r,value:s,...i},a)=>{const o=_.useRef(null),[c,u]=_.useState("");return $pe({textAreaRef:o.current,triggerAutoSize:c,maxHeight:t,minHeight:e}),_.useImperativeHandle(a,()=>({textArea:o.current,focus:()=>{var f;return(f=o.current)==null?void 0:f.focus()},maxHeight:t,minHeight:e})),_.useEffect(()=>{(s||i!=null&&i.defaultValue)&&u(s)},[s||(i==null?void 0:i.defaultValue)]),P.jsx("textarea",{...i,value:s,ref:o,className:ce("flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n),onChange:f=>{u(f.target.value),r==null||r(f)}})});cW.displayName="AutosizeTextarea";var LL="Avatar",[Fpe,H4e]=Pn(LL),[jpe,uW]=Fpe(LL),dW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,...r}=t,[s,i]=_.useState("idle");return P.jsx(jpe,{scope:n,imageLoadingStatus:s,onImageLoadingStatusChange:i,children:P.jsx(De.span,{...r,ref:e})})});dW.displayName=LL;var fW="AvatarImage",hW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:s=()=>{},...i}=t,a=uW(fW,n),o=zpe(r),c=Bt(u=>{s(u),a.onImageLoadingStatusChange(u)});return Mn(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?P.jsx(De.img,{...i,ref:e,src:r}):null});hW.displayName=fW;var pW="AvatarFallback",mW=_.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:r,...s}=t,i=uW(pW,n),[a,o]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(c)}},[r]),a&&i.imageLoadingStatus!=="loaded"?P.jsx(De.span,{...s,ref:e}):null});mW.displayName=pW;function zpe(t){const[e,n]=_.useState("idle");return Mn(()=>{if(!t){n("error");return}let r=!0;const s=new window.Image,i=a=>()=>{r&&n(a)};return n("loading"),s.onload=i("loaded"),s.onerror=i("error"),s.src=t,()=>{r=!1}},[t]),e}var gW=dW,vW=hW,yW=mW;const Bpe=_.forwardRef(({className:t,...e},n)=>P.jsx(gW,{ref:n,className:ce("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));Bpe.displayName=gW.displayName;const Upe=_.forwardRef(({className:t,...e},n)=>P.jsx(vW,{ref:n,className:ce("aspect-square h-full w-full",t),...e}));Upe.displayName=vW.displayName;const Hpe=_.forwardRef(({className:t,...e},n)=>P.jsx(yW,{ref:n,className:ce("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));Hpe.displayName=yW.displayName;const Vpe=zo("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Wpe({className:t,variant:e,...n}){return P.jsx("div",{className:ce(Vpe({variant:e}),t),...n})}const Gpe=_.forwardRef(({...t},e)=>P.jsx("nav",{ref:e,"aria-label":"breadcrumb",...t}));Gpe.displayName="Breadcrumb";const qpe=_.forwardRef(({className:t,...e},n)=>P.jsx("ol",{ref:n,className:ce("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",t),...e}));qpe.displayName="BreadcrumbList";const Kpe=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:ce("inline-flex items-center gap-1.5",t),...e}));Kpe.displayName="BreadcrumbItem";const Ype=_.forwardRef(({asChild:t,className:e,...n},r)=>{const s=t?Ea:"a";return P.jsx(s,{ref:r,className:ce("transition-colors hover:text-foreground",e),...n})});Ype.displayName="BreadcrumbLink";const Xpe=_.forwardRef(({className:t,...e},n)=>P.jsx("span",{ref:n,role:"link","aria-disabled":"true","aria-current":"page",className:ce("font-normal text-foreground",t),...e}));Xpe.displayName="BreadcrumbPage";function Kt(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function oo(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Vs(t,e){const n=Kt(t);return isNaN(e)?oo(t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Ca(t,e){const n=Kt(t);if(isNaN(e))return oo(t,NaN);if(!e)return n;const r=n.getDate(),s=oo(t,n.getTime());s.setMonth(n.getMonth()+e+1,0);const i=s.getDate();return r>=i?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}const IL=6048e5,Qpe=864e5;let Zpe={};function d_(){return Zpe}function bl(t,e){var o,c,u,f;const n=d_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i=s.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function iv(t){const e=Kt(t);return e.setHours(0,0,0,0),e}function eC(t){const e=Kt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function ul(t,e){const n=iv(t),r=iv(e),s=+n-eC(n),i=+r-eC(r);return Math.round((s-i)/Qpe)}function Jpe(t){const e=bW(t),n=oo(t,0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Vh(n)}function LD(t,e){const n=e*7;return Vs(t,n)}function eme(t,e){return Ca(t,e*12)}function tme(t){let e;return t.forEach(function(n){const r=Kt(n);(e===void 0||e{const r=Kt(n);(!e||e>r||isNaN(+r))&&(e=r)}),e||new Date(NaN)}function gi(t,e){const n=iv(t),r=iv(e);return+n==+r}function $L(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function rme(t){if(!$L(t)&&typeof t!="number")return!1;const e=Kt(t);return!isNaN(Number(e))}function Wb(t,e){const n=Kt(t),r=Kt(e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function sme(t,e,n){const r=bl(t,n),s=bl(e,n),i=+r-eC(r),a=+s-eC(s);return Math.round((i-a)/IL)}function FL(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Si(t){const e=Kt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function wW(t){const e=Kt(t),n=oo(t,0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}function jL(t,e){var o,c,u,f;const n=d_(),r=(e==null?void 0:e.weekStartsOn)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.weekStartsOn)??0,s=Kt(t),i=s.getDay(),a=(i{let r;const s=ime[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function sT(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const ame={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lme={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cme={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ume={date:sT({formats:ame,defaultWidth:"full"}),time:sT({formats:lme,defaultWidth:"full"}),dateTime:sT({formats:cme,defaultWidth:"full"})},dme={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},fme=(t,e,n,r)=>dme[t];function py(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,o=n!=null&&n.width?String(n.width):a;s=t.formattingValues[o]||t.formattingValues[a]}else{const a=t.defaultWidth,o=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[o]||t.values[a]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const hme={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},pme={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mme={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},gme={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},vme={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yme={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bme=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},wme={ordinalNumber:bme,era:py({values:hme,defaultWidth:"wide"}),quarter:py({values:pme,defaultWidth:"wide",argumentCallback:t=>t-1}),month:py({values:mme,defaultWidth:"wide"}),day:py({values:gme,defaultWidth:"wide"}),dayPeriod:py({values:vme,defaultWidth:"wide",formattingValues:yme,defaultFormattingWidth:"wide"})};function my(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const a=i[0],o=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(o)?xme(o,l=>l.test(a)):_me(o,l=>l.test(a));let u;u=t.valueCallback?t.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const f=e.slice(a.length);return{value:u,rest:f}}}function _me(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function xme(t,e){for(let n=0;n{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],i=e.match(t.parsePattern);if(!i)return null;let a=t.valueCallback?t.valueCallback(i[0]):i[0];a=n.valueCallback?n.valueCallback(a):a;const o=e.slice(s.length);return{value:a,rest:o}}}const Eme=/^(\d+)(th|st|nd|rd)?/i,Cme=/\d+/i,Ame={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Rme={any:[/^b/i,/^(a|c)/i]},Pme={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tme={any:[/1/i,/2/i,/3/i,/4/i]},kme={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Dme={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nme={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ome={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Mme={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Lme={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Ime={ordinalNumber:Sme({matchPattern:Eme,parsePattern:Cme,valueCallback:t=>parseInt(t,10)}),era:my({matchPatterns:Ame,defaultMatchWidth:"wide",parsePatterns:Rme,defaultParseWidth:"any"}),quarter:my({matchPatterns:Pme,defaultMatchWidth:"wide",parsePatterns:Tme,defaultParseWidth:"any",valueCallback:t=>t+1}),month:my({matchPatterns:kme,defaultMatchWidth:"wide",parsePatterns:Dme,defaultParseWidth:"any"}),day:my({matchPatterns:Nme,defaultMatchWidth:"wide",parsePatterns:Ome,defaultParseWidth:"any"}),dayPeriod:my({matchPatterns:Mme,defaultMatchWidth:"any",parsePatterns:Lme,defaultParseWidth:"any"})},xW={code:"en-US",formatDistance:ome,formatLong:ume,formatRelative:fme,localize:wme,match:Ime,options:{weekStartsOn:0,firstWeekContainsDate:1}};function $me(t){const e=Kt(t);return ul(e,wW(e))+1}function SW(t){const e=Kt(t),n=+Vh(e)-+Jpe(e);return Math.round(n/IL)+1}function EW(t,e){var f,l,d,m;const n=Kt(t),r=n.getFullYear(),s=d_(),i=(e==null?void 0:e.firstWeekContainsDate)??((l=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(d=s.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=oo(t,0);a.setFullYear(r+1,0,i),a.setHours(0,0,0,0);const o=bl(a,e),c=oo(t,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=bl(c,e);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function Fme(t,e){var o,c,u,f;const n=d_(),r=(e==null?void 0:e.firstWeekContainsDate)??((c=(o=e==null?void 0:e.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(u=n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,s=EW(t,e),i=oo(t,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),bl(i,e)}function CW(t,e){const n=Kt(t),r=+bl(n,e)-+Fme(n,e);return Math.round(r/IL)+1}function dn(t,e){const n=t<0?"-":"",r=Math.abs(t).toString().padStart(e,"0");return n+r}const hu={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return dn(e==="yy"?r%100:r,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):dn(n+1,2)},d(t,e){return dn(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return dn(t.getHours()%12||12,e.length)},H(t,e){return dn(t.getHours(),e.length)},m(t,e){return dn(t.getMinutes(),e.length)},s(t,e){return dn(t.getSeconds(),e.length)},S(t,e){const n=e.length,r=t.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return dn(s,e.length)}},$p={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},az={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const r=t.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return hu.y(t,e)},Y:function(t,e,n,r){const s=EW(t,r),i=s>0?s:1-s;if(e==="YY"){const a=i%100;return dn(a,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):dn(i,e.length)},R:function(t,e){const n=bW(t);return dn(n,e.length)},u:function(t,e){const n=t.getFullYear();return dn(n,e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return dn(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return dn(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return hu.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return dn(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const s=CW(t,r);return e==="wo"?n.ordinalNumber(s,{unit:"week"}):dn(s,e.length)},I:function(t,e,n){const r=SW(t);return e==="Io"?n.ordinalNumber(r,{unit:"week"}):dn(r,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):hu.d(t,e)},D:function(t,e,n){const r=$me(t);return e==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):dn(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return dn(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const s=t.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return dn(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),s=r===0?7:r;switch(e){case"i":return String(s);case"ii":return dn(s,e.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let s;switch(r===12?s=$p.noon:r===0?s=$p.midnight:s=r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let s;switch(r>=17?s=$p.evening:r>=12?s=$p.afternoon:r>=4?s=$p.morning:s=$p.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let r=t.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return hu.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):hu.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return e==="Ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},k:function(t,e,n){let r=t.getHours();return r===0&&(r=24),e==="ko"?n.ordinalNumber(r,{unit:"hour"}):dn(r,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):hu.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):hu.s(t,e)},S:function(t,e){return hu.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return cz(r);case"XXXX":case"XX":return uf(r);case"XXXXX":case"XXX":default:return uf(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return cz(r);case"xxxx":case"xx":return uf(r);case"xxxxx":case"xxx":default:return uf(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+lz(r,":");case"OOOO":default:return"GMT"+uf(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+lz(r,":");case"zzzz":default:return"GMT"+uf(r,":")}},t:function(t,e,n){const r=Math.trunc(t.getTime()/1e3);return dn(r,e.length)},T:function(t,e,n){const r=t.getTime();return dn(r,e.length)}};function lz(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+e+dn(i,2)}function cz(t,e){return t%60===0?(t>0?"-":"+")+dn(Math.abs(t)/60,2):uf(t,e)}function uf(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),s=dn(Math.trunc(r/60),2),i=dn(r%60,2);return n+s+e+i}const uz=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},AW=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},jme=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return uz(t,e);let i;switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",uz(r,e)).replace("{{time}}",AW(s,e))},zme={p:AW,P:jme},Bme=/^D+$/,Ume=/^Y+$/,Hme=["D","DD","YY","YYYY"];function Vme(t){return Bme.test(t)}function Wme(t){return Ume.test(t)}function Gme(t,e,n){const r=qme(t,e,n);if(console.warn(r),Hme.includes(t))throw new RangeError(r)}function qme(t,e,n){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Kme=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yme=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Xme=/^'([^]*?)'?$/,Qme=/''/g,Zme=/[a-zA-Z]/;function dp(t,e,n){var f,l,d,m,p,h,y,g;const r=d_(),s=(n==null?void 0:n.locale)??r.locale??xW,i=(n==null?void 0:n.firstWeekContainsDate)??((l=(f=n==null?void 0:n.locale)==null?void 0:f.options)==null?void 0:l.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(d=r.locale)==null?void 0:d.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((h=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((g=(y=r.locale)==null?void 0:y.options)==null?void 0:g.weekStartsOn)??0,o=Kt(t);if(!rme(o))throw new RangeError("Invalid time value");let c=e.match(Yme).map(v=>{const w=v[0];if(w==="p"||w==="P"){const x=zme[w];return x(v,s.formatLong)}return v}).join("").match(Kme).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const w=v[0];if(w==="'")return{isToken:!1,value:Jme(v)};if(az[w])return{isToken:!0,value:v};if(w.match(Zme))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(c=s.localize.preprocessor(o,c));const u={firstWeekContainsDate:i,weekStartsOn:a,locale:s};return c.map(v=>{if(!v.isToken)return v.value;const w=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Wme(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Vme(w))&&Gme(w,e,String(t));const x=az[w[0]];return x(o,w,s.localize,u)}).join("")}function Jme(t){const e=t.match(Xme);return e?e[1].replace(Qme,"'"):t}function ege(t){const e=Kt(t),n=e.getFullYear(),r=e.getMonth(),s=oo(t,0);return s.setFullYear(n,r+1,0),s.setHours(0,0,0,0),s.getDate()}function tge(t){return Math.trunc(+Kt(t)/1e3)}function nge(t){const e=Kt(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(0,0,0,0),e}function rge(t,e){return sme(nge(t),Si(t),e)+1}function ID(t,e){const n=Kt(t),r=Kt(e);return n.getTime()>r.getTime()}function RW(t,e){const n=Kt(t),r=Kt(e);return+n<+r}function zL(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function sge(t,e){const n=Kt(t),r=Kt(e);return n.getFullYear()===r.getFullYear()}function iT(t,e){return Vs(t,-e)}function oT(t,e){const n=Kt(t),r=n.getFullYear(),s=n.getDate(),i=oo(t,0);i.setFullYear(r,e,15),i.setHours(0,0,0,0);const a=ege(i);return n.setMonth(e,Math.min(s,a)),n}function dz(t,e){const n=Kt(t);return isNaN(+n)?oo(t,NaN):(n.setFullYear(e),n)}var dt=function(){return dt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1&&(c||!u),l=e>1&&(u||!c),d=function(){r&&i(r)},m=function(){s&&i(s)};return P.jsx($ge,{displayMonth:t.displayMonth,hideNext:f,hidePrevious:l,nextMonth:s,previousMonth:r,onPreviousClick:d,onNextClick:m})}function Fge(t){var e,n=Ln(),r=n.classNames,s=n.disableNavigation,i=n.styles,a=n.captionLayout,o=n.components,c=(e=o==null?void 0:o.CaptionLabel)!==null&&e!==void 0?e:kW,u;return s?u=P.jsx(c,{id:t.id,displayMonth:t.displayMonth}):a==="dropdown"?u=P.jsx(fz,{displayMonth:t.displayMonth,id:t.id}):a==="dropdown-buttons"?u=P.jsxs(P.Fragment,{children:[P.jsx(fz,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),P.jsx(hz,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):u=P.jsxs(P.Fragment,{children:[P.jsx(c,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(hz,{displayMonth:t.displayMonth,id:t.id})]}),P.jsx("div",{className:r.caption,style:i.caption,children:u})}function jge(t){var e=Ln(),n=e.footer,r=e.styles,s=e.classNames.tfoot;return n?P.jsx("tfoot",{className:s,style:r.tfoot,children:P.jsx("tr",{children:P.jsx("td",{colSpan:8,children:n})})}):P.jsx(P.Fragment,{})}function zge(t,e,n){for(var r=n?Vh(new Date):bl(new Date,{locale:t,weekStartsOn:e}),s=[],i=0;i<7;i++){var a=Vs(r,i);s.push(a)}return s}function Bge(){var t=Ln(),e=t.classNames,n=t.styles,r=t.showWeekNumber,s=t.locale,i=t.weekStartsOn,a=t.ISOWeek,o=t.formatters.formatWeekdayName,c=t.labels.labelWeekday,u=zge(s,i,a);return P.jsxs("tr",{style:n.head_row,className:e.head_row,children:[r&&P.jsx("td",{style:n.head_cell,className:e.head_cell}),u.map(function(f,l){return P.jsx("th",{scope:"col",className:e.head_cell,style:n.head_cell,"aria-label":c(f,{locale:s}),children:o(f,{locale:s})},l)})]})}function Uge(){var t,e=Ln(),n=e.classNames,r=e.styles,s=e.components,i=(t=s==null?void 0:s.HeadRow)!==null&&t!==void 0?t:Bge;return P.jsx("thead",{style:r.head,className:n.head,children:P.jsx(i,{})})}function Hge(t){var e=Ln(),n=e.locale,r=e.formatters.formatDay;return P.jsx(P.Fragment,{children:r(t.date,{locale:n})})}var BL=_.createContext(void 0);function Vge(t){if(!f_(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return P.jsx(BL.Provider,{value:e,children:t.children})}return P.jsx(Wge,{initialProps:t.initialProps,children:t.children})}function Wge(t){var e=t.initialProps,n=t.children,r=e.selected,s=e.min,i=e.max,a=function(u,f,l){var d,m;(d=e.onDayClick)===null||d===void 0||d.call(e,u,f,l);var p=!!(f.selected&&s&&(r==null?void 0:r.length)===s);if(!p){var h=!!(!f.selected&&i&&(r==null?void 0:r.length)===i);if(!h){var y=r?PW([],r):[];if(f.selected){var g=y.findIndex(function(v){return gi(u,v)});y.splice(g,1)}else y.push(u);(m=e.onSelect)===null||m===void 0||m.call(e,y,u,f,l)}}},o={disabled:[]};r&&o.disabled.push(function(u){var f=i&&r.length>i-1,l=r.some(function(d){return gi(d,u)});return!!(f&&!l)});var c={selected:r,onDayClick:a,modifiers:o};return P.jsx(BL.Provider,{value:c,children:n})}function UL(){var t=_.useContext(BL);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Gge(t,e){var n=e||{},r=n.from,s=n.to;return r&&s?gi(s,t)&&gi(r,t)?void 0:gi(s,t)?{from:s,to:void 0}:gi(r,t)?void 0:ID(r,t)?{from:t,to:s}:{from:r,to:t}:s?ID(t,s)?{from:s,to:t}:{from:t,to:s}:r?RW(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var HL=_.createContext(void 0);function qge(t){if(!h_(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return P.jsx(HL.Provider,{value:e,children:t.children})}return P.jsx(Kge,{initialProps:t.initialProps,children:t.children})}function Kge(t){var e=t.initialProps,n=t.children,r=e.selected,s=r||{},i=s.from,a=s.to,o=e.min,c=e.max,u=function(m,p,h){var y,g;(y=e.onDayClick)===null||y===void 0||y.call(e,m,p,h);var v=Gge(m,r);(g=e.onSelect)===null||g===void 0||g.call(e,v,m,p,h)},f={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(f.range_start=[i],a?(f.range_end=[a],gi(i,a)||(f.range_middle=[{after:i,before:a}])):f.range_end=[i]):a&&(f.range_start=[a],f.range_end=[a]),o&&(i&&!a&&f.disabled.push({after:iT(i,o-1),before:Vs(i,o-1)}),i&&a&&f.disabled.push({after:i,before:Vs(i,o-1)}),!i&&a&&f.disabled.push({after:iT(a,o-1),before:Vs(a,o-1)})),c){if(i&&!a&&(f.disabled.push({before:Vs(i,-c+1)}),f.disabled.push({after:Vs(i,c-1)})),i&&a){var l=ul(a,i)+1,d=c-l;f.disabled.push({before:iT(i,d)}),f.disabled.push({after:Vs(a,d)})}!i&&a&&(f.disabled.push({before:Vs(a,-c+1)}),f.disabled.push({after:Vs(a,c-1)}))}return P.jsx(HL.Provider,{value:{selected:r,onDayClick:u,modifiers:f},children:n})}function VL(){var t=_.useContext(HL);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function BS(t){return Array.isArray(t)?PW([],t):t!==void 0?[t]:[]}function Yge(t){var e={};return Object.entries(t).forEach(function(n){var r=n[0],s=n[1];e[r]=BS(s)}),e}var Aa;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(Aa||(Aa={}));var Xge=Aa.Selected,Bl=Aa.Disabled,Qge=Aa.Hidden,Zge=Aa.Today,aT=Aa.RangeEnd,lT=Aa.RangeMiddle,cT=Aa.RangeStart,Jge=Aa.Outside;function eve(t,e,n){var r,s=(r={},r[Xge]=BS(t.selected),r[Bl]=BS(t.disabled),r[Qge]=BS(t.hidden),r[Zge]=[t.today],r[aT]=[],r[lT]=[],r[cT]=[],r[Jge]=[],r);return t.fromDate&&s[Bl].push({before:t.fromDate}),t.toDate&&s[Bl].push({after:t.toDate}),f_(t)?s[Bl]=s[Bl].concat(e.modifiers[Bl]):h_(t)&&(s[Bl]=s[Bl].concat(n.modifiers[Bl]),s[cT]=n.modifiers[cT],s[lT]=n.modifiers[lT],s[aT]=n.modifiers[aT]),s}var OW=_.createContext(void 0);function tve(t){var e=Ln(),n=UL(),r=VL(),s=eve(e,n,r),i=Yge(e.modifiers),a=dt(dt({},s),i);return P.jsx(OW.Provider,{value:a,children:t.children})}function MW(){var t=_.useContext(OW);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function nve(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function rve(t){return!!(t&&typeof t=="object"&&"from"in t)}function sve(t){return!!(t&&typeof t=="object"&&"after"in t)}function ive(t){return!!(t&&typeof t=="object"&&"before"in t)}function ove(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function ave(t,e){var n,r=e.from,s=e.to;if(r&&s){var i=ul(s,r)<0;i&&(n=[s,r],r=n[0],s=n[1]);var a=ul(t,r)>=0&&ul(s,t)>=0;return a}return s?gi(s,t):r?gi(r,t):!1}function lve(t){return $L(t)}function cve(t){return Array.isArray(t)&&t.every($L)}function uve(t,e){return e.some(function(n){if(typeof n=="boolean")return n;if(lve(n))return gi(t,n);if(cve(n))return n.includes(t);if(rve(n))return ave(t,n);if(ove(n))return n.dayOfWeek.includes(t.getDay());if(nve(n)){var r=ul(n.before,t),s=ul(n.after,t),i=r>0,a=s<0,o=ID(n.before,n.after);return o?a&&i:i||a}return sve(n)?ul(t,n.after)>0:ive(n)?ul(n.before,t)>0:typeof n=="function"?n(t):!1})}function WL(t,e,n){var r=Object.keys(e).reduce(function(i,a){var o=e[a];return uve(t,o)&&i.push(a),i},[]),s={};return r.forEach(function(i){return s[i]=!0}),n&&!zL(t,n)&&(s.outside=!0),s}function dve(t,e){for(var n=Si(t[0]),r=FL(t[t.length-1]),s,i,a=n;a<=r;){var o=WL(a,e),c=!o.disabled&&!o.hidden;if(!c){a=Vs(a,1);continue}if(o.selected)return a;o.today&&!i&&(i=a),s||(s=a),a=Vs(a,1)}return i||s}var fve=365;function LW(t,e){var n=e.moveBy,r=e.direction,s=e.context,i=e.modifiers,a=e.retry,o=a===void 0?{count:0,lastFocused:t}:a,c=s.weekStartsOn,u=s.fromDate,f=s.toDate,l=s.locale,d={day:Vs,week:LD,month:Ca,year:eme,startOfWeek:function(y){return s.ISOWeek?Vh(y):bl(y,{locale:l,weekStartsOn:c})},endOfWeek:function(y){return s.ISOWeek?_W(y):jL(y,{locale:l,weekStartsOn:c})}},m=d[n](t,r==="after"?1:-1);r==="before"&&u?m=tme([u,m]):r==="after"&&f&&(m=nme([f,m]));var p=!0;if(i){var h=WL(m,i);p=!h.disabled&&!h.hidden}return p?m:o.count>fve?o.lastFocused:LW(m,{moveBy:n,direction:r,context:s,modifiers:i,retry:dt(dt({},o),{count:o.count+1})})}var IW=_.createContext(void 0);function hve(t){var e=p_(),n=MW(),r=_.useState(),s=r[0],i=r[1],a=_.useState(),o=a[0],c=a[1],u=dve(e.displayMonths,n),f=s??(o&&e.isDateDisplayed(o))?o:u,l=function(){c(s),i(void 0)},d=function(y){i(y)},m=Ln(),p=function(y,g){if(s){var v=LW(s,{moveBy:y,direction:g,context:m,modifiers:n});gi(s,v)||(e.goToDate(v,s),d(v))}},h={focusedDay:s,focusTarget:f,blur:l,focus:d,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return P.jsx(IW.Provider,{value:h,children:t.children})}function GL(){var t=_.useContext(IW);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function pve(t,e){var n=MW(),r=WL(t,n,e);return r}var qL=_.createContext(void 0);function mve(t){if(!B1(t.initialProps)){var e={selected:void 0};return P.jsx(qL.Provider,{value:e,children:t.children})}return P.jsx(gve,{initialProps:t.initialProps,children:t.children})}function gve(t){var e=t.initialProps,n=t.children,r=function(i,a,o){var c,u,f;if((c=e.onDayClick)===null||c===void 0||c.call(e,i,a,o),a.selected&&!e.required){(u=e.onSelect)===null||u===void 0||u.call(e,void 0,i,a,o);return}(f=e.onSelect)===null||f===void 0||f.call(e,i,i,a,o)},s={selected:e.selected,onDayClick:r};return P.jsx(qL.Provider,{value:s,children:n})}function $W(){var t=_.useContext(qL);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function vve(t,e){var n=Ln(),r=$W(),s=UL(),i=VL(),a=GL(),o=a.focusDayAfter,c=a.focusDayBefore,u=a.focusWeekAfter,f=a.focusWeekBefore,l=a.blur,d=a.focus,m=a.focusMonthBefore,p=a.focusMonthAfter,h=a.focusYearBefore,y=a.focusYearAfter,g=a.focusStartOfWeek,v=a.focusEndOfWeek,w=function(V){var H,ee,re,X;B1(n)?(H=r.onDayClick)===null||H===void 0||H.call(r,t,e,V):f_(n)?(ee=s.onDayClick)===null||ee===void 0||ee.call(s,t,e,V):h_(n)?(re=i.onDayClick)===null||re===void 0||re.call(i,t,e,V):(X=n.onDayClick)===null||X===void 0||X.call(n,t,e,V)},x=function(V){var H;d(t),(H=n.onDayFocus)===null||H===void 0||H.call(n,t,e,V)},A=function(V){var H;l(),(H=n.onDayBlur)===null||H===void 0||H.call(n,t,e,V)},k=function(V){var H;(H=n.onDayMouseEnter)===null||H===void 0||H.call(n,t,e,V)},R=function(V){var H;(H=n.onDayMouseLeave)===null||H===void 0||H.call(n,t,e,V)},E=function(V){var H;(H=n.onDayPointerEnter)===null||H===void 0||H.call(n,t,e,V)},T=function(V){var H;(H=n.onDayPointerLeave)===null||H===void 0||H.call(n,t,e,V)},D=function(V){var H;(H=n.onDayTouchCancel)===null||H===void 0||H.call(n,t,e,V)},O=function(V){var H;(H=n.onDayTouchEnd)===null||H===void 0||H.call(n,t,e,V)},L=function(V){var H;(H=n.onDayTouchMove)===null||H===void 0||H.call(n,t,e,V)},I=function(V){var H;(H=n.onDayTouchStart)===null||H===void 0||H.call(n,t,e,V)},F=function(V){var H;(H=n.onDayKeyUp)===null||H===void 0||H.call(n,t,e,V)},U=function(V){var H;switch(V.key){case"ArrowLeft":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?o():c();break;case"ArrowRight":V.preventDefault(),V.stopPropagation(),n.dir==="rtl"?c():o();break;case"ArrowDown":V.preventDefault(),V.stopPropagation(),u();break;case"ArrowUp":V.preventDefault(),V.stopPropagation(),f();break;case"PageUp":V.preventDefault(),V.stopPropagation(),V.shiftKey?h():m();break;case"PageDown":V.preventDefault(),V.stopPropagation(),V.shiftKey?y():p();break;case"Home":V.preventDefault(),V.stopPropagation(),g();break;case"End":V.preventDefault(),V.stopPropagation(),v();break}(H=n.onDayKeyDown)===null||H===void 0||H.call(n,t,e,V)},Y={onClick:w,onFocus:x,onBlur:A,onKeyDown:U,onKeyUp:F,onMouseEnter:k,onMouseLeave:R,onPointerEnter:E,onPointerLeave:T,onTouchCancel:D,onTouchEnd:O,onTouchMove:L,onTouchStart:I};return Y}function yve(){var t=Ln(),e=$W(),n=UL(),r=VL(),s=B1(t)?e.selected:f_(t)?n.selected:h_(t)?r.selected:void 0;return s}function bve(t){return Object.values(Aa).includes(t)}function wve(t,e){var n=[t.classNames.day];return Object.keys(e).forEach(function(r){var s=t.modifiersClassNames[r];if(s)n.push(s);else if(bve(r)){var i=t.classNames["day_".concat(r)];i&&n.push(i)}}),n}function _ve(t,e){var n=dt({},t.styles.day);return Object.keys(e).forEach(function(r){var s;n=dt(dt({},n),(s=t.modifiersStyles)===null||s===void 0?void 0:s[r])}),n}function xve(t,e,n){var r,s,i,a=Ln(),o=GL(),c=pve(t,e),u=vve(t,c),f=yve(),l=!!(a.onDayClick||a.mode!=="default");_.useEffect(function(){var k;c.outside||o.focusedDay&&l&&gi(o.focusedDay,t)&&((k=n.current)===null||k===void 0||k.focus())},[o.focusedDay,t,n,l,c.outside]);var d=wve(a,c).join(" "),m=_ve(a,c),p=!!(c.outside&&!a.showOutsideDays||c.hidden),h=(i=(s=a.components)===null||s===void 0?void 0:s.DayContent)!==null&&i!==void 0?i:Hge,y=P.jsx(h,{date:t,displayMonth:e,activeModifiers:c}),g={style:m,className:d,children:y,role:"gridcell"},v=o.focusTarget&&gi(o.focusTarget,t)&&!c.outside,w=o.focusedDay&&gi(o.focusedDay,t),x=dt(dt(dt({},g),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=w||v?0:-1,r)),u),A={isButton:l,isHidden:p,activeModifiers:c,selectedDays:f,buttonProps:x,divProps:g};return A}function Sve(t){var e=_.useRef(null),n=xve(t.date,t.displayMonth,e);return n.isHidden?P.jsx("div",{role:"gridcell"}):n.isButton?P.jsx(tC,dt({name:"day",ref:e},n.buttonProps)):P.jsx("div",dt({},n.divProps))}function Eve(t){var e=t.number,n=t.dates,r=Ln(),s=r.onWeekNumberClick,i=r.styles,a=r.classNames,o=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,f=u(Number(e),{locale:o});if(!s)return P.jsx("span",{className:a.weeknumber,style:i.weeknumber,children:f});var l=c(Number(e),{locale:o}),d=function(m){s(e,n,m)};return P.jsx(tC,{name:"week-number","aria-label":l,className:a.weeknumber,style:i.weeknumber,onClick:d,children:f})}function Cve(t){var e,n,r=Ln(),s=r.styles,i=r.classNames,a=r.showWeekNumber,o=r.components,c=(e=o==null?void 0:o.Day)!==null&&e!==void 0?e:Sve,u=(n=o==null?void 0:o.WeekNumber)!==null&&n!==void 0?n:Eve,f;return a&&(f=P.jsx("td",{className:i.cell,style:s.cell,children:P.jsx(u,{number:t.weekNumber,dates:t.dates})})),P.jsxs("tr",{className:i.row,style:s.row,children:[f,t.dates.map(function(l){return P.jsx("td",{className:i.cell,style:s.cell,role:"presentation",children:P.jsx(c,{displayMonth:t.displayMonth,date:l})},tge(l))})]})}function pz(t,e,n){for(var r=n!=null&&n.ISOWeek?_W(e):jL(e,n),s=n!=null&&n.ISOWeek?Vh(t):bl(t,n),i=ul(r,s),a=[],o=0;o<=i;o++)a.push(Vs(s,o));var c=a.reduce(function(u,f){var l=n!=null&&n.ISOWeek?SW(f):CW(f,n),d=u.find(function(m){return m.weekNumber===l});return d?(d.dates.push(f),u):(u.push({weekNumber:l,dates:[f]}),u)},[]);return c}function Ave(t,e){var n=pz(Si(t),FL(t),e);if(e!=null&&e.useFixedWeeks){var r=rge(t,e);if(r<6){var s=n[n.length-1],i=s.dates[s.dates.length-1],a=LD(i,6-r),o=pz(LD(i,1),a,e);n.push.apply(n,o)}}return n}function Rve(t){var e,n,r,s=Ln(),i=s.locale,a=s.classNames,o=s.styles,c=s.hideHead,u=s.fixedWeeks,f=s.components,l=s.weekStartsOn,d=s.firstWeekContainsDate,m=s.ISOWeek,p=Ave(t.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:i,weekStartsOn:l,firstWeekContainsDate:d}),h=(e=f==null?void 0:f.Head)!==null&&e!==void 0?e:Uge,y=(n=f==null?void 0:f.Row)!==null&&n!==void 0?n:Cve,g=(r=f==null?void 0:f.Footer)!==null&&r!==void 0?r:jge;return P.jsxs("table",{id:t.id,className:a.table,style:o.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!c&&P.jsx(h,{}),P.jsx("tbody",{className:a.tbody,style:o.tbody,children:p.map(function(v){return P.jsx(y,{displayMonth:t.displayMonth,dates:v.dates,weekNumber:v.weekNumber},v.weekNumber)})}),P.jsx(g,{displayMonth:t.displayMonth})]})}function Pve(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Tve=Pve()?_.useLayoutEffect:_.useEffect,uT=!1,kve=0;function mz(){return"react-day-picker-".concat(++kve)}function Dve(t){var e,n=t??(uT?mz():null),r=_.useState(n),s=r[0],i=r[1];return Tve(function(){s===null&&i(mz())},[]),_.useEffect(function(){uT===!1&&(uT=!0)},[]),(e=t??s)!==null&&e!==void 0?e:void 0}function Nve(t){var e,n,r=Ln(),s=r.dir,i=r.classNames,a=r.styles,o=r.components,c=p_().displayMonths,u=Dve(r.id?"".concat(r.id,"-").concat(t.displayIndex):void 0),f=r.id?"".concat(r.id,"-grid-").concat(t.displayIndex):void 0,l=[i.month],d=a.month,m=t.displayIndex===0,p=t.displayIndex===c.length-1,h=!m&&!p;s==="rtl"&&(e=[m,p],p=e[0],m=e[1]),m&&(l.push(i.caption_start),d=dt(dt({},d),a.caption_start)),p&&(l.push(i.caption_end),d=dt(dt({},d),a.caption_end)),h&&(l.push(i.caption_between),d=dt(dt({},d),a.caption_between));var y=(n=o==null?void 0:o.Caption)!==null&&n!==void 0?n:Fge;return P.jsxs("div",{className:l.join(" "),style:d,children:[P.jsx(y,{id:u,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),P.jsx(Rve,{id:f,"aria-labelledby":u,displayMonth:t.displayMonth})]},t.displayIndex)}function Ove(t){var e=Ln(),n=e.classNames,r=e.styles;return P.jsx("div",{className:n.months,style:r.months,children:t.children})}function Mve(t){var e,n,r=t.initialProps,s=Ln(),i=GL(),a=p_(),o=_.useState(!1),c=o[0],u=o[1];_.useEffect(function(){s.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!0)))},[s.initialFocus,c,i.focus,i.focusTarget,i]);var f=[s.classNames.root,s.className];s.numberOfMonths>1&&f.push(s.classNames.multiple_months),s.showWeekNumber&&f.push(s.classNames.with_weeknumber);var l=dt(dt({},s.styles.root),s.style),d=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,h){var y;return dt(dt({},p),(y={},y[h]=r[h],y))},{}),m=(n=(e=r.components)===null||e===void 0?void 0:e.Months)!==null&&n!==void 0?n:Ove;return P.jsx("div",dt({className:f.join(" "),style:l,dir:s.dir,id:s.id,nonce:r.nonce,title:r.title,lang:r.lang},d,{children:P.jsx(m,{children:a.displayMonths.map(function(p,h){return P.jsx(Nve,{displayIndex:h,displayMonth:p},h)})})}))}function Lve(t){var e=t.children,n=ige(t,["children"]);return P.jsx(Ege,{initialProps:n,children:P.jsx(Mge,{children:P.jsx(mve,{initialProps:n,children:P.jsx(Vge,{initialProps:n,children:P.jsx(qge,{initialProps:n,children:P.jsx(tve,{children:P.jsx(hve,{children:e})})})})})})})}function Ive(t){return P.jsx(Lve,dt({},t,{children:P.jsx(Mve,{initialProps:t})}))}function FW({className:t,classNames:e,showOutsideDays:n=!0,...r}){return P.jsx(Ive,{showOutsideDays:n,className:ce("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:ce(Vb({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:ce(Vb({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:()=>P.jsx(hL,{className:"w-4 h-4"}),IconRight:()=>P.jsx(r_,{className:"w-4 h-4"})},...r})}FW.displayName="Calendar";const jW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("rounded-md border bg-card text-card-foreground shadow",t),...e}));jW.displayName="Card";const zW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex flex-col space-y-1.5 p-6",t),...e}));zW.displayName="CardHeader";const BW=_.forwardRef(({className:t,...e},n)=>P.jsx("h3",{ref:n,className:ce("font-semibold leading-none tracking-tight",t),...e}));BW.displayName="CardTitle";const UW=_.forwardRef(({className:t,...e},n)=>P.jsx("p",{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));UW.displayName="CardDescription";const HW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("p-6 pt-0",t),...e}));HW.displayName="CardContent";const VW=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex items-center p-6 pt-0",t),...e}));VW.displayName="CardFooter";var $ve=Array.isArray,Fve=$ve,jve=typeof yr=="object"&&yr&&yr.Object===Object&&yr,zve=jve,Bve=zve,Uve=typeof self=="object"&&self&&self.Object===Object&&self,Hve=Bve||Uve||Function("return this")(),U1=Hve,Vve=U1,Wve=Vve.Symbol,KL=Wve,gz=KL,WW=Object.prototype,Gve=WW.hasOwnProperty,qve=WW.toString,gy=gz?gz.toStringTag:void 0;function Kve(t){var e=Gve.call(t,gy),n=t[gy];try{t[gy]=void 0;var r=!0}catch{}var s=qve.call(t);return r&&(e?t[gy]=n:delete t[gy]),s}var Yve=Kve,Xve=Object.prototype,Qve=Xve.toString;function Zve(t){return Qve.call(t)}var Jve=Zve,vz=KL,eye=Yve,tye=Jve,nye="[object Null]",rye="[object Undefined]",yz=vz?vz.toStringTag:void 0;function sye(t){return t==null?t===void 0?rye:nye:yz&&yz in Object(t)?eye(t):tye(t)}var YL=sye;function iye(t){return t!=null&&typeof t=="object"}var GW=iye,oye=YL,aye=GW,lye="[object Symbol]";function cye(t){return typeof t=="symbol"||aye(t)&&oye(t)==lye}var uye=cye;function dye(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var m_=dye,fye=YL,hye=m_,pye="[object AsyncFunction]",mye="[object Function]",gye="[object GeneratorFunction]",vye="[object Proxy]";function yye(t){if(!hye(t))return!1;var e=fye(t);return e==mye||e==gye||e==pye||e==vye}var bye=yye,wye=U1,_ye=wye["__core-js_shared__"],xye=_ye,dT=xye,bz=function(){var t=/[^.]+$/.exec(dT&&dT.keys&&dT.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Sye(t){return!!bz&&bz in t}var Eye=Sye,Cye=Function.prototype,Aye=Cye.toString;function Rye(t){if(t!=null){try{return Aye.call(t)}catch{}try{return t+""}catch{}}return""}var Pye=Rye,Tye=bye,kye=Eye,Dye=m_,Nye=Pye,Oye=/[\\^$.*+?()[\]{}|]/g,Mye=/^\[object .+?Constructor\]$/,Lye=Function.prototype,Iye=Object.prototype,$ye=Lye.toString,Fye=Iye.hasOwnProperty,jye=RegExp("^"+$ye.call(Fye).replace(Oye,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zye(t){if(!Dye(t)||kye(t))return!1;var e=Tye(t)?jye:Mye;return e.test(Nye(t))}var Bye=zye;function Uye(t,e){return t==null?void 0:t[e]}var Hye=Uye,Vye=Bye,Wye=Hye;function Gye(t,e){var n=Wye(t,e);return Vye(n)?n:void 0}var qW=Gye,qye=qW,Kye=qye(Object,"create"),H1=Kye,wz=H1;function Yye(){this.__data__=wz?wz(null):{},this.size=0}var Xye=Yye;function Qye(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Zye=Qye,Jye=H1,ebe="__lodash_hash_undefined__",tbe=Object.prototype,nbe=tbe.hasOwnProperty;function rbe(t){var e=this.__data__;if(Jye){var n=e[t];return n===ebe?void 0:n}return nbe.call(e,t)?e[t]:void 0}var sbe=rbe,ibe=H1,obe=Object.prototype,abe=obe.hasOwnProperty;function lbe(t){var e=this.__data__;return ibe?e[t]!==void 0:abe.call(e,t)}var cbe=lbe,ube=H1,dbe="__lodash_hash_undefined__";function fbe(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=ube&&e===void 0?dbe:e,this}var hbe=fbe,pbe=Xye,mbe=Zye,gbe=sbe,vbe=cbe,ybe=hbe;function xv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e-1}var Ibe=Lbe,$be=V1;function Fbe(t,e){var n=this.__data__,r=$be(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var jbe=Fbe,zbe=_be,Bbe=kbe,Ube=Obe,Hbe=Ibe,Vbe=jbe;function Sv(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e2?r-2:0),i=2;i=e||R<0||l&&E>=i}function g(){var k=fT();if(y(k))return v(k);o=setTimeout(g,h(k))}function v(k){return o=void 0,d&&r?m(k):(r=s=void 0,a)}function w(){o!==void 0&&clearTimeout(o),u=0,r=c=s=o=void 0}function x(){return o===void 0?a:v(fT())}function A(){var k=fT(),R=y(k);if(r=arguments,s=this,c=k,R){if(o===void 0)return p(c);if(l)return clearTimeout(o),o=setTimeout(g,e),m(c)}return o===void 0&&(o=setTimeout(g,e)),a}return A.cancel=w,A.flush=x,A}var owe=iwe,awe=owe,lwe=p_,cwe="Expected a function";function uwe(t,e,n){var r=!0,s=!0;if(typeof t!="function")throw new TypeError(cwe);return lwe(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),awe(t,e,{leading:r,maxWait:e,trailing:s})}var dwe=uwe;const fwe=Dd(dwe);function Gb(t){"@babel/helpers - typeof";return Gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gb(t)}function Ez(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function tS(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(I=fwe(I,h,{trailing:!0,leading:!1}));var F=new ResizeObserver(I),U=A.current.getBoundingClientRect(),Y=U.width,V=U.height;return O(Y,V),F.observe(A.current),function(){F.disconnect()}},[O,h]);var L=_.useMemo(function(){var I=T.containerWidth,F=T.containerHeight;if(I<0||F<0)return null;dT(eS(a)||eS(c),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,a,c),dT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=eS(a)?I:a,Y=eS(c)?F:c;n&&n>0&&(U?Y=U/n:Y&&(U=Y*n),d&&Y>d&&(Y=d)),dT(U>0||Y>0,`The width(%s) and height(%s) of chart should be greater than 0, + */var QL=Symbol.for("react.element"),ZL=Symbol.for("react.portal"),G1=Symbol.for("react.fragment"),q1=Symbol.for("react.strict_mode"),K1=Symbol.for("react.profiler"),Y1=Symbol.for("react.provider"),X1=Symbol.for("react.context"),F0e=Symbol.for("react.server_context"),Q1=Symbol.for("react.forward_ref"),Z1=Symbol.for("react.suspense"),J1=Symbol.for("react.suspense_list"),eA=Symbol.for("react.memo"),tA=Symbol.for("react.lazy"),j0e=Symbol.for("react.offscreen"),YW;YW=Symbol.for("react.module.reference");function Bo(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case QL:switch(t=t.type,t){case G1:case K1:case q1:case Z1:case J1:return t;default:switch(t=t&&t.$$typeof,t){case F0e:case X1:case Q1:case tA:case eA:case Y1:return t;default:return e}}case ZL:return e}}}xn.ContextConsumer=X1;xn.ContextProvider=Y1;xn.Element=QL;xn.ForwardRef=Q1;xn.Fragment=G1;xn.Lazy=tA;xn.Memo=eA;xn.Portal=ZL;xn.Profiler=K1;xn.StrictMode=q1;xn.Suspense=Z1;xn.SuspenseList=J1;xn.isAsyncMode=function(){return!1};xn.isConcurrentMode=function(){return!1};xn.isContextConsumer=function(t){return Bo(t)===X1};xn.isContextProvider=function(t){return Bo(t)===Y1};xn.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===QL};xn.isForwardRef=function(t){return Bo(t)===Q1};xn.isFragment=function(t){return Bo(t)===G1};xn.isLazy=function(t){return Bo(t)===tA};xn.isMemo=function(t){return Bo(t)===eA};xn.isPortal=function(t){return Bo(t)===ZL};xn.isProfiler=function(t){return Bo(t)===K1};xn.isStrictMode=function(t){return Bo(t)===q1};xn.isSuspense=function(t){return Bo(t)===Z1};xn.isSuspenseList=function(t){return Bo(t)===J1};xn.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===G1||t===K1||t===q1||t===Z1||t===J1||t===j0e||typeof t=="object"&&t!==null&&(t.$$typeof===tA||t.$$typeof===eA||t.$$typeof===Y1||t.$$typeof===X1||t.$$typeof===Q1||t.$$typeof===YW||t.getModuleId!==void 0)};xn.typeOf=Bo;var tS=function(e){return $0e(e)&&e.indexOf("%")===e.length-1},z0e=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},fT=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i=e||R<0||l&&E>=i}function g(){var k=hT();if(y(k))return v(k);o=setTimeout(g,h(k))}function v(k){return o=void 0,d&&r?m(k):(r=s=void 0,a)}function w(){o!==void 0&&clearTimeout(o),u=0,r=c=s=o=void 0}function x(){return o===void 0?a:v(hT())}function A(){var k=hT(),R=y(k);if(r=arguments,s=this,c=k,R){if(o===void 0)return p(c);if(l)return clearTimeout(o),o=setTimeout(g,e),m(c)}return o===void 0&&(o=setTimeout(g,e)),a}return A.cancel=w,A.flush=x,A}var uwe=cwe,dwe=uwe,fwe=m_,hwe="Expected a function";function pwe(t,e,n){var r=!0,s=!0;if(typeof t!="function")throw new TypeError(hwe);return fwe(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),dwe(t,e,{leading:r,maxWait:e,trailing:s})}var mwe=pwe;const gwe=Dd(mwe);function Gb(t){"@babel/helpers - typeof";return Gb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gb(t)}function Rz(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function nS(t){for(var e=1;et.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&(I=gwe(I,h,{trailing:!0,leading:!1}));var F=new ResizeObserver(I),U=A.current.getBoundingClientRect(),Y=U.width,V=U.height;return O(Y,V),F.observe(A.current),function(){F.disconnect()}},[O,h]);var L=_.useMemo(function(){var I=T.containerWidth,F=T.containerHeight;if(I<0||F<0)return null;fT(tS(a)||tS(c),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,a,c),fT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var U=tS(a)?I:a,Y=tS(c)?F:c;n&&n>0&&(U?Y=U/n:Y&&(U=Y*n),d&&Y>d&&(Y=d)),fT(U>0||Y>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,U,Y,a,c,f,l,n);var V=!Array.isArray(m)&&I0e(m.type).endsWith("Chart");return se.Children.map(m,function(H){return se.isValidElement(H)?_.cloneElement(H,tS({width:U,height:Y},V?{style:tS({height:"100%",width:"100%",maxHeight:Y,maxWidth:U},H.props.style)}:{})):H})},[n,m,c,d,l,f,T,a]);return se.createElement("div",{id:y?"".concat(y):void 0,className:cp("recharts-responsive-container",g),style:tS(tS({},x),{},{width:a,height:c,minWidth:f,minHeight:l,maxHeight:d}),ref:A},L)}),xwe="Invariant failed";function An(t,e){if(!t)throw new Error(xwe)}const Swe={light:"",dark:".dark"},GW=_.createContext(null);function qW(){const t=_.useContext(GW);if(!t)throw new Error("useChart must be used within a ");return t}const Ewe=_.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=_.useId(),o=`chart-${t||a.replace(/:/g,"")}`;return P.jsx(GW.Provider,{value:{config:r},children:P.jsxs("div",{"data-chart":o,ref:i,className:ce("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[P.jsx(Cwe,{id:o,config:r}),P.jsx(_we,{children:n})]})})});Ewe.displayName="Chart";const Cwe=({id:t,config:e})=>{const n=Object.entries(e).filter(([r,s])=>s.theme||s.color);return n.length?P.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Swe).map(([r,s])=>` + height and width.`,U,Y,a,c,f,l,n);var V=!Array.isArray(m)&&z0e(m.type).endsWith("Chart");return se.Children.map(m,function(H){return se.isValidElement(H)?_.cloneElement(H,nS({width:U,height:Y},V?{style:nS({height:"100%",width:"100%",maxHeight:Y,maxWidth:U},H.props.style)}:{})):H})},[n,m,c,d,l,f,T,a]);return se.createElement("div",{id:y?"".concat(y):void 0,className:up("recharts-responsive-container",g),style:nS(nS({},x),{},{width:a,height:c,minWidth:f,minHeight:l,maxHeight:d}),ref:A},L)}),Awe="Invariant failed";function An(t,e){if(!t)throw new Error(Awe)}const Rwe={light:"",dark:".dark"},XW=_.createContext(null);function QW(){const t=_.useContext(XW);if(!t)throw new Error("useChart must be used within a ");return t}const Pwe=_.forwardRef(({id:t,className:e,children:n,config:r,...s},i)=>{const a=_.useId(),o=`chart-${t||a.replace(/:/g,"")}`;return P.jsx(XW.Provider,{value:{config:r},children:P.jsxs("div",{"data-chart":o,ref:i,className:ce("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",e),...s,children:[P.jsx(Twe,{id:o,config:r}),P.jsx(Cwe,{children:n})]})})});Pwe.displayName="Chart";const Twe=({id:t,config:e})=>{const n=Object.entries(e).filter(([r,s])=>s.theme||s.color);return n.length?P.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Rwe).map(([r,s])=>` ${s} [data-chart=${t}] { ${n.map(([i,a])=>{var c;const o=((c=a.theme)==null?void 0:c[r])||a.color;return o?` --color-${i}: ${o};`:null}).join(` `)} } `).join(` -`)}}):null},Awe=_.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:o,labelClassName:c,formatter:u,color:f,nameKey:l,labelKey:d},m)=>{const{config:p}=qW(),h=_.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${d||g.dataKey||g.name||"value"}`,w=ID(p,g,v),x=!d&&typeof a=="string"?((A=p[a])==null?void 0:A.label)||a:w==null?void 0:w.label;return o?P.jsx("div",{className:ce("font-medium",c),children:o(x,e)}):x?P.jsx("div",{className:ce("font-medium",c),children:x}):null},[a,o,e,s,c,p,d]);if(!t||!(e!=null&&e.length))return null;const y=e.length===1&&r!=="dot";return P.jsxs("div",{ref:m,className:ce("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[y?null:h,P.jsx("div",{className:"grid gap-1.5",children:e.map((g,v)=>{const w=`${l||g.name||g.dataKey||"value"}`,x=ID(p,g,w),A=f||g.payload.fill||g.color;return P.jsx("div",{className:ce("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:u&&(g==null?void 0:g.value)!==void 0&&g.name?u(g.value,g.name,g,v,g.payload):P.jsxs(P.Fragment,{children:[x!=null&&x.icon?P.jsx(x.icon,{}):!i&&P.jsx("div",{className:ce("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":y&&r==="dashed"}),style:{"--color-bg":A,"--color-border":A}}),P.jsxs("div",{className:ce("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[P.jsxs("div",{className:"grid gap-1.5",children:[y?h:null,P.jsx("span",{className:"text-muted-foreground",children:(x==null?void 0:x.label)||g.name})]}),g.value&&P.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})});Awe.displayName="ChartTooltip";const Rwe=_.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=qW();return n!=null&&n.length?P.jsx("div",{ref:i,className:ce("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.map(o=>{const c=`${s||o.dataKey||"value"}`,u=ID(a,o,c);return P.jsxs("div",{className:ce("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!e?P.jsx(u.icon,{}):P.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),u==null?void 0:u.label]},o.value)})}):null});Rwe.displayName="ChartLegend";function ID(t,e,n){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}function Cv(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function m_(t){const[e,n]=_.useState(void 0);return Mn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,o;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;n({width:a,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var QL="Checkbox",[Pwe,$4e]=Pn(QL),[Twe,kwe]=Pwe(QL),KW=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=sr({prop:s,defaultProp:i,onChange:u}),v=_.useRef(y);return _.useEffect(()=>{const w=l==null?void 0:l.form;if(w){const x=()=>g(v.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[l,g]),P.jsxs(Twe,{scope:n,state:y,disabled:o,children:[P.jsx(De.button,{type:"button",role:"checkbox","aria-checked":Dh(y)?"mixed":y,"aria-required":a,"data-state":QW(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onKeyDown:me(t.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:me(t.onClick,w=>{g(x=>Dh(x)?!0:!x),h&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),h&&P.jsx(Dwe,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});KW.displayName=QL;var YW="CheckboxIndicator",XW=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=kwe(YW,n);return P.jsx(Un,{present:r||Dh(i.state)||i.state===!0,children:P.jsx(De.span,{"data-state":QW(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});XW.displayName=YW;var Dwe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Cv(n),o=m_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});c.indeterminate=Dh(n),l.call(c,Dh(n)?!1:n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Dh(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Dh(t){return t==="indeterminate"}function QW(t){return Dh(t)?"indeterminate":t?"checked":"unchecked"}var ZW=KW,Nwe=XW;const Owe=_.forwardRef(({className:t,...e},n)=>P.jsx(ZW,{ref:n,className:ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:P.jsx(Nwe,{className:ce("flex items-center justify-center text-current"),children:P.jsx(t_,{className:"h-4 w-4"})})}));Owe.displayName=ZW.displayName;var Az=1,Mwe=.9,Lwe=.8,Iwe=.17,hT=.1,pT=.999,$we=.9999,Fwe=.99,jwe=/[\\\/_+.#"@\[\(\{&]/,zwe=/[\\\/_+.#"@\[\(\{&]/g,Bwe=/[\s-]/,JW=/[\s-]/g;function $D(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?Az:Fwe;var o=`${s},${i}`;if(a[o]!==void 0)return a[o];for(var c=r.charAt(i),u=n.indexOf(c,s),f=0,l,d,m,p;u>=0;)l=$D(t,e,n,r,u+1,i+1,a),l>f&&(u===s?l*=Az:jwe.test(t.charAt(u-1))?(l*=Lwe,m=t.slice(s,u-1).match(zwe),m&&s>0&&(l*=Math.pow(pT,m.length))):Bwe.test(t.charAt(u-1))?(l*=Mwe,p=t.slice(s,u-1).match(JW),p&&s>0&&(l*=Math.pow(pT,p.length))):(l*=Iwe,s>0&&(l*=Math.pow(pT,u-s))),t.charAt(u)!==e.charAt(i)&&(l*=$we)),(ll&&(l=d*hT)),l>f&&(f=l),u=n.indexOf(c,u+1);return a[o]=f,f}function Rz(t){return t.toLowerCase().replace(JW," ")}function Uwe(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,$D(t,e,Rz(t),Rz(e),0,0,{})}function bd(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Pz(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Vh(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Pz(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function Vwe(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,Wwe(s,...e)]}function Wwe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}const tC=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},Gwe=Kw.useId||(()=>{});let qwe=0;function kc(t){const[e,n]=_.useState(Gwe());return tC(()=>{n(r=>r??String(qwe++))},[t]),e?`radix-${e}`:""}function Wh(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Kwe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Ywe({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Wh(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function Ywe({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=Wh(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var ZL=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(Qwe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(FD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(FD,{...r,ref:e,children:n})});ZL.displayName="Slot";var FD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=Jwe(n),i=Zwe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?Vh(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});FD.displayName="SlotClone";var Xwe=({children:t})=>P.jsx(P.Fragment,{children:t});function Qwe(t){return _.isValidElement(t)&&t.type===Xwe}function Zwe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function Jwe(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var e_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fs=e_e.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?ZL:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function t_e(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}function n_e(t,e=globalThis==null?void 0:globalThis.document){const n=Wh(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}var r_e="DismissableLayer",jD="dismissableLayer.update",s_e="dismissableLayer.pointerDownOutside",i_e="dismissableLayer.focusOutside",Tz,e8=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),t8=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(e8),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=dp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=l_e(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=c_e(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return n_e(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Tz=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),kz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Tz)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),kz())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(jD,R),()=>document.removeEventListener(jD,R)},[]),P.jsx(fs.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:bd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:bd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:bd(t.onPointerDownCapture,A.onPointerDownCapture)})});t8.displayName=r_e;var o_e="DismissableLayerBranch",a_e=_.forwardRef((t,e)=>{const n=_.useContext(e8),r=_.useRef(null),s=dp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(fs.div,{...t,ref:s})});a_e.displayName=o_e;function l_e(t,e=globalThis==null?void 0:globalThis.document){const n=Wh(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){n8(s_e,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function c_e(t,e=globalThis==null?void 0:globalThis.document){const n=Wh(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&n8(i_e,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kz(){const t=new CustomEvent(jD);document.dispatchEvent(t)}function n8(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?t_e(s,i):s.dispatchEvent(i)}var mT="focusScope.autoFocusOnMount",gT="focusScope.autoFocusOnUnmount",Dz={bubbles:!1,cancelable:!0},u_e="FocusScope",r8=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Wh(s),f=Wh(i),l=_.useRef(null),d=dp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:vu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||vu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&vu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){Oz.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(mT,Dz);o.addEventListener(mT,u),o.dispatchEvent(g),g.defaultPrevented||(d_e(g_e(s8(o)),{select:!0}),document.activeElement===h&&vu(o))}return()=>{o.removeEventListener(mT,u),setTimeout(()=>{const g=new CustomEvent(gT,Dz);o.addEventListener(gT,f),o.dispatchEvent(g),g.defaultPrevented||vu(h??document.body,{select:!0}),o.removeEventListener(gT,f),Oz.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=f_e(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&vu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&vu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(fs.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});r8.displayName=u_e;function d_e(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(vu(r,{select:e}),document.activeElement!==n)return}function f_e(t){const e=s8(t),n=Nz(e,t),r=Nz(e.reverse(),t);return[n,r]}function s8(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Nz(t,e){for(const n of t)if(!h_e(n,{upTo:e}))return n}function h_e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function p_e(t){return t instanceof HTMLInputElement&&"select"in t}function vu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&p_e(t)&&e&&t.select()}}var Oz=m_e();function m_e(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Mz(t,e),t.unshift(e)},remove(e){var n;t=Mz(t,e),(n=t[0])==null||n.resume()}}}function Mz(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function g_e(t){return t.filter(e=>e.tagName!=="A")}var v_e="Portal",i8=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);tC(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?Jw.createPortal(P.jsx(fs.div,{...r,ref:e}),a):null});i8.displayName=v_e;function y_e(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var tA=t=>{const{present:e,children:n}=t,r=b_e(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=dp(r.ref,w_e(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};tA.displayName="Presence";function b_e(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=y_e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=nS(r.current);i.current=o==="mounted"?u:"none"},[o]),tC(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=nS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),tC(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=nS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=nS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function nS(t){return(t==null?void 0:t.animationName)||"none"}function w_e(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var vT=0;function __e(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Lz()),document.body.insertAdjacentElement("beforeend",t[1]??Lz()),vT++,()=>{vT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),vT--}},[])}function Lz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var o8=gL(),yT=function(){},nA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:yT,onWheelCapture:yT,onTouchMoveCapture:yT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=$1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=mL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:o8,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});nA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nA.classNames={fullWidth:Om,zeroRight:Nm};var zD=!1;if(typeof window<"u")try{var rS=Object.defineProperty({},"passive",{get:function(){return zD=!0,!0}});window.addEventListener("test",rS,rS),window.removeEventListener("test",rS,rS)}catch{zD=!1}var $p=zD?{passive:!1}:!1,x_e=function(t){return t.tagName==="TEXTAREA"},a8=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!x_e(t)&&n[e]==="visible")},S_e=function(t){return a8(t,"overflowY")},E_e=function(t){return a8(t,"overflowX")},Iz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=l8(t,r);if(s){var i=c8(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},C_e=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},A_e=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},l8=function(t,e){return t==="v"?S_e(e):E_e(e)},c8=function(t,e){return t==="v"?C_e(e):A_e(e)},R_e=function(t,e){return t==="h"&&e==="rtl"?-1:1},P_e=function(t,e,n,r,s){var i=R_e(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=c8(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&l8(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},sS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},$z=function(t){return[t.deltaX,t.deltaY]},Fz=function(t){return t&&"current"in t?t.current:t},T_e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},k_e=function(t){return` +`)}}):null},kwe=_.forwardRef(({active:t,payload:e,className:n,indicator:r="dot",hideLabel:s=!1,hideIndicator:i=!1,label:a,labelFormatter:o,labelClassName:c,formatter:u,color:f,nameKey:l,labelKey:d},m)=>{const{config:p}=QW(),h=_.useMemo(()=>{var A;if(s||!(e!=null&&e.length))return null;const[g]=e,v=`${d||g.dataKey||g.name||"value"}`,w=$D(p,g,v),x=!d&&typeof a=="string"?((A=p[a])==null?void 0:A.label)||a:w==null?void 0:w.label;return o?P.jsx("div",{className:ce("font-medium",c),children:o(x,e)}):x?P.jsx("div",{className:ce("font-medium",c),children:x}):null},[a,o,e,s,c,p,d]);if(!t||!(e!=null&&e.length))return null;const y=e.length===1&&r!=="dot";return P.jsxs("div",{ref:m,className:ce("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[y?null:h,P.jsx("div",{className:"grid gap-1.5",children:e.map((g,v)=>{const w=`${l||g.name||g.dataKey||"value"}`,x=$D(p,g,w),A=f||g.payload.fill||g.color;return P.jsx("div",{className:ce("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:u&&(g==null?void 0:g.value)!==void 0&&g.name?u(g.value,g.name,g,v,g.payload):P.jsxs(P.Fragment,{children:[x!=null&&x.icon?P.jsx(x.icon,{}):!i&&P.jsx("div",{className:ce("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":y&&r==="dashed"}),style:{"--color-bg":A,"--color-border":A}}),P.jsxs("div",{className:ce("flex flex-1 justify-between leading-none",y?"items-end":"items-center"),children:[P.jsxs("div",{className:"grid gap-1.5",children:[y?h:null,P.jsx("span",{className:"text-muted-foreground",children:(x==null?void 0:x.label)||g.name})]}),g.value&&P.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:g.value.toLocaleString()})]})]})},g.dataKey)})})]})});kwe.displayName="ChartTooltip";const Dwe=_.forwardRef(({className:t,hideIcon:e=!1,payload:n,verticalAlign:r="bottom",nameKey:s},i)=>{const{config:a}=QW();return n!=null&&n.length?P.jsx("div",{ref:i,className:ce("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",t),children:n.map(o=>{const c=`${s||o.dataKey||"value"}`,u=$D(a,o,c);return P.jsxs("div",{className:ce("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[u!=null&&u.icon&&!e?P.jsx(u.icon,{}):P.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:o.color}}),u==null?void 0:u.label]},o.value)})}):null});Dwe.displayName="ChartLegend";function $D(t,e,n){if(typeof e!="object"||e===null)return;const r="payload"in e&&typeof e.payload=="object"&&e.payload!==null?e.payload:void 0;let s=n;return n in e&&typeof e[n]=="string"?s=e[n]:r&&n in r&&typeof r[n]=="string"&&(s=r[n]),s in t?t[s]:t[n]}function Cv(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function g_(t){const[e,n]=_.useState(void 0);return Mn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,o;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,o=u.blockSize}else a=t.offsetWidth,o=t.offsetHeight;n({width:a,height:o})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var JL="Checkbox",[Nwe,V4e]=Pn(JL),[Owe,Mwe]=Nwe(JL),ZW=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=sr({prop:s,defaultProp:i,onChange:u}),v=_.useRef(y);return _.useEffect(()=>{const w=l==null?void 0:l.form;if(w){const x=()=>g(v.current);return w.addEventListener("reset",x),()=>w.removeEventListener("reset",x)}},[l,g]),P.jsxs(Owe,{scope:n,state:y,disabled:o,children:[P.jsx(De.button,{type:"button",role:"checkbox","aria-checked":Nh(y)?"mixed":y,"aria-required":a,"data-state":t8(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onKeyDown:me(t.onKeyDown,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:me(t.onClick,w=>{g(x=>Nh(x)?!0:!x),h&&(p.current=w.isPropagationStopped(),p.current||w.stopPropagation())})}),h&&P.jsx(Lwe,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});ZW.displayName=JL;var JW="CheckboxIndicator",e8=_.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=Mwe(JW,n);return P.jsx(Un,{present:r||Nh(i.state)||i.state===!0,children:P.jsx(De.span,{"data-state":t8(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});e8.displayName=JW;var Lwe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Cv(n),o=g_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});c.indeterminate=Nh(n),l.call(c,Nh(n)?!1:n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Nh(n)?!1:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Nh(t){return t==="indeterminate"}function t8(t){return Nh(t)?"indeterminate":t?"checked":"unchecked"}var n8=ZW,Iwe=e8;const $we=_.forwardRef(({className:t,...e},n)=>P.jsx(n8,{ref:n,className:ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:P.jsx(Iwe,{className:ce("flex items-center justify-center text-current"),children:P.jsx(n_,{className:"h-4 w-4"})})}));$we.displayName=n8.displayName;var Tz=1,Fwe=.9,jwe=.8,zwe=.17,pT=.1,mT=.999,Bwe=.9999,Uwe=.99,Hwe=/[\\\/_+.#"@\[\(\{&]/,Vwe=/[\\\/_+.#"@\[\(\{&]/g,Wwe=/[\s-]/,r8=/[\s-]/g;function FD(t,e,n,r,s,i,a){if(i===e.length)return s===t.length?Tz:Uwe;var o=`${s},${i}`;if(a[o]!==void 0)return a[o];for(var c=r.charAt(i),u=n.indexOf(c,s),f=0,l,d,m,p;u>=0;)l=FD(t,e,n,r,u+1,i+1,a),l>f&&(u===s?l*=Tz:Hwe.test(t.charAt(u-1))?(l*=jwe,m=t.slice(s,u-1).match(Vwe),m&&s>0&&(l*=Math.pow(mT,m.length))):Wwe.test(t.charAt(u-1))?(l*=Fwe,p=t.slice(s,u-1).match(r8),p&&s>0&&(l*=Math.pow(mT,p.length))):(l*=zwe,s>0&&(l*=Math.pow(mT,u-s))),t.charAt(u)!==e.charAt(i)&&(l*=Bwe)),(ll&&(l=d*pT)),l>f&&(f=l),u=n.indexOf(c,u+1);return a[o]=f,f}function kz(t){return t.toLowerCase().replace(r8," ")}function Gwe(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,FD(t,e,kz(t),kz(e),0,0,{})}function bd(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Dz(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Wh(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Dz(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function Kwe(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,Ywe(s,...e)]}function Ywe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}const nC=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},Xwe=Yw.useId||(()=>{});let Qwe=0;function Dc(t){const[e,n]=_.useState(Xwe());return nC(()=>{n(r=>r??String(Qwe++))},[t]),e?`radix-${e}`:""}function Gh(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...n)=>{var r;return(r=e.current)===null||r===void 0?void 0:r.call(e,...n)},[])}function Zwe({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=Jwe({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Gh(n),c=_.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function Jwe({defaultProp:t,onChange:e}){const n=_.useState(t),[r]=n,s=_.useRef(r),i=Gh(e);return _.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var eI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(t_e);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(jD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(jD,{...r,ref:e,children:n})});eI.displayName="Slot";var jD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=r_e(n),i=n_e(r,n.props);return n.type!==_.Fragment&&(i.ref=e?Wh(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});jD.displayName="SlotClone";var e_e=({children:t})=>P.jsx(P.Fragment,{children:t});function t_e(t){return _.isValidElement(t)&&t.type===e_e}function n_e(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function r_e(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var s_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fs=s_e.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?eI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function i_e(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}function o_e(t,e=globalThis==null?void 0:globalThis.document){const n=Gh(t);_.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r),()=>e.removeEventListener("keydown",r)},[n,e])}var a_e="DismissableLayer",zD="dismissableLayer.update",l_e="dismissableLayer.pointerDownOutside",c_e="dismissableLayer.focusOutside",Nz,s8=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),i8=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(s8),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=fp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=f_e(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=h_e(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return o_e(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Nz=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Oz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Nz)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Oz())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(zD,R),()=>document.removeEventListener(zD,R)},[]),P.jsx(fs.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:bd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:bd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:bd(t.onPointerDownCapture,A.onPointerDownCapture)})});i8.displayName=a_e;var u_e="DismissableLayerBranch",d_e=_.forwardRef((t,e)=>{const n=_.useContext(s8),r=_.useRef(null),s=fp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(fs.div,{...t,ref:s})});d_e.displayName=u_e;function f_e(t,e=globalThis==null?void 0:globalThis.document){const n=Gh(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){o8(l_e,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function h_e(t,e=globalThis==null?void 0:globalThis.document){const n=Gh(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&o8(c_e,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Oz(){const t=new CustomEvent(zD);document.dispatchEvent(t)}function o8(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?i_e(s,i):s.dispatchEvent(i)}var gT="focusScope.autoFocusOnMount",vT="focusScope.autoFocusOnUnmount",Mz={bubbles:!1,cancelable:!0},p_e="FocusScope",a8=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Gh(s),f=Gh(i),l=_.useRef(null),d=fp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:vu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||vu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&vu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){Iz.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(gT,Mz);o.addEventListener(gT,u),o.dispatchEvent(g),g.defaultPrevented||(m_e(w_e(l8(o)),{select:!0}),document.activeElement===h&&vu(o))}return()=>{o.removeEventListener(gT,u),setTimeout(()=>{const g=new CustomEvent(vT,Mz);o.addEventListener(vT,f),o.dispatchEvent(g),g.defaultPrevented||vu(h??document.body,{select:!0}),o.removeEventListener(vT,f),Iz.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=g_e(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&vu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&vu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(fs.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});a8.displayName=p_e;function m_e(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(vu(r,{select:e}),document.activeElement!==n)return}function g_e(t){const e=l8(t),n=Lz(e,t),r=Lz(e.reverse(),t);return[n,r]}function l8(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Lz(t,e){for(const n of t)if(!v_e(n,{upTo:e}))return n}function v_e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function y_e(t){return t instanceof HTMLInputElement&&"select"in t}function vu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&y_e(t)&&e&&t.select()}}var Iz=b_e();function b_e(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=$z(t,e),t.unshift(e)},remove(e){var n;t=$z(t,e),(n=t[0])==null||n.resume()}}}function $z(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function w_e(t){return t.filter(e=>e.tagName!=="A")}var __e="Portal",c8=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);nC(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?e_.createPortal(P.jsx(fs.div,{...r,ref:e}),a):null});c8.displayName=__e;function x_e(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var nA=t=>{const{present:e,children:n}=t,r=S_e(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=fp(r.ref,E_e(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};nA.displayName="Presence";function S_e(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=x_e(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=rS(r.current);i.current=o==="mounted"?u:"none"},[o]),nC(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=rS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),nC(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=rS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=rS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function rS(t){return(t==null?void 0:t.animationName)||"none"}function E_e(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var yT=0;function C_e(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Fz()),document.body.insertAdjacentElement("beforeend",t[1]??Fz()),yT++,()=>{yT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),yT--}},[])}function Fz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var u8=yL(),bT=function(){},rA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:bT,onWheelCapture:bT,onTouchMoveCapture:bT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=F1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=vL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:u8,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});rA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rA.classNames={fullWidth:Om,zeroRight:Nm};var BD=!1;if(typeof window<"u")try{var sS=Object.defineProperty({},"passive",{get:function(){return BD=!0,!0}});window.addEventListener("test",sS,sS),window.removeEventListener("test",sS,sS)}catch{BD=!1}var Fp=BD?{passive:!1}:!1,A_e=function(t){return t.tagName==="TEXTAREA"},d8=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!A_e(t)&&n[e]==="visible")},R_e=function(t){return d8(t,"overflowY")},P_e=function(t){return d8(t,"overflowX")},jz=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=f8(t,r);if(s){var i=h8(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},T_e=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},k_e=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},f8=function(t,e){return t==="v"?R_e(e):P_e(e)},h8=function(t,e){return t==="v"?T_e(e):k_e(e)},D_e=function(t,e){return t==="h"&&e==="rtl"?-1:1},N_e=function(t,e,n,r,s){var i=D_e(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=h8(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&f8(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},iS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},zz=function(t){return[t.deltaX,t.deltaY]},Bz=function(t){return t&&"current"in t?t.current:t},O_e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},M_e=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},D_e=0,Fp=[];function N_e(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(D_e++)[0],i=_.useState(j1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=pL([t.lockRef.current],(t.shards||[]).map(Fz),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=sS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=Iz(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=Iz(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return P_e(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Fp.length||Fp[Fp.length-1]!==i)){var g="deltaY"in y?$z(y):sS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&T_e(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(Fz).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:O_e(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=sS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,$z(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,sS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Fp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,$p),document.addEventListener("touchmove",c,$p),document.addEventListener("touchstart",f,$p),function(){Fp=Fp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,$p),document.removeEventListener("touchmove",c,$p),document.removeEventListener("touchstart",f,$p)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:k_e(s)}):null,m?_.createElement(yL,{gapMode:t.gapMode}):null)}function O_e(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const M_e=vL(o8,N_e);var u8=_.forwardRef(function(t,e){return _.createElement(nA,fr({},t,{ref:e,sideCar:M_e}))});u8.classNames=nA.classNames;var JL="Dialog",[d8,F4e]=Vwe(JL),[L_e,Da]=d8(JL),f8=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=Kwe({prop:r,defaultProp:s,onChange:i});return P.jsx(L_e,{scope:e,triggerRef:o,contentRef:c,contentId:kc(),titleId:kc(),descriptionId:kc(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};f8.displayName=JL;var h8="DialogTrigger",I_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(h8,n),i=dp(e,s.triggerRef);return P.jsx(fs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":nI(s.open),...r,ref:i,onClick:bd(t.onClick,s.onOpenToggle)})});I_e.displayName=h8;var eI="DialogPortal",[$_e,p8]=d8(eI,{forceMount:void 0}),m8=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Da(eI,e);return P.jsx($_e,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(tA,{present:n||i.open,children:P.jsx(i8,{asChild:!0,container:s,children:a})}))})};m8.displayName=eI;var nC="DialogOverlay",g8=_.forwardRef((t,e)=>{const n=p8(nC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Da(nC,t.__scopeDialog);return i.modal?P.jsx(tA,{present:r||i.open,children:P.jsx(F_e,{...s,ref:e})}):null});g8.displayName=nC;var F_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(nC,n);return P.jsx(u8,{as:ZL,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(fs.div,{"data-state":nI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Gh="DialogContent",v8=_.forwardRef((t,e)=>{const n=p8(Gh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Da(Gh,t.__scopeDialog);return P.jsx(tA,{present:r||i.open,children:i.modal?P.jsx(j_e,{...s,ref:e}):P.jsx(z_e,{...s,ref:e})})});v8.displayName=Gh;var j_e=_.forwardRef((t,e)=>{const n=Da(Gh,t.__scopeDialog),r=_.useRef(null),s=dp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(y8,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:bd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:bd(t.onFocusOutside,i=>i.preventDefault())})}),z_e=_.forwardRef((t,e)=>{const n=Da(Gh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(y8,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),y8=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Da(Gh,n),c=_.useRef(null),u=dp(e,c);return __e(),P.jsxs(P.Fragment,{children:[P.jsx(r8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(t8,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":nI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(V_e,{titleId:o.titleId}),P.jsx(G_e,{contentRef:c,descriptionId:o.descriptionId})]})]})}),tI="DialogTitle",B_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(tI,n);return P.jsx(fs.h2,{id:s.titleId,...r,ref:e})});B_e.displayName=tI;var b8="DialogDescription",U_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(b8,n);return P.jsx(fs.p,{id:s.descriptionId,...r,ref:e})});U_e.displayName=b8;var w8="DialogClose",H_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Da(w8,n);return P.jsx(fs.button,{type:"button",...r,ref:e,onClick:bd(t.onClick,()=>s.onOpenChange(!1))})});H_e.displayName=w8;function nI(t){return t?"open":"closed"}var _8="DialogTitleWarning",[j4e,x8]=Hwe(_8,{contentName:Gh,titleName:tI,docsSlug:"dialog"}),V_e=({titleId:t})=>{const e=x8(_8),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},L_e=0,jp=[];function I_e(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(L_e++)[0],i=_.useState(z1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=gL([t.lockRef.current],(t.shards||[]).map(Bz),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=iS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=jz(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=jz(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return N_e(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!jp.length||jp[jp.length-1]!==i)){var g="deltaY"in y?zz(y):iS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&O_e(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(Bz).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:$_e(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=iS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,zz(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,iS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return jp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Fp),document.addEventListener("touchmove",c,Fp),document.addEventListener("touchstart",f,Fp),function(){jp=jp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,Fp),document.removeEventListener("touchmove",c,Fp),document.removeEventListener("touchstart",f,Fp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:M_e(s)}):null,m?_.createElement(wL,{gapMode:t.gapMode}):null)}function $_e(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const F_e=bL(u8,I_e);var p8=_.forwardRef(function(t,e){return _.createElement(rA,fr({},t,{ref:e,sideCar:F_e}))});p8.classNames=rA.classNames;var tI="Dialog",[m8,W4e]=Kwe(tI),[j_e,Na]=m8(tI),g8=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=Zwe({prop:r,defaultProp:s,onChange:i});return P.jsx(j_e,{scope:e,triggerRef:o,contentRef:c,contentId:Dc(),titleId:Dc(),descriptionId:Dc(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};g8.displayName=tI;var v8="DialogTrigger",z_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(v8,n),i=fp(e,s.triggerRef);return P.jsx(fs.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":sI(s.open),...r,ref:i,onClick:bd(t.onClick,s.onOpenToggle)})});z_e.displayName=v8;var nI="DialogPortal",[B_e,y8]=m8(nI,{forceMount:void 0}),b8=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Na(nI,e);return P.jsx(B_e,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(nA,{present:n||i.open,children:P.jsx(c8,{asChild:!0,container:s,children:a})}))})};b8.displayName=nI;var rC="DialogOverlay",w8=_.forwardRef((t,e)=>{const n=y8(rC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Na(rC,t.__scopeDialog);return i.modal?P.jsx(nA,{present:r||i.open,children:P.jsx(U_e,{...s,ref:e})}):null});w8.displayName=rC;var U_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(rC,n);return P.jsx(p8,{as:eI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(fs.div,{"data-state":sI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),qh="DialogContent",_8=_.forwardRef((t,e)=>{const n=y8(qh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Na(qh,t.__scopeDialog);return P.jsx(nA,{present:r||i.open,children:i.modal?P.jsx(H_e,{...s,ref:e}):P.jsx(V_e,{...s,ref:e})})});_8.displayName=qh;var H_e=_.forwardRef((t,e)=>{const n=Na(qh,t.__scopeDialog),r=_.useRef(null),s=fp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(x8,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:bd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:bd(t.onFocusOutside,i=>i.preventDefault())})}),V_e=_.forwardRef((t,e)=>{const n=Na(qh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(x8,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),x8=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Na(qh,n),c=_.useRef(null),u=fp(e,c);return C_e(),P.jsxs(P.Fragment,{children:[P.jsx(a8,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(i8,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":sI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(K_e,{titleId:o.titleId}),P.jsx(X_e,{contentRef:c,descriptionId:o.descriptionId})]})]})}),rI="DialogTitle",W_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(rI,n);return P.jsx(fs.h2,{id:s.titleId,...r,ref:e})});W_e.displayName=rI;var S8="DialogDescription",G_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(S8,n);return P.jsx(fs.p,{id:s.descriptionId,...r,ref:e})});G_e.displayName=S8;var E8="DialogClose",q_e=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(E8,n);return P.jsx(fs.button,{type:"button",...r,ref:e,onClick:bd(t.onClick,()=>s.onOpenChange(!1))})});q_e.displayName=E8;function sI(t){return t?"open":"closed"}var C8="DialogTitleWarning",[G4e,A8]=qwe(C8,{contentName:qh,titleName:rI,docsSlug:"dialog"}),K_e=({titleId:t})=>{const e=A8(C8),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},W_e="DialogDescriptionWarning",G_e=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${x8(W_e).contentName}}.`;return _.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},q_e=f8,K_e=m8,Y_e=g8,X_e=v8,vy='[cmdk-group=""]',bT='[cmdk-group-items=""]',Q_e='[cmdk-group-heading=""]',S8='[cmdk-item=""]',jz=`${S8}:not([aria-disabled="true"])`,BD="cmdk-item-select",Qp="data-value",Z_e=(t,e,n)=>Uwe(t,e,n),E8=_.createContext(void 0),g_=()=>_.useContext(E8),C8=_.createContext(void 0),rI=()=>_.useContext(C8),A8=_.createContext(void 0),R8=_.forwardRef((t,e)=>{let n=Zp(()=>{var q,K;return{search:"",value:(K=(q=t.value)!=null?q:t.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Zp(()=>new Set),s=Zp(()=>new Map),i=Zp(()=>new Map),a=Zp(()=>new Set),o=P8(t),{label:c,children:u,value:f,onValueChange:l,filter:d,shouldFilter:m,loop:p,disablePointerSelection:h=!1,vimBindings:y=!0,...g}=t,v=kc(),w=kc(),x=kc(),A=_.useRef(null),k=cxe();qh(()=>{if(f!==void 0){let q=f.trim();n.current.value=q,R.emit()}},[f]),qh(()=>{k(6,I)},[]);let R=_.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>n.current,setState:(q,K,Z)=>{var ue,de,ie,be;if(!Object.is(n.current[q],K)){if(n.current[q]=K,q==="search")L(),D(),k(1,O);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(x);Ae?Ae.focus():(ue=document.getElementById(v))==null||ue.focus()}if(k(7,()=>{var Ae;n.current.selectedItemId=(Ae=F())==null?void 0:Ae.id,R.emit()}),Z||k(5,I),((de=o.current)==null?void 0:de.value)!==void 0){let Ae=K??"";(be=(ie=o.current).onValueChange)==null||be.call(ie,Ae);return}}R.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),E=_.useMemo(()=>({value:(q,K,Z)=>{var ue;K!==((ue=i.current.get(q))==null?void 0:ue.value)&&(i.current.set(q,{value:K,keywords:Z}),n.current.filtered.items.set(q,T(K,Z)),k(2,()=>{D(),R.emit()}))},item:(q,K)=>(r.current.add(q),K&&(s.current.has(K)?s.current.get(K).add(q):s.current.set(K,new Set([q]))),k(3,()=>{L(),D(),n.current.value||O(),R.emit()}),()=>{i.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let Z=F();k(4,()=>{L(),(Z==null?void 0:Z.getAttribute("id"))===q&&O(),R.emit()})}),group:q=>(s.current.has(q)||s.current.set(q,new Set),()=>{i.current.delete(q),s.current.delete(q)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:x,labelId:w,listInnerRef:A}),[]);function T(q,K){var Z,ue;let de=(ue=(Z=o.current)==null?void 0:Z.filter)!=null?ue:Z_e;return q?de(q,n.current.search,K):0}function D(){if(!n.current.search||o.current.shouldFilter===!1)return;let q=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(ue=>{let de=s.current.get(ue),ie=0;de.forEach(be=>{let Ae=q.get(be);ie=Math.max(Ae,ie)}),K.push([ue,ie])});let Z=A.current;U().sort((ue,de)=>{var ie,be;let Ae=ue.getAttribute("id"),_e=de.getAttribute("id");return((ie=q.get(_e))!=null?ie:0)-((be=q.get(Ae))!=null?be:0)}).forEach(ue=>{let de=ue.closest(bT);de?de.appendChild(ue.parentElement===de?ue:ue.closest(`${bT} > *`)):Z.appendChild(ue.parentElement===Z?ue:ue.closest(`${bT} > *`))}),K.sort((ue,de)=>de[1]-ue[1]).forEach(ue=>{var de;let ie=(de=A.current)==null?void 0:de.querySelector(`${vy}[${Qp}="${encodeURIComponent(ue[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function O(){let q=U().find(Z=>Z.getAttribute("aria-disabled")!=="true"),K=q==null?void 0:q.getAttribute(Qp);R.setState("value",K||void 0)}function L(){var q,K,Z,ue;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of r.current){let be=(K=(q=i.current.get(ie))==null?void 0:q.value)!=null?K:"",Ae=(ue=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?ue:[],_e=T(be,Ae);n.current.filtered.items.set(ie,_e),_e>0&&de++}for(let[ie,be]of s.current)for(let Ae of be)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function I(){var q,K,Z;let ue=F();ue&&(((q=ue.parentElement)==null?void 0:q.firstChild)===ue&&((Z=(K=ue.closest(vy))==null?void 0:K.querySelector(Q_e))==null||Z.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function F(){var q;return(q=A.current)==null?void 0:q.querySelector(`${S8}[aria-selected="true"]`)}function U(){var q;return Array.from(((q=A.current)==null?void 0:q.querySelectorAll(jz))||[])}function Y(q){let K=U()[q];K&&R.setState("value",K.getAttribute(Qp))}function V(q){var K;let Z=F(),ue=U(),de=ue.findIndex(be=>be===Z),ie=ue[de+q];(K=o.current)!=null&&K.loop&&(ie=de+q<0?ue[ue.length-1]:de+q===ue.length?ue[0]:ue[de+q]),ie&&R.setState("value",ie.getAttribute(Qp))}function H(q){let K=F(),Z=K==null?void 0:K.closest(vy),ue;for(;Z&&!ue;)Z=q>0?axe(Z,vy):lxe(Z,vy),ue=Z==null?void 0:Z.querySelector(jz);ue?R.setState("value",ue.getAttribute(Qp)):V(q)}let ee=()=>Y(U().length-1),re=q=>{q.preventDefault(),q.metaKey?ee():q.altKey?H(1):V(1)},X=q=>{q.preventDefault(),q.metaKey?Y(0):q.altKey?H(-1):V(-1)};return _.createElement(fs.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:q=>{var K;(K=g.onKeyDown)==null||K.call(g,q);let Z=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||Z))switch(q.key){case"n":case"j":{y&&q.ctrlKey&&re(q);break}case"ArrowDown":{re(q);break}case"p":case"k":{y&&q.ctrlKey&&X(q);break}case"ArrowUp":{X(q);break}case"Home":{q.preventDefault(),Y(0);break}case"End":{q.preventDefault(),ee();break}case"Enter":{q.preventDefault();let ue=F();if(ue){let de=new Event(BD);ue.dispatchEvent(de)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:dxe},c),rA(t,q=>_.createElement(C8.Provider,{value:R},_.createElement(E8.Provider,{value:E},q))))}),J_e=_.forwardRef((t,e)=>{var n,r;let s=kc(),i=_.useRef(null),a=_.useContext(A8),o=g_(),c=P8(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;qh(()=>{if(!u)return o.item(s,a==null?void 0:a.id)},[u]);let f=T8(s,i,[t.value,t.children,i],t.keywords),l=rI(),d=Sd(k=>k.value&&k.value===f.current),m=Sd(k=>u||o.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);_.useEffect(()=>{let k=i.current;if(!(!k||t.disabled))return k.addEventListener(BD,p),()=>k.removeEventListener(BD,p)},[m,t.onSelect,t.disabled]);function p(){var k,R;h(),(R=(k=c.current).onSelect)==null||R.call(k,f.current)}function h(){l.setState("value",f.current,!0)}if(!m)return null;let{disabled:y,value:g,onSelect:v,forceMount:w,keywords:x,...A}=t;return _.createElement(fs.div,{ref:Vh(i,e),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||o.getDisablePointerSelection()?void 0:h,onClick:y?void 0:p},t.children)}),exe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=kc(),o=_.useRef(null),c=_.useRef(null),u=kc(),f=g_(),l=Sd(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);qh(()=>f.group(a),[]),T8(a,o,[t.value,t.heading,c]);let d=_.useMemo(()=>({id:a,forceMount:s}),[s]);return _.createElement(fs.div,{ref:Vh(o,e),...i,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&_.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),rA(t,m=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},_.createElement(A8.Provider,{value:d},m))))}),txe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=_.useRef(null),i=Sd(a=>!a.search);return!n&&!i?null:_.createElement(fs.div,{ref:Vh(s,e),...r,"cmdk-separator":"",role:"separator"})}),nxe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=rI(),a=Sd(u=>u.search),o=Sd(u=>u.selectedItemId),c=g_();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(fs.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:s?t.value:a,onChange:u=>{s||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),rxe=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=_.useRef(null),a=_.useRef(null),o=Sd(u=>u.selectedItemId),c=g_();return _.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,l,d=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let m=u.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(l),d.unobserve(u)}}},[]),_.createElement(fs.div,{ref:Vh(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},rA(t,u=>_.createElement("div",{ref:Vh(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),sxe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=t;return _.createElement(q_e,{open:n,onOpenChange:r},_.createElement(K_e,{container:a},_.createElement(Y_e,{"cmdk-overlay":"",className:s}),_.createElement(X_e,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(R8,{ref:e,...o}))))}),ixe=_.forwardRef((t,e)=>Sd(n=>n.filtered.count===0)?_.createElement(fs.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),oxe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return _.createElement(fs.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},rA(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Ai=Object.assign(R8,{List:rxe,Item:J_e,Input:nxe,Group:exe,Separator:txe,Dialog:sxe,Empty:ixe,Loading:oxe});function axe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function lxe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function P8(t){let e=_.useRef(t);return qh(()=>{e.current=t}),e}var qh=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Zp(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Sd(t){let e=rI(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function T8(t,e,n,r=[]){let s=_.useRef(),i=g_();return qh(()=>{var a;let o=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());i.value(t,o,c),(a=e.current)==null||a.setAttribute(Qp,o),s.current=o}),s}var cxe=()=>{let[t,e]=_.useState(),n=Zp(()=>new Map);return qh(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function uxe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function rA({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(uxe(e),{ref:e.ref},n(e.props.children)):n(e)}var dxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const fxe=SL,hxe=EL,pxe=CL,z4e=c_,k8=_.forwardRef(({className:t,...e},n)=>P.jsx(i_,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));k8.displayName=i_.displayName;const D8=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(pxe,{children:[P.jsx(k8,{}),P.jsxs(o_,{ref:r,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,P.jsxs(c_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[P.jsx(fL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));D8.displayName=o_.displayName;const N8=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});N8.displayName="DialogHeader";const O8=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});O8.displayName="DialogFooter";const M8=_.forwardRef(({className:t,...e},n)=>P.jsx(a_,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));M8.displayName=a_.displayName;const L8=_.forwardRef(({className:t,...e},n)=>P.jsx(l_,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));L8.displayName=l_.displayName;const mxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai,{ref:n,className:ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));mxe.displayName=Ai.displayName;const gxe=_.forwardRef(({className:t,...e},n)=>P.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[P.jsx(Tfe,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),P.jsx(Ai.Input,{ref:n,className:ce("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));gxe.displayName=Ai.Input.displayName;const vxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.List,{ref:n,className:ce("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));vxe.displayName=Ai.List.displayName;const yxe=_.forwardRef((t,e)=>P.jsx(Ai.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));yxe.displayName=Ai.Empty.displayName;const bxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.Group,{ref:n,className:ce("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));bxe.displayName=Ai.Group.displayName;const wxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.Separator,{ref:n,className:ce("-mx-1 h-px bg-border",t),...e}));wxe.displayName=Ai.Separator.displayName;const _xe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.Item,{ref:n,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e}));_xe.displayName=Ai.Item.displayName;const xxe=["top","right","bottom","left"],ul=Math.min,Zi=Math.max,rC=Math.round,iS=Math.floor,Ed=t=>({x:t,y:t}),Sxe={left:"right",right:"left",bottom:"top",top:"bottom"},Exe={start:"end",end:"start"};function UD(t,e,n){return Zi(t,ul(e,n))}function Bc(t,e){return typeof t=="function"?t(e):t}function Uc(t){return t.split("-")[0]}function Av(t){return t.split("-")[1]}function sI(t){return t==="x"?"y":"x"}function iI(t){return t==="y"?"height":"width"}function Cd(t){return["top","bottom"].includes(Uc(t))?"y":"x"}function oI(t){return sI(Cd(t))}function Cxe(t,e,n){n===void 0&&(n=!1);const r=Av(t),s=oI(t),i=iI(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=sC(a)),[a,sC(a)]}function Axe(t){const e=sC(t);return[HD(t),e,HD(e)]}function HD(t){return t.replace(/start|end/g,e=>Exe[e])}function Rxe(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:a;default:return[]}}function Pxe(t,e,n,r){const s=Av(t);let i=Rxe(Uc(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(HD)))),i}function sC(t){return t.replace(/left|right|bottom|top/g,e=>Sxe[e])}function Txe(t){return{top:0,right:0,bottom:0,left:0,...t}}function I8(t){return typeof t!="number"?Txe(t):{top:t,right:t,bottom:t,left:t}}function iC(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function zz(t,e,n){let{reference:r,floating:s}=t;const i=Cd(e),a=oI(e),o=iI(a),c=Uc(e),u=i==="y",f=r.x+r.width/2-s.width/2,l=r.y+r.height/2-s.height/2,d=r[o]/2-s[o]/2;let m;switch(c){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-s.width,y:l};break;default:m={x:r.x,y:r.y}}switch(Av(e)){case"start":m[a]-=d*(n&&u?-1:1);break;case"end":m[a]+=d*(n&&u?-1:1);break}return m}const kxe=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:l}=zz(u,r,c),d=r,m={},p=0;for(let h=0;h({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=Bc(t,e)||{};if(u==null)return{};const l=I8(f),d={x:n,y:r},m=oI(s),p=iI(m),h=await a.getDimensions(u),y=m==="y",g=y?"top":"left",v=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],A=d[m]-i.reference[m],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=k?k[w]:0;(!R||!await(a.isElement==null?void 0:a.isElement(k)))&&(R=o.floating[w]||i.floating[p]);const E=x/2-A/2,T=R/2-h[p]/2-1,D=ul(l[g],T),O=ul(l[v],T),L=D,I=R-h[p]-O,F=R/2-h[p]/2+E,U=UD(L,F,I),Y=!c.arrow&&Av(s)!=null&&F!==U&&i.reference[p]/2-(FF<=0)){var O,L;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,U=R[F];if(U)return{data:{index:F,overflows:D},reset:{placement:U}};let Y=(L=D.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(m){case"bestFit":{var I;const V=(I=D.filter(H=>{if(k){const ee=Cd(H.placement);return ee===v||ee==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ee=>ee>0).reduce((ee,re)=>ee+re,0)]).sort((H,ee)=>H[1]-ee[1])[0])==null?void 0:I[0];V&&(Y=V);break}case"initialPlacement":Y=o;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function Bz(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Uz(t){return xxe.some(e=>t[e]>=0)}const Oxe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Bc(t,e);switch(r){case"referenceHidden":{const i=await qb(e,{...s,elementContext:"reference"}),a=Bz(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Uz(a)}}}case"escaped":{const i=await qb(e,{...s,altBoundary:!0}),a=Bz(i,n.floating);return{data:{escapedOffsets:a,escaped:Uz(a)}}}default:return{}}}}};async function Mxe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Uc(n),o=Av(n),c=Cd(n)==="y",u=["left","top"].includes(a)?-1:1,f=i&&c?-1:1,l=Bc(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return o&&typeof p=="number"&&(m=o==="end"?p*-1:p),c?{x:m*f,y:d*u}:{x:d*u,y:m*f}}const Lxe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:o}=e,c=await Mxe(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},Ixe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=Bc(t,e),u={x:n,y:r},f=await qb(e,c),l=Cd(Uc(s)),d=sI(l);let m=u[d],p=u[l];if(i){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=m+f[y],w=m-f[g];m=UD(v,m,w)}if(a){const y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",v=p+f[y],w=p-f[g];p=UD(v,p,w)}const h=o.fn({...e,[d]:m,[l]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}},$xe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=Bc(t,e),f={x:n,y:r},l=Cd(s),d=sI(l);let m=f[d],p=f[l];const h=Bc(o,e),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const w=d==="y"?"height":"width",x=i.reference[d]-i.floating[w]+y.mainAxis,A=i.reference[d]+i.reference[w]-y.mainAxis;mA&&(m=A)}if(u){var g,v;const w=d==="y"?"width":"height",x=["top","left"].includes(Uc(s)),A=i.reference[l]-i.floating[w]+(x&&((g=a.offset)==null?void 0:g[l])||0)+(x?0:y.crossAxis),k=i.reference[l]+i.reference[w]+(x?0:((v=a.offset)==null?void 0:v[l])||0)-(x?y.crossAxis:0);pk&&(p=k)}return{[d]:m,[l]:p}}}},Fxe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:a=()=>{},...o}=Bc(t,e),c=await qb(e,o),u=Uc(n),f=Av(n),l=Cd(n)==="y",{width:d,height:m}=r.floating;let p,h;u==="top"||u==="bottom"?(p=u,h=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(h=u,p=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,g=d-c.left-c.right,v=ul(m-c[p],y),w=ul(d-c[h],g),x=!e.middlewareData.shift;let A=v,k=w;if(l?k=f||x?ul(w,g):g:A=f||x?ul(v,y):y,x&&!f){const E=Zi(c.left,0),T=Zi(c.right,0),D=Zi(c.top,0),O=Zi(c.bottom,0);l?k=d-2*(E!==0||T!==0?E+T:Zi(c.left,c.right)):A=m-2*(D!==0||O!==0?D+O:Zi(c.top,c.bottom))}await a({...e,availableWidth:k,availableHeight:A});const R=await s.getDimensions(i.floating);return d!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Rv(t){return $8(t)?(t.nodeName||"").toLowerCase():"#document"}function ro(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qc(t){var e;return(e=($8(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $8(t){return t instanceof Node||t instanceof ro(t).Node}function bl(t){return t instanceof Element||t instanceof ro(t).Element}function wl(t){return t instanceof HTMLElement||t instanceof ro(t).HTMLElement}function Hz(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ro(t).ShadowRoot}function v_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Aa(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function jxe(t){return["table","td","th"].includes(Rv(t))}function sA(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function aI(t){const e=lI(),n=Aa(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function zxe(t){let e=Ad(t);for(;wl(e)&&!ov(e);){if(sA(e))return null;if(aI(e))return e;e=Ad(e)}return null}function lI(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ov(t){return["html","body","#document"].includes(Rv(t))}function Aa(t){return ro(t).getComputedStyle(t)}function iA(t){return bl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ad(t){if(Rv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Hz(t)&&t.host||Qc(t);return Hz(e)?e.host:e}function F8(t){const e=Ad(t);return ov(e)?t.ownerDocument?t.ownerDocument.body:t.body:wl(e)&&v_(e)?e:F8(e)}function Kb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=F8(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=ro(s);return i?e.concat(a,a.visualViewport||[],v_(s)?s:[],a.frameElement&&n?Kb(a.frameElement):[]):e.concat(s,Kb(s,[],n))}function j8(t){const e=Aa(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=wl(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,o=rC(n)!==i||rC(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function cI(t){return bl(t)?t:t.contextElement}function Im(t){const e=cI(t);if(!wl(e))return Ed(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=j8(e);let a=(i?rC(n.width):n.width)/r,o=(i?rC(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Bxe=Ed(0);function z8(t){const e=ro(t);return!lI()||!e.visualViewport?Bxe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Uxe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ro(t)?!1:e}function Kh(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=cI(t);let a=Ed(1);e&&(r?bl(r)&&(a=Im(r)):a=Im(t));const o=Uxe(i,n,r)?z8(i):Ed(0);let c=(s.left+o.x)/a.x,u=(s.top+o.y)/a.y,f=s.width/a.x,l=s.height/a.y;if(i){const d=ro(i),m=r&&bl(r)?ro(r):r;let p=d,h=p.frameElement;for(;h&&r&&m!==p;){const y=Im(h),g=h.getBoundingClientRect(),v=Aa(h),w=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*y.x,x=g.top+(h.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,l*=y.y,c+=w,u+=x,p=ro(h),h=p.frameElement}}return iC({width:f,height:l,x:c,y:u})}function Hxe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=Qc(r),o=e?sA(e.floating):!1;if(r===a||o&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ed(1);const f=Ed(0),l=wl(r);if((l||!l&&!i)&&((Rv(r)!=="body"||v_(a))&&(c=iA(r)),wl(r))){const d=Kh(r);u=Im(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x,y:n.y*u.y-c.scrollTop*u.y+f.y}}function Vxe(t){return Array.from(t.getClientRects())}function B8(t){return Kh(Qc(t)).left+iA(t).scrollLeft}function Wxe(t){const e=Qc(t),n=iA(t),r=t.ownerDocument.body,s=Zi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Zi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+B8(t);const o=-n.scrollTop;return Aa(r).direction==="rtl"&&(a+=Zi(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}function Gxe(t,e){const n=ro(t),r=Qc(t),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;const u=lI();(!u||u&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o,y:c}}function qxe(t,e){const n=Kh(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=wl(t)?Im(t):Ed(1),a=t.clientWidth*i.x,o=t.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:a,height:o,x:c,y:u}}function Vz(t,e,n){let r;if(e==="viewport")r=Gxe(t,n);else if(e==="document")r=Wxe(Qc(t));else if(bl(e))r=qxe(e,n);else{const s=z8(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return iC(r)}function U8(t,e){const n=Ad(t);return n===e||!bl(n)||ov(n)?!1:Aa(n).position==="fixed"||U8(n,e)}function Kxe(t,e){const n=e.get(t);if(n)return n;let r=Kb(t,[],!1).filter(o=>bl(o)&&Rv(o)!=="body"),s=null;const i=Aa(t).position==="fixed";let a=i?Ad(t):t;for(;bl(a)&&!ov(a);){const o=Aa(a),c=aI(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||v_(a)&&!c&&U8(t,a))?r=r.filter(f=>f!==a):s=o,a=Ad(a)}return e.set(t,r),r}function Yxe(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?sA(e)?[]:Kxe(e,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,f)=>{const l=Vz(e,f,s);return u.top=Zi(l.top,u.top),u.right=ul(l.right,u.right),u.bottom=ul(l.bottom,u.bottom),u.left=Zi(l.left,u.left),u},Vz(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Xxe(t){const{width:e,height:n}=j8(t);return{width:e,height:n}}function Qxe(t,e,n){const r=wl(e),s=Qc(e),i=n==="fixed",a=Kh(t,!0,i,e);let o={scrollLeft:0,scrollTop:0};const c=Ed(0);if(r||!r&&!i)if((Rv(e)!=="body"||v_(s))&&(o=iA(e)),r){const l=Kh(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=B8(s));const u=a.left+o.scrollLeft-c.x,f=a.top+o.scrollTop-c.y;return{x:u,y:f,width:a.width,height:a.height}}function wT(t){return Aa(t).position==="static"}function Wz(t,e){return!wl(t)||Aa(t).position==="fixed"?null:e?e(t):t.offsetParent}function H8(t,e){const n=ro(t);if(sA(t))return n;if(!wl(t)){let s=Ad(t);for(;s&&!ov(s);){if(bl(s)&&!wT(s))return s;s=Ad(s)}return n}let r=Wz(t,e);for(;r&&jxe(r)&&wT(r);)r=Wz(r,e);return r&&ov(r)&&wT(r)&&!aI(r)?n:r||zxe(t)||n}const Zxe=async function(t){const e=this.getOffsetParent||H8,n=this.getDimensions,r=await n(t.floating);return{reference:Qxe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Jxe(t){return Aa(t).direction==="rtl"}const eSe={convertOffsetParentRelativeRectToViewportRelativeRect:Hxe,getDocumentElement:Qc,getClippingRect:Yxe,getOffsetParent:H8,getElementRects:Zxe,getClientRects:Vxe,getDimensions:Xxe,getScale:Im,isElement:bl,isRTL:Jxe};function tSe(t,e){let n=null,r;const s=Qc(t);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:l,height:d}=t.getBoundingClientRect();if(o||e(),!l||!d)return;const m=iS(f),p=iS(s.clientWidth-(u+l)),h=iS(s.clientHeight-(f+d)),y=iS(u),v={rootMargin:-m+"px "+-p+"px "+-h+"px "+-y+"px",threshold:Zi(0,ul(1,c))||1};let w=!0;function x(A){const k=A[0].intersectionRatio;if(k!==c){if(!w)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(t)}return a(!0),i}function nSe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=cI(t),f=s||i?[...u?Kb(u):[],...Kb(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=u&&o?tSe(u,n):null;let d=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(e)})),n()}),u&&!c&&m.observe(u),m.observe(e));let p,h=c?Kh(t):null;c&&y();function y(){const g=Kh(t);h&&(g.x!==h.x||g.y!==h.y||g.width!==h.width||g.height!==h.height)&&n(),h=g,p=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),l==null||l(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const rSe=Lxe,sSe=Ixe,iSe=Nxe,oSe=Fxe,aSe=Oxe,Gz=Dxe,lSe=$xe,cSe=(t,e,n)=>{const r=new Map,s={platform:eSe,...n},i={...s.platform,_c:r};return kxe(t,e,{...s,platform:i})};var BS=typeof document<"u"?_.useLayoutEffect:_.useEffect;function oC(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!oC(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!oC(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function V8(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function qz(t,e){const n=V8(t);return Math.round(e*n)/n}function Kz(t){const e=_.useRef(t);return BS(()=>{e.current=t}),e}function uSe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,l]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,m]=_.useState(r);oC(d,r)||m(r);const[p,h]=_.useState(null),[y,g]=_.useState(null),v=_.useCallback(V=>{V!==k.current&&(k.current=V,h(V))},[]),w=_.useCallback(V=>{V!==R.current&&(R.current=V,g(V))},[]),x=i||p,A=a||y,k=_.useRef(null),R=_.useRef(null),E=_.useRef(f),T=c!=null,D=Kz(c),O=Kz(s),L=_.useCallback(()=>{if(!k.current||!R.current)return;const V={placement:e,strategy:n,middleware:d};O.current&&(V.platform=O.current),cSe(k.current,R.current,V).then(H=>{const ee={...H,isPositioned:!0};I.current&&!oC(E.current,ee)&&(E.current=ee,ks.flushSync(()=>{l(ee)}))})},[d,e,n,O]);BS(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[u]);const I=_.useRef(!1);BS(()=>(I.current=!0,()=>{I.current=!1}),[]),BS(()=>{if(x&&(k.current=x),A&&(R.current=A),x&&A){if(D.current)return D.current(x,A,L);L()}},[x,A,L,D,T]);const F=_.useMemo(()=>({reference:k,floating:R,setReference:v,setFloating:w}),[v,w]),U=_.useMemo(()=>({reference:x,floating:A}),[x,A]),Y=_.useMemo(()=>{const V={position:n,left:0,top:0};if(!U.floating)return V;const H=qz(U.floating,f.x),ee=qz(U.floating,f.y);return o?{...V,transform:"translate("+H+"px, "+ee+"px)",...V8(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:ee}},[n,o,U.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:L,refs:F,elements:U,floatingStyles:Y}),[f,L,F,U,Y])}const dSe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Gz({element:r.current,padding:s}).fn(n):{}:r?Gz({element:r,padding:s}).fn(n):{}}}},fSe=(t,e)=>({...rSe(t),options:[t,e]}),hSe=(t,e)=>({...sSe(t),options:[t,e]}),pSe=(t,e)=>({...lSe(t),options:[t,e]}),mSe=(t,e)=>({...iSe(t),options:[t,e]}),gSe=(t,e)=>({...oSe(t),options:[t,e]}),vSe=(t,e)=>({...aSe(t),options:[t,e]}),ySe=(t,e)=>({...dSe(t),options:[t,e]});var bSe="Arrow",W8=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return P.jsx(De.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});W8.displayName=bSe;var wSe=W8,uI="Popper",[G8,Sl]=Pn(uI),[_Se,q8]=G8(uI),K8=t=>{const{__scopePopper:e,children:n}=t,[r,s]=_.useState(null);return P.jsx(_Se,{scope:e,anchor:r,onAnchorChange:s,children:n})};K8.displayName=uI;var Y8="PopperAnchor",X8=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=q8(Y8,n),a=_.useRef(null),o=tt(e,a);return _.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:P.jsx(De.div,{...s,ref:o})});X8.displayName=Y8;var dI="PopperContent",[xSe,SSe]=G8(dI),Q8=_.forwardRef((t,e)=>{var ie,be,Ae,_e,Me,Ne;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:p,...h}=t,y=q8(dI,n),[g,v]=_.useState(null),w=tt(e,ye=>v(ye)),[x,A]=_.useState(null),k=m_(x),R=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,T=r+(i!=="center"?"-"+i:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],L=O.length>0,I={padding:D,boundary:O.filter(CSe),altBoundary:L},{refs:F,floatingStyles:U,placement:Y,isPositioned:V,middlewareData:H}=uSe({strategy:"fixed",placement:T,whileElementsMounted:(...ye)=>nSe(...ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[fSe({mainAxis:s+E,alignmentAxis:a}),c&&hSe({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?pSe():void 0,...I}),c&&mSe({...I}),gSe({...I,apply:({elements:ye,rects:$e,availableWidth:ut,availableHeight:Qe})=>{const{width:vt,height:Sn}=$e.reference,Yt=ye.floating.style;Yt.setProperty("--radix-popper-available-width",`${ut}px`),Yt.setProperty("--radix-popper-available-height",`${Qe}px`),Yt.setProperty("--radix-popper-anchor-width",`${vt}px`),Yt.setProperty("--radix-popper-anchor-height",`${Sn}px`)}}),x&&ySe({element:x,padding:o}),ASe({arrowWidth:R,arrowHeight:E}),d&&vSe({strategy:"referenceHidden",...I})]}),[ee,re]=eG(Y),X=Bt(p);Mn(()=>{V&&(X==null||X())},[V,X]);const q=(ie=H.arrow)==null?void 0:ie.x,K=(be=H.arrow)==null?void 0:be.y,Z=((Ae=H.arrow)==null?void 0:Ae.centerOffset)!==0,[ue,de]=_.useState();return Mn(()=>{g&&de(window.getComputedStyle(g).zIndex)},[g]),P.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(_e=H.transformOrigin)==null?void 0:_e.x,(Me=H.transformOrigin)==null?void 0:Me.y].join(" "),...((Ne=H.hide)==null?void 0:Ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(xSe,{scope:n,placedSide:ee,onArrowChange:A,arrowX:q,arrowY:K,shouldHideArrow:Z,children:P.jsx(De.div,{"data-side":ee,"data-align":re,...h,ref:w,style:{...h.style,animation:V?void 0:"none"}})})})});Q8.displayName=dI;var Z8="PopperArrow",ESe={top:"bottom",right:"left",bottom:"top",left:"right"},J8=_.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=SSe(Z8,r),a=ESe[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:P.jsx(wSe,{...s,ref:n,style:{...s.style,display:"block"}})})});J8.displayName=Z8;function CSe(t){return t!==null}var ASe=t=>({name:"transformOrigin",options:t,fn(e){var y,g,v;const{placement:n,rects:r,middlewareData:s}=e,a=((y=s.arrow)==null?void 0:y.centerOffset)!==0,o=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,f]=eG(n),l={start:"0%",center:"50%",end:"100%"}[f],d=(((g=s.arrow)==null?void 0:g.x)??0)+o/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let p="",h="";return u==="bottom"?(p=a?l:`${d}px`,h=`${-c}px`):u==="top"?(p=a?l:`${d}px`,h=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,h=a?l:`${m}px`):u==="left"&&(p=`${r.floating.width+c}px`,h=a?l:`${m}px`),{data:{x:p,y:h}}}});function eG(t){const[e,n="center"]=t.split("-");return[e,n]}var oA=K8,Pv=X8,y_=Q8,b_=J8,_T="rovingFocusGroup.onEntryFocus",RSe={bubbles:!1,cancelable:!0},aA="RovingFocusGroup",[VD,tG,PSe]=qc(aA),[TSe,El]=Pn(aA,[PSe]),[kSe,DSe]=TSe(aA),nG=_.forwardRef((t,e)=>P.jsx(VD.Provider,{scope:t.__scopeRovingFocusGroup,children:P.jsx(VD.Slot,{scope:t.__scopeRovingFocusGroup,children:P.jsx(NSe,{...t,ref:e})})}));nG.displayName=aA;var NSe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...l}=t,d=_.useRef(null),m=tt(e,d),p=Ta(i),[h=null,y]=sr({prop:a,defaultProp:o,onChange:c}),[g,v]=_.useState(!1),w=Bt(u),x=tG(n),A=_.useRef(!1),[k,R]=_.useState(0);return _.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(_T,w),()=>E.removeEventListener(_T,w)},[w]),P.jsx(kSe,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:h,onItemFocus:_.useCallback(E=>y(E),[y]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(E=>E+1),[]),onFocusableItemRemove:_.useCallback(()=>R(E=>E-1),[]),children:P.jsx(De.div,{tabIndex:g||k===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...t.style},onMouseDown:me(t.onMouseDown,()=>{A.current=!0}),onFocus:me(t.onFocus,E=>{const T=!A.current;if(E.target===E.currentTarget&&T&&!g){const D=new CustomEvent(_T,RSe);if(E.currentTarget.dispatchEvent(D),!D.defaultPrevented){const O=x().filter(Y=>Y.focusable),L=O.find(Y=>Y.active),I=O.find(Y=>Y.id===h),U=[L,I,...O].filter(Boolean).map(Y=>Y.ref.current);iG(U,f)}}A.current=!1}),onBlur:me(t.onBlur,()=>v(!1))})})}),rG="RovingFocusGroupItem",sG=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...a}=t,o=Hr(),c=i||o,u=DSe(rG,n),f=u.currentTabStopId===c,l=tG(n),{onFocusableItemAdd:d,onFocusableItemRemove:m}=u;return _.useEffect(()=>{if(r)return d(),()=>m()},[r,d,m]),P.jsx(VD.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:P.jsx(De.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:me(t.onMouseDown,p=>{r?u.onItemFocus(c):p.preventDefault()}),onFocus:me(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:me(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){u.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=LSe(p,u.orientation,u.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let g=l().filter(v=>v.focusable).map(v=>v.ref.current);if(h==="last")g.reverse();else if(h==="prev"||h==="next"){h==="prev"&&g.reverse();const v=g.indexOf(p.currentTarget);g=u.loop?ISe(g,v+1):g.slice(v+1)}setTimeout(()=>iG(g))}})})})});sG.displayName=rG;var OSe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function MSe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function LSe(t,e,n){const r=MSe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return OSe[r]}function iG(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function ISe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var w_=nG,__=sG,WD=["Enter"," "],$Se=["ArrowDown","PageUp","Home"],oG=["ArrowUp","PageDown","End"],FSe=[...$Se,...oG],jSe={ltr:[...WD,"ArrowRight"],rtl:[...WD,"ArrowLeft"]},zSe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},x_="Menu",[Yb,BSe,USe]=qc(x_),[fp,S_]=Pn(x_,[USe,Sl,El]),lA=Sl(),aG=El(),[HSe,hp]=fp(x_),[VSe,E_]=fp(x_),lG=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,o=lA(e),[c,u]=_.useState(null),f=_.useRef(!1),l=Bt(i),d=Ta(s);return _.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),P.jsx(oA,{...o,children:P.jsx(HSe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:u,children:P.jsx(VSe,{scope:e,onClose:_.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:d,modal:a,children:r})})})};lG.displayName=x_;var WSe="MenuAnchor",fI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=lA(n);return P.jsx(Pv,{...s,...r,ref:e})});fI.displayName=WSe;var hI="MenuPortal",[GSe,cG]=fp(hI,{forceMount:void 0}),uG=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=hp(hI,e);return P.jsx(GSe,{scope:e,forceMount:n,children:P.jsx(Un,{present:n||i.open,children:P.jsx(wv,{asChild:!0,container:s,children:r})})})};uG.displayName=hI;var Lo="MenuContent",[qSe,pI]=fp(Lo),dG=_.forwardRef((t,e)=>{const n=cG(Lo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=hp(Lo,t.__scopeMenu),a=E_(Lo,t.__scopeMenu);return P.jsx(Yb.Provider,{scope:t.__scopeMenu,children:P.jsx(Un,{present:r||i.open,children:P.jsx(Yb.Slot,{scope:t.__scopeMenu,children:a.modal?P.jsx(KSe,{...s,ref:e}):P.jsx(YSe,{...s,ref:e})})})})}),KSe=_.forwardRef((t,e)=>{const n=hp(Lo,t.__scopeMenu),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(mI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),YSe=_.forwardRef((t,e)=>{const n=hp(Lo,t.__scopeMenu);return P.jsx(mI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mI=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,disableOutsideScroll:p,...h}=t,y=hp(Lo,n),g=E_(Lo,n),v=lA(n),w=aG(n),x=BSe(n),[A,k]=_.useState(null),R=_.useRef(null),E=tt(e,R,y.onContentChange),T=_.useRef(0),D=_.useRef(""),O=_.useRef(0),L=_.useRef(null),I=_.useRef("right"),F=_.useRef(0),U=p?s_:_.Fragment,Y=p?{as:Sa,allowPinchZoom:!0}:void 0,V=ee=>{var ie,be;const re=D.current+ee,X=x().filter(Ae=>!Ae.disabled),q=document.activeElement,K=(ie=X.find(Ae=>Ae.ref.current===q))==null?void 0:ie.textValue,Z=X.map(Ae=>Ae.textValue),ue=aEe(Z,re,K),de=(be=X.find(Ae=>Ae.textValue===ue))==null?void 0:be.ref.current;(function Ae(_e){D.current=_e,window.clearTimeout(T.current),_e!==""&&(T.current=window.setTimeout(()=>Ae(""),1e3))})(re),de&&setTimeout(()=>de.focus())};_.useEffect(()=>()=>window.clearTimeout(T.current),[]),I1();const H=_.useCallback(ee=>{var X,q;return I.current===((X=L.current)==null?void 0:X.side)&&cEe(ee,(q=L.current)==null?void 0:q.area)},[]);return P.jsx(qSe,{scope:n,searchRef:D,onItemEnter:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),onItemLeave:_.useCallback(ee=>{var re;H(ee)||((re=R.current)==null||re.focus(),k(null))},[H]),onTriggerLeave:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(ee=>{L.current=ee},[]),children:P.jsx(U,{...Y,children:P.jsx(r_,{asChild:!0,trapped:s,onMountAutoFocus:me(i,ee=>{var re;ee.preventDefault(),(re=R.current)==null||re.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,children:P.jsx(w_,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:me(c,ee=>{g.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(y_,{role:"menu","aria-orientation":"vertical","data-state":RG(y.open),"data-radix-menu-content":"",dir:g.dir,...v,...h,ref:E,style:{outline:"none",...h.style},onKeyDown:me(h.onKeyDown,ee=>{const X=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,q=ee.ctrlKey||ee.altKey||ee.metaKey,K=ee.key.length===1;X&&(ee.key==="Tab"&&ee.preventDefault(),!q&&K&&V(ee.key));const Z=R.current;if(ee.target!==Z||!FSe.includes(ee.key))return;ee.preventDefault();const de=x().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);oG.includes(ee.key)&&de.reverse(),iEe(de)}),onBlur:me(t.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(T.current),D.current="")}),onPointerMove:me(t.onPointerMove,Xb(ee=>{const re=ee.target,X=F.current!==ee.clientX;if(ee.currentTarget.contains(re)&&X){const q=ee.clientX>F.current?"right":"left";I.current=q,F.current=ee.clientX}}))})})})})})})});dG.displayName=Lo;var XSe="MenuGroup",gI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{role:"group",...r,ref:e})});gI.displayName=XSe;var QSe="MenuLabel",fG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});fG.displayName=QSe;var aC="MenuItem",Yz="menu.itemSelect",cA=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=_.useRef(null),a=E_(aC,t.__scopeMenu),o=pI(aC,t.__scopeMenu),c=tt(e,i),u=_.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(Yz,{bubbles:!0,cancelable:!0});l.addEventListener(Yz,m=>r==null?void 0:r(m),{once:!0}),Hb(l,d),d.defaultPrevented?u.current=!1:a.onClose()}};return P.jsx(hG,{...s,ref:c,disabled:n,onClick:me(t.onClick,f),onPointerDown:l=>{var d;(d=t.onPointerDown)==null||d.call(t,l),u.current=!0},onPointerUp:me(t.onPointerUp,l=>{var d;u.current||(d=l.currentTarget)==null||d.click()}),onKeyDown:me(t.onKeyDown,l=>{const d=o.searchRef.current!=="";n||d&&l.key===" "||WD.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});cA.displayName=aC;var hG=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=pI(aC,n),o=aG(n),c=_.useRef(null),u=tt(e,c),[f,l]=_.useState(!1),[d,m]=_.useState("");return _.useEffect(()=>{const p=c.current;p&&m((p.textContent??"").trim())},[i.children]),P.jsx(Yb.ItemSlot,{scope:n,disabled:r,textValue:s??d,children:P.jsx(__,{asChild:!0,...o,focusable:!r,children:P.jsx(De.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:me(t.onPointerMove,Xb(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(t.onPointerLeave,Xb(p=>a.onItemLeave(p))),onFocus:me(t.onFocus,()=>l(!0)),onBlur:me(t.onBlur,()=>l(!1))})})})}),ZSe="MenuCheckboxItem",pG=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return P.jsx(bG,{scope:t.__scopeMenu,checked:n,children:P.jsx(cA,{role:"menuitemcheckbox","aria-checked":lC(n)?"mixed":n,...s,ref:e,"data-state":yI(n),onSelect:me(s.onSelect,()=>r==null?void 0:r(lC(n)?!0:!n),{checkForDefaultPrevented:!1})})})});pG.displayName=ZSe;var mG="MenuRadioGroup",[JSe,eEe]=fp(mG,{value:void 0,onValueChange:()=>{}}),gG=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Bt(r);return P.jsx(JSe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:P.jsx(gI,{...s,ref:e})})});gG.displayName=mG;var vG="MenuRadioItem",yG=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=eEe(vG,t.__scopeMenu),i=n===s.value;return P.jsx(bG,{scope:t.__scopeMenu,checked:i,children:P.jsx(cA,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":yI(i),onSelect:me(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});yG.displayName=vG;var vI="MenuItemIndicator",[bG,tEe]=fp(vI,{checked:!1}),wG=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=tEe(vI,n);return P.jsx(Un,{present:r||lC(i.checked)||i.checked===!0,children:P.jsx(De.span,{...s,ref:e,"data-state":yI(i.checked)})})});wG.displayName=vI;var nEe="MenuSeparator",_G=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});_G.displayName=nEe;var rEe="MenuArrow",xG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=lA(n);return P.jsx(b_,{...s,...r,ref:e})});xG.displayName=rEe;var sEe="MenuSub",[B4e,SG]=fp(sEe),$y="MenuSubTrigger",EG=_.forwardRef((t,e)=>{const n=hp($y,t.__scopeMenu),r=E_($y,t.__scopeMenu),s=SG($y,t.__scopeMenu),i=pI($y,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},f=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const l=o.current;return()=>{window.clearTimeout(l),c(null)}},[o,c]),P.jsx(fI,{asChild:!0,...u,children:P.jsx(hG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":RG(n.open),...t,ref:e_(e,s.onTriggerChange),onClick:l=>{var d;(d=t.onClick)==null||d.call(t,l),!(t.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(t.onPointerMove,Xb(l=>{i.onItemEnter(l),!l.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:me(t.onPointerLeave,Xb(l=>{var m,p;f();const d=(m=n.content)==null?void 0:m.getBoundingClientRect();if(d){const h=(p=n.content)==null?void 0:p.dataset.side,y=h==="right",g=y?-5:5,v=d[y?"left":"right"],w=d[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:v,y:d.top},{x:w,y:d.top},{x:w,y:d.bottom},{x:v,y:d.bottom}],side:h}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:me(t.onKeyDown,l=>{var m;const d=i.searchRef.current!=="";t.disabled||d&&l.key===" "||jSe[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});EG.displayName=$y;var CG="MenuSubContent",AG=_.forwardRef((t,e)=>{const n=cG(Lo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=hp(Lo,t.__scopeMenu),a=E_(Lo,t.__scopeMenu),o=SG(CG,t.__scopeMenu),c=_.useRef(null),u=tt(e,c);return P.jsx(Yb.Provider,{scope:t.__scopeMenu,children:P.jsx(Un,{present:r||i.open,children:P.jsx(Yb.Slot,{scope:t.__scopeMenu,children:P.jsx(mI,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;a.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:me(t.onFocusOutside,f=>{f.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:me(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:me(t.onKeyDown,f=>{var m;const l=f.currentTarget.contains(f.target),d=zSe[a.dir].includes(f.key);l&&d&&(i.onOpenChange(!1),(m=o.trigger)==null||m.focus(),f.preventDefault())})})})})})});AG.displayName=CG;function RG(t){return t?"open":"closed"}function lC(t){return t==="indeterminate"}function yI(t){return lC(t)?"indeterminate":t?"checked":"unchecked"}function iEe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function oEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function aEe(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=oEe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function lEe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function cEe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return lEe(n,e)}function Xb(t){return e=>e.pointerType==="mouse"?t(e):void 0}var uEe=lG,bI=fI,wI=uG,_I=dG,xI=gI,SI=fG,EI=cA,CI=pG,AI=gG,RI=yG,PI=wG,TI=_G,kI=xG,DI=EG,NI=AG,PG="ContextMenu",[dEe,U4e]=Pn(PG,[S_]),Ri=S_(),[H4e,TG]=dEe(PG),kG="ContextMenuTrigger",fEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=TG(kG,n),a=Ri(n),o=_.useRef({x:0,y:0}),c=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...o.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),l=d=>{o.current={x:d.clientX,y:d.clientY},i.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),P.jsxs(P.Fragment,{children:[P.jsx(bI,{...a,virtualRef:c}),P.jsx(De.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:me(t.onContextMenu,d=>{f(),l(d),d.preventDefault()}),onPointerDown:r?t.onPointerDown:me(t.onPointerDown,oS(d=>{f(),u.current=window.setTimeout(()=>l(d),700)})),onPointerMove:r?t.onPointerMove:me(t.onPointerMove,oS(f)),onPointerCancel:r?t.onPointerCancel:me(t.onPointerCancel,oS(f)),onPointerUp:r?t.onPointerUp:me(t.onPointerUp,oS(f))})]})});fEe.displayName=kG;var hEe="ContextMenuPortal",DG=t=>{const{__scopeContextMenu:e,...n}=t,r=Ri(e);return P.jsx(wI,{...r,...n})};DG.displayName=hEe;var NG="ContextMenuContent",OG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=TG(NG,n),i=Ri(n),a=_.useRef(!1);return P.jsx(_I,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:o=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,o),!o.defaultPrevented&&a.current&&o.preventDefault(),a.current=!1},onInteractOutside:o=>{var c;(c=t.onInteractOutside)==null||c.call(t,o),!o.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});OG.displayName=NG;var pEe="ContextMenuGroup",mEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(xI,{...s,...r,ref:e})});mEe.displayName=pEe;var gEe="ContextMenuLabel",MG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(SI,{...s,...r,ref:e})});MG.displayName=gEe;var vEe="ContextMenuItem",LG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(EI,{...s,...r,ref:e})});LG.displayName=vEe;var yEe="ContextMenuCheckboxItem",IG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(CI,{...s,...r,ref:e})});IG.displayName=yEe;var bEe="ContextMenuRadioGroup",wEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(AI,{...s,...r,ref:e})});wEe.displayName=bEe;var _Ee="ContextMenuRadioItem",$G=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(RI,{...s,...r,ref:e})});$G.displayName=_Ee;var xEe="ContextMenuItemIndicator",FG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(PI,{...s,...r,ref:e})});FG.displayName=xEe;var SEe="ContextMenuSeparator",jG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(TI,{...s,...r,ref:e})});jG.displayName=SEe;var EEe="ContextMenuArrow",CEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(kI,{...s,...r,ref:e})});CEe.displayName=EEe;var AEe="ContextMenuSubTrigger",zG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(DI,{...s,...r,ref:e})});zG.displayName=AEe;var REe="ContextMenuSubContent",BG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(NI,{...s,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BG.displayName=REe;function oS(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var PEe=DG,UG=OG,HG=MG,VG=LG,WG=IG,GG=$G,qG=FG,KG=jG,YG=zG,XG=BG;const TEe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(YG,{ref:s,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,P.jsx(n_,{className:"ml-auto h-4 w-4"})]}));TEe.displayName=YG.displayName;const kEe=_.forwardRef(({className:t,...e},n)=>P.jsx(XG,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));kEe.displayName=XG.displayName;const DEe=_.forwardRef(({className:t,...e},n)=>P.jsx(PEe,{children:P.jsx(UG,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e})}));DEe.displayName=UG.displayName;const NEe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(VG,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));NEe.displayName=VG.displayName;const OEe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(WG,{ref:s,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(qG,{children:P.jsx(t_,{className:"h-4 w-4"})})}),e]}));OEe.displayName=WG.displayName;const MEe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(GG,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(qG,{children:P.jsx(L1,{className:"h-2 w-2 fill-current"})})}),e]}));MEe.displayName=GG.displayName;const LEe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(HG,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));LEe.displayName=HG.displayName;const IEe=_.forwardRef(({className:t,...e},n)=>P.jsx(KG,{ref:n,className:ce("-mx-1 my-1 h-px bg-border",t),...e}));IEe.displayName=KG.displayName;function wd(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Xz(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function QG(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Xz(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function FEe(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,jEe(s,...e)]}function jEe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var OI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(BEe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(GD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(GD,{...r,ref:e,children:n})});OI.displayName="Slot";var GD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=HEe(n),i=UEe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?QG(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});GD.displayName="SlotClone";var zEe=({children:t})=>P.jsx(P.Fragment,{children:t});function BEe(t){return _.isValidElement(t)&&t.type===zEe}function UEe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function HEe(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var VEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zc=VEe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?OI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function WEe(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}var GEe="DismissableLayer",qD="dismissableLayer.update",qEe="dismissableLayer.pointerDownOutside",KEe="dismissableLayer.focusOutside",Qz,ZG=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),JG=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(ZG),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=pp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=QEe(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=ZEe(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return u6(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Qz=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Zz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=Qz)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Zz())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(qD,R),()=>document.removeEventListener(qD,R)},[]),P.jsx(Zc.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:wd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:wd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:wd(t.onPointerDownCapture,A.onPointerDownCapture)})});JG.displayName=GEe;var YEe="DismissableLayerBranch",XEe=_.forwardRef((t,e)=>{const n=_.useContext(ZG),r=_.useRef(null),s=pp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(Zc.div,{...t,ref:s})});XEe.displayName=YEe;function QEe(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){eq(qEe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function ZEe(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&eq(KEe,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Zz(){const t=new CustomEvent(qD);document.dispatchEvent(t)}function eq(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?WEe(s,i):s.dispatchEvent(i)}var xT="focusScope.autoFocusOnMount",ST="focusScope.autoFocusOnUnmount",Jz={bubbles:!1,cancelable:!0},JEe="FocusScope",tq=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Bt(s),f=Bt(i),l=_.useRef(null),d=pp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:yu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||yu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&yu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){tB.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(xT,Jz);o.addEventListener(xT,u),o.dispatchEvent(g),g.defaultPrevented||(eCe(iCe(nq(o)),{select:!0}),document.activeElement===h&&yu(o))}return()=>{o.removeEventListener(xT,u),setTimeout(()=>{const g=new CustomEvent(ST,Jz);o.addEventListener(ST,f),o.dispatchEvent(g),g.defaultPrevented||yu(h??document.body,{select:!0}),o.removeEventListener(ST,f),tB.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=tCe(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&yu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&yu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(Zc.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});tq.displayName=JEe;function eCe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(yu(r,{select:e}),document.activeElement!==n)return}function tCe(t){const e=nq(t),n=eB(e,t),r=eB(e.reverse(),t);return[n,r]}function nq(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function eB(t,e){for(const n of t)if(!nCe(n,{upTo:e}))return n}function nCe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function rCe(t){return t instanceof HTMLInputElement&&"select"in t}function yu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&rCe(t)&&e&&t.select()}}var tB=sCe();function sCe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=nB(t,e),t.unshift(e)},remove(e){var n;t=nB(t,e),(n=t[0])==null||n.resume()}}}function nB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function iCe(t){return t.filter(e=>e.tagName!=="A")}var oCe="Portal",rq=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);Mn(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?Jw.createPortal(P.jsx(Zc.div,{...r,ref:e}),a):null});rq.displayName=oCe;function aCe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var uA=t=>{const{present:e,children:n}=t,r=lCe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=pp(r.ref,cCe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};uA.displayName="Presence";function lCe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=aCe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=aS(r.current);i.current=o==="mounted"?u:"none"},[o]),Mn(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=aS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),Mn(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=aS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=aS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function aS(t){return(t==null?void 0:t.animationName)||"none"}function cCe(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var ET=0;function uCe(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??rB()),document.body.insertAdjacentElement("beforeend",t[1]??rB()),ET++,()=>{ET===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ET--}},[])}function rB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var sq=gL(),CT=function(){},dA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:CT,onWheelCapture:CT,onTouchMoveCapture:CT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=$1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=mL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:sq,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});dA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};dA.classNames={fullWidth:Om,zeroRight:Nm};var KD=!1;if(typeof window<"u")try{var lS=Object.defineProperty({},"passive",{get:function(){return KD=!0,!0}});window.addEventListener("test",lS,lS),window.removeEventListener("test",lS,lS)}catch{KD=!1}var jp=KD?{passive:!1}:!1,dCe=function(t){return t.tagName==="TEXTAREA"},iq=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!dCe(t)&&n[e]==="visible")},fCe=function(t){return iq(t,"overflowY")},hCe=function(t){return iq(t,"overflowX")},sB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=oq(t,r);if(s){var i=aq(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pCe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},mCe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},oq=function(t,e){return t==="v"?fCe(e):hCe(e)},aq=function(t,e){return t==="v"?pCe(e):mCe(e)},gCe=function(t,e){return t==="h"&&e==="rtl"?-1:1},vCe=function(t,e,n,r,s){var i=gCe(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=aq(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&oq(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},cS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},iB=function(t){return[t.deltaX,t.deltaY]},oB=function(t){return t&&"current"in t?t.current:t},yCe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},bCe=function(t){return` +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Y_e="DialogDescriptionWarning",X_e=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${A8(Y_e).contentName}}.`;return _.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Q_e=g8,Z_e=b8,J_e=w8,exe=_8,vy='[cmdk-group=""]',wT='[cmdk-group-items=""]',txe='[cmdk-group-heading=""]',R8='[cmdk-item=""]',Uz=`${R8}:not([aria-disabled="true"])`,UD="cmdk-item-select",Zp="data-value",nxe=(t,e,n)=>Gwe(t,e,n),P8=_.createContext(void 0),v_=()=>_.useContext(P8),T8=_.createContext(void 0),iI=()=>_.useContext(T8),k8=_.createContext(void 0),D8=_.forwardRef((t,e)=>{let n=Jp(()=>{var q,K;return{search:"",value:(K=(q=t.value)!=null?q:t.defaultValue)!=null?K:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Jp(()=>new Set),s=Jp(()=>new Map),i=Jp(()=>new Map),a=Jp(()=>new Set),o=N8(t),{label:c,children:u,value:f,onValueChange:l,filter:d,shouldFilter:m,loop:p,disablePointerSelection:h=!1,vimBindings:y=!0,...g}=t,v=Dc(),w=Dc(),x=Dc(),A=_.useRef(null),k=hxe();Kh(()=>{if(f!==void 0){let q=f.trim();n.current.value=q,R.emit()}},[f]),Kh(()=>{k(6,I)},[]);let R=_.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>n.current,setState:(q,K,Z)=>{var ue,de,ie,be;if(!Object.is(n.current[q],K)){if(n.current[q]=K,q==="search")L(),D(),k(1,O);else if(q==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ae=document.getElementById(x);Ae?Ae.focus():(ue=document.getElementById(v))==null||ue.focus()}if(k(7,()=>{var Ae;n.current.selectedItemId=(Ae=F())==null?void 0:Ae.id,R.emit()}),Z||k(5,I),((de=o.current)==null?void 0:de.value)!==void 0){let Ae=K??"";(be=(ie=o.current).onValueChange)==null||be.call(ie,Ae);return}}R.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),E=_.useMemo(()=>({value:(q,K,Z)=>{var ue;K!==((ue=i.current.get(q))==null?void 0:ue.value)&&(i.current.set(q,{value:K,keywords:Z}),n.current.filtered.items.set(q,T(K,Z)),k(2,()=>{D(),R.emit()}))},item:(q,K)=>(r.current.add(q),K&&(s.current.has(K)?s.current.get(K).add(q):s.current.set(K,new Set([q]))),k(3,()=>{L(),D(),n.current.value||O(),R.emit()}),()=>{i.current.delete(q),r.current.delete(q),n.current.filtered.items.delete(q);let Z=F();k(4,()=>{L(),(Z==null?void 0:Z.getAttribute("id"))===q&&O(),R.emit()})}),group:q=>(s.current.has(q)||s.current.set(q,new Set),()=>{i.current.delete(q),s.current.delete(q)}),filter:()=>o.current.shouldFilter,label:c||t["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:x,labelId:w,listInnerRef:A}),[]);function T(q,K){var Z,ue;let de=(ue=(Z=o.current)==null?void 0:Z.filter)!=null?ue:nxe;return q?de(q,n.current.search,K):0}function D(){if(!n.current.search||o.current.shouldFilter===!1)return;let q=n.current.filtered.items,K=[];n.current.filtered.groups.forEach(ue=>{let de=s.current.get(ue),ie=0;de.forEach(be=>{let Ae=q.get(be);ie=Math.max(Ae,ie)}),K.push([ue,ie])});let Z=A.current;U().sort((ue,de)=>{var ie,be;let Ae=ue.getAttribute("id"),_e=de.getAttribute("id");return((ie=q.get(_e))!=null?ie:0)-((be=q.get(Ae))!=null?be:0)}).forEach(ue=>{let de=ue.closest(wT);de?de.appendChild(ue.parentElement===de?ue:ue.closest(`${wT} > *`)):Z.appendChild(ue.parentElement===Z?ue:ue.closest(`${wT} > *`))}),K.sort((ue,de)=>de[1]-ue[1]).forEach(ue=>{var de;let ie=(de=A.current)==null?void 0:de.querySelector(`${vy}[${Zp}="${encodeURIComponent(ue[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function O(){let q=U().find(Z=>Z.getAttribute("aria-disabled")!=="true"),K=q==null?void 0:q.getAttribute(Zp);R.setState("value",K||void 0)}function L(){var q,K,Z,ue;if(!n.current.search||o.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let de=0;for(let ie of r.current){let be=(K=(q=i.current.get(ie))==null?void 0:q.value)!=null?K:"",Ae=(ue=(Z=i.current.get(ie))==null?void 0:Z.keywords)!=null?ue:[],_e=T(be,Ae);n.current.filtered.items.set(ie,_e),_e>0&&de++}for(let[ie,be]of s.current)for(let Ae of be)if(n.current.filtered.items.get(Ae)>0){n.current.filtered.groups.add(ie);break}n.current.filtered.count=de}function I(){var q,K,Z;let ue=F();ue&&(((q=ue.parentElement)==null?void 0:q.firstChild)===ue&&((Z=(K=ue.closest(vy))==null?void 0:K.querySelector(txe))==null||Z.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function F(){var q;return(q=A.current)==null?void 0:q.querySelector(`${R8}[aria-selected="true"]`)}function U(){var q;return Array.from(((q=A.current)==null?void 0:q.querySelectorAll(Uz))||[])}function Y(q){let K=U()[q];K&&R.setState("value",K.getAttribute(Zp))}function V(q){var K;let Z=F(),ue=U(),de=ue.findIndex(be=>be===Z),ie=ue[de+q];(K=o.current)!=null&&K.loop&&(ie=de+q<0?ue[ue.length-1]:de+q===ue.length?ue[0]:ue[de+q]),ie&&R.setState("value",ie.getAttribute(Zp))}function H(q){let K=F(),Z=K==null?void 0:K.closest(vy),ue;for(;Z&&!ue;)Z=q>0?dxe(Z,vy):fxe(Z,vy),ue=Z==null?void 0:Z.querySelector(Uz);ue?R.setState("value",ue.getAttribute(Zp)):V(q)}let ee=()=>Y(U().length-1),re=q=>{q.preventDefault(),q.metaKey?ee():q.altKey?H(1):V(1)},X=q=>{q.preventDefault(),q.metaKey?Y(0):q.altKey?H(-1):V(-1)};return _.createElement(fs.div,{ref:e,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:q=>{var K;(K=g.onKeyDown)==null||K.call(g,q);let Z=q.nativeEvent.isComposing||q.keyCode===229;if(!(q.defaultPrevented||Z))switch(q.key){case"n":case"j":{y&&q.ctrlKey&&re(q);break}case"ArrowDown":{re(q);break}case"p":case"k":{y&&q.ctrlKey&&X(q);break}case"ArrowUp":{X(q);break}case"Home":{q.preventDefault(),Y(0);break}case"End":{q.preventDefault(),ee();break}case"Enter":{q.preventDefault();let ue=F();if(ue){let de=new Event(UD);ue.dispatchEvent(de)}}}}},_.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:mxe},c),sA(t,q=>_.createElement(T8.Provider,{value:R},_.createElement(P8.Provider,{value:E},q))))}),rxe=_.forwardRef((t,e)=>{var n,r;let s=Dc(),i=_.useRef(null),a=_.useContext(k8),o=v_(),c=N8(t),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;Kh(()=>{if(!u)return o.item(s,a==null?void 0:a.id)},[u]);let f=O8(s,i,[t.value,t.children,i],t.keywords),l=iI(),d=Sd(k=>k.value&&k.value===f.current),m=Sd(k=>u||o.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);_.useEffect(()=>{let k=i.current;if(!(!k||t.disabled))return k.addEventListener(UD,p),()=>k.removeEventListener(UD,p)},[m,t.onSelect,t.disabled]);function p(){var k,R;h(),(R=(k=c.current).onSelect)==null||R.call(k,f.current)}function h(){l.setState("value",f.current,!0)}if(!m)return null;let{disabled:y,value:g,onSelect:v,forceMount:w,keywords:x,...A}=t;return _.createElement(fs.div,{ref:Wh(i,e),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!d,"data-disabled":!!y,"data-selected":!!d,onPointerMove:y||o.getDisablePointerSelection()?void 0:h,onClick:y?void 0:p},t.children)}),sxe=_.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:s,...i}=t,a=Dc(),o=_.useRef(null),c=_.useRef(null),u=Dc(),f=v_(),l=Sd(m=>s||f.filter()===!1?!0:m.search?m.filtered.groups.has(a):!0);Kh(()=>f.group(a),[]),O8(a,o,[t.value,t.heading,c]);let d=_.useMemo(()=>({id:a,forceMount:s}),[s]);return _.createElement(fs.div,{ref:Wh(o,e),...i,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&_.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),sA(t,m=>_.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},_.createElement(k8.Provider,{value:d},m))))}),ixe=_.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,s=_.useRef(null),i=Sd(a=>!a.search);return!n&&!i?null:_.createElement(fs.div,{ref:Wh(s,e),...r,"cmdk-separator":"",role:"separator"})}),oxe=_.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,s=t.value!=null,i=iI(),a=Sd(u=>u.search),o=Sd(u=>u.selectedItemId),c=v_();return _.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),_.createElement(fs.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":o,id:c.inputId,type:"text",value:s?t.value:a,onChange:u=>{s||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),axe=_.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...s}=t,i=_.useRef(null),a=_.useRef(null),o=Sd(u=>u.selectedItemId),c=v_();return _.useEffect(()=>{if(a.current&&i.current){let u=a.current,f=i.current,l,d=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let m=u.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return d.observe(u),()=>{cancelAnimationFrame(l),d.unobserve(u)}}},[]),_.createElement(fs.div,{ref:Wh(i,e),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:c.listId},sA(t,u=>_.createElement("div",{ref:Wh(a,c.listInnerRef),"cmdk-list-sizer":""},u)))}),lxe=_.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:i,container:a,...o}=t;return _.createElement(Q_e,{open:n,onOpenChange:r},_.createElement(Z_e,{container:a},_.createElement(J_e,{"cmdk-overlay":"",className:s}),_.createElement(exe,{"aria-label":t.label,"cmdk-dialog":"",className:i},_.createElement(D8,{ref:e,...o}))))}),cxe=_.forwardRef((t,e)=>Sd(n=>n.filtered.count===0)?_.createElement(fs.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),uxe=_.forwardRef((t,e)=>{let{progress:n,children:r,label:s="Loading...",...i}=t;return _.createElement(fs.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},sA(t,a=>_.createElement("div",{"aria-hidden":!0},a)))}),Ai=Object.assign(D8,{List:axe,Item:rxe,Input:oxe,Group:sxe,Separator:ixe,Dialog:lxe,Empty:cxe,Loading:uxe});function dxe(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function fxe(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function N8(t){let e=_.useRef(t);return Kh(()=>{e.current=t}),e}var Kh=typeof window>"u"?_.useEffect:_.useLayoutEffect;function Jp(t){let e=_.useRef();return e.current===void 0&&(e.current=t()),e}function Sd(t){let e=iI(),n=()=>t(e.snapshot());return _.useSyncExternalStore(e.subscribe,n,n)}function O8(t,e,n,r=[]){let s=_.useRef(),i=v_();return Kh(()=>{var a;let o=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():s.current}})(),c=r.map(u=>u.trim());i.value(t,o,c),(a=e.current)==null||a.setAttribute(Zp,o),s.current=o}),s}var hxe=()=>{let[t,e]=_.useState(),n=Jp(()=>new Map);return Kh(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,s)=>{n.current.set(r,s),e({})}};function pxe(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function sA({asChild:t,children:e},n){return t&&_.isValidElement(e)?_.cloneElement(pxe(e),{ref:e.ref},n(e.props.children)):n(e)}var mxe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const gxe=CL,vxe=AL,yxe=RL,q4e=u_,M8=_.forwardRef(({className:t,...e},n)=>P.jsx(o_,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));M8.displayName=o_.displayName;const L8=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(yxe,{children:[P.jsx(M8,{}),P.jsxs(a_,{ref:r,className:ce("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...n,children:[e,P.jsxs(u_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[P.jsx(pL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));L8.displayName=a_.displayName;const I8=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});I8.displayName="DialogHeader";const $8=({className:t,...e})=>P.jsx("div",{className:ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});$8.displayName="DialogFooter";const F8=_.forwardRef(({className:t,...e},n)=>P.jsx(l_,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));F8.displayName=l_.displayName;const j8=_.forwardRef(({className:t,...e},n)=>P.jsx(c_,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));j8.displayName=c_.displayName;const bxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai,{ref:n,className:ce("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));bxe.displayName=Ai.displayName;const wxe=_.forwardRef(({className:t,...e},n)=>P.jsxs("div",{className:"flex items-center px-3 border-b","cmdk-input-wrapper":"",children:[P.jsx(Ofe,{className:"w-4 h-4 mr-2 opacity-50 shrink-0"}),P.jsx(Ai.Input,{ref:n,className:ce("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));wxe.displayName=Ai.Input.displayName;const _xe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.List,{ref:n,className:ce("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));_xe.displayName=Ai.List.displayName;const xxe=_.forwardRef((t,e)=>P.jsx(Ai.Empty,{ref:e,className:"py-6 text-sm text-center",...t}));xxe.displayName=Ai.Empty.displayName;const Sxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.Group,{ref:n,className:ce("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));Sxe.displayName=Ai.Group.displayName;const Exe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.Separator,{ref:n,className:ce("-mx-1 h-px bg-border",t),...e}));Exe.displayName=Ai.Separator.displayName;const Cxe=_.forwardRef(({className:t,...e},n)=>P.jsx(Ai.Item,{ref:n,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e}));Cxe.displayName=Ai.Item.displayName;const Axe=["top","right","bottom","left"],dl=Math.min,Zi=Math.max,sC=Math.round,oS=Math.floor,Ed=t=>({x:t,y:t}),Rxe={left:"right",right:"left",bottom:"top",top:"bottom"},Pxe={start:"end",end:"start"};function HD(t,e,n){return Zi(t,dl(e,n))}function Uc(t,e){return typeof t=="function"?t(e):t}function Hc(t){return t.split("-")[0]}function Av(t){return t.split("-")[1]}function oI(t){return t==="x"?"y":"x"}function aI(t){return t==="y"?"height":"width"}function Cd(t){return["top","bottom"].includes(Hc(t))?"y":"x"}function lI(t){return oI(Cd(t))}function Txe(t,e,n){n===void 0&&(n=!1);const r=Av(t),s=lI(t),i=aI(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=iC(a)),[a,iC(a)]}function kxe(t){const e=iC(t);return[VD(t),e,VD(e)]}function VD(t){return t.replace(/start|end/g,e=>Pxe[e])}function Dxe(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:a;default:return[]}}function Nxe(t,e,n,r){const s=Av(t);let i=Dxe(Hc(t),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),e&&(i=i.concat(i.map(VD)))),i}function iC(t){return t.replace(/left|right|bottom|top/g,e=>Rxe[e])}function Oxe(t){return{top:0,right:0,bottom:0,left:0,...t}}function z8(t){return typeof t!="number"?Oxe(t):{top:t,right:t,bottom:t,left:t}}function oC(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function Hz(t,e,n){let{reference:r,floating:s}=t;const i=Cd(e),a=lI(e),o=aI(a),c=Hc(e),u=i==="y",f=r.x+r.width/2-s.width/2,l=r.y+r.height/2-s.height/2,d=r[o]/2-s[o]/2;let m;switch(c){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:l};break;case"left":m={x:r.x-s.width,y:l};break;default:m={x:r.x,y:r.y}}switch(Av(e)){case"start":m[a]-=d*(n&&u?-1:1);break;case"end":m[a]+=d*(n&&u?-1:1);break}return m}const Mxe=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,o=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:s}),{x:f,y:l}=Hz(u,r,c),d=r,m={},p=0;for(let h=0;h({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:a,elements:o,middlewareData:c}=e,{element:u,padding:f=0}=Uc(t,e)||{};if(u==null)return{};const l=z8(f),d={x:n,y:r},m=lI(s),p=aI(m),h=await a.getDimensions(u),y=m==="y",g=y?"top":"left",v=y?"bottom":"right",w=y?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],A=d[m]-i.reference[m],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let R=k?k[w]:0;(!R||!await(a.isElement==null?void 0:a.isElement(k)))&&(R=o.floating[w]||i.floating[p]);const E=x/2-A/2,T=R/2-h[p]/2-1,D=dl(l[g],T),O=dl(l[v],T),L=D,I=R-h[p]-O,F=R/2-h[p]/2+E,U=HD(L,F,I),Y=!c.arrow&&Av(s)!=null&&F!==U&&i.reference[p]/2-(FF<=0)){var O,L;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,U=R[F];if(U)return{data:{index:F,overflows:D},reset:{placement:U}};let Y=(L=D.filter(V=>V.overflows[0]<=0).sort((V,H)=>V.overflows[1]-H.overflows[1])[0])==null?void 0:L.placement;if(!Y)switch(m){case"bestFit":{var I;const V=(I=D.filter(H=>{if(k){const ee=Cd(H.placement);return ee===v||ee==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ee=>ee>0).reduce((ee,re)=>ee+re,0)]).sort((H,ee)=>H[1]-ee[1])[0])==null?void 0:I[0];V&&(Y=V);break}case"initialPlacement":Y=o;break}if(s!==Y)return{reset:{placement:Y}}}return{}}}};function Vz(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Wz(t){return Axe.some(e=>t[e]>=0)}const $xe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=Uc(t,e);switch(r){case"referenceHidden":{const i=await qb(e,{...s,elementContext:"reference"}),a=Vz(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Wz(a)}}}case"escaped":{const i=await qb(e,{...s,altBoundary:!0}),a=Vz(i,n.floating);return{data:{escapedOffsets:a,escaped:Wz(a)}}}default:return{}}}}};async function Fxe(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Hc(n),o=Av(n),c=Cd(n)==="y",u=["left","top"].includes(a)?-1:1,f=i&&c?-1:1,l=Uc(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return o&&typeof p=="number"&&(m=o==="end"?p*-1:p),c?{x:m*f,y:d*u}:{x:d*u,y:m*f}}const jxe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:a,middlewareData:o}=e,c=await Fxe(e,t);return a===((n=o.offset)==null?void 0:n.placement)&&(r=o.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},zxe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:o={fn:y=>{let{x:g,y:v}=y;return{x:g,y:v}}},...c}=Uc(t,e),u={x:n,y:r},f=await qb(e,c),l=Cd(Hc(s)),d=oI(l);let m=u[d],p=u[l];if(i){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",v=m+f[y],w=m-f[g];m=HD(v,m,w)}if(a){const y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",v=p+f[y],w=p-f[g];p=HD(v,p,w)}const h=o.fn({...e,[d]:m,[l]:p});return{...h,data:{x:h.x-n,y:h.y-r}}}}},Bxe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=e,{offset:o=0,mainAxis:c=!0,crossAxis:u=!0}=Uc(t,e),f={x:n,y:r},l=Cd(s),d=oI(l);let m=f[d],p=f[l];const h=Uc(o,e),y=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){const w=d==="y"?"height":"width",x=i.reference[d]-i.floating[w]+y.mainAxis,A=i.reference[d]+i.reference[w]-y.mainAxis;mA&&(m=A)}if(u){var g,v;const w=d==="y"?"width":"height",x=["top","left"].includes(Hc(s)),A=i.reference[l]-i.floating[w]+(x&&((g=a.offset)==null?void 0:g[l])||0)+(x?0:y.crossAxis),k=i.reference[l]+i.reference[w]+(x?0:((v=a.offset)==null?void 0:v[l])||0)-(x?y.crossAxis:0);pk&&(p=k)}return{[d]:m,[l]:p}}}},Uxe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:r,platform:s,elements:i}=e,{apply:a=()=>{},...o}=Uc(t,e),c=await qb(e,o),u=Hc(n),f=Av(n),l=Cd(n)==="y",{width:d,height:m}=r.floating;let p,h;u==="top"||u==="bottom"?(p=u,h=f===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(h=u,p=f==="end"?"top":"bottom");const y=m-c.top-c.bottom,g=d-c.left-c.right,v=dl(m-c[p],y),w=dl(d-c[h],g),x=!e.middlewareData.shift;let A=v,k=w;if(l?k=f||x?dl(w,g):g:A=f||x?dl(v,y):y,x&&!f){const E=Zi(c.left,0),T=Zi(c.right,0),D=Zi(c.top,0),O=Zi(c.bottom,0);l?k=d-2*(E!==0||T!==0?E+T:Zi(c.left,c.right)):A=m-2*(D!==0||O!==0?D+O:Zi(c.top,c.bottom))}await a({...e,availableWidth:k,availableHeight:A});const R=await s.getDimensions(i.floating);return d!==R.width||m!==R.height?{reset:{rects:!0}}:{}}}};function Rv(t){return B8(t)?(t.nodeName||"").toLowerCase():"#document"}function ro(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Qc(t){var e;return(e=(B8(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function B8(t){return t instanceof Node||t instanceof ro(t).Node}function wl(t){return t instanceof Element||t instanceof ro(t).Element}function _l(t){return t instanceof HTMLElement||t instanceof ro(t).HTMLElement}function Gz(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ro(t).ShadowRoot}function y_(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=Ra(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function Hxe(t){return["table","td","th"].includes(Rv(t))}function iA(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function cI(t){const e=uI(),n=Ra(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Vxe(t){let e=Ad(t);for(;_l(e)&&!ov(e);){if(iA(e))return null;if(cI(e))return e;e=Ad(e)}return null}function uI(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ov(t){return["html","body","#document"].includes(Rv(t))}function Ra(t){return ro(t).getComputedStyle(t)}function oA(t){return wl(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ad(t){if(Rv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Gz(t)&&t.host||Qc(t);return Gz(e)?e.host:e}function U8(t){const e=Ad(t);return ov(e)?t.ownerDocument?t.ownerDocument.body:t.body:_l(e)&&y_(e)?e:U8(e)}function Kb(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=U8(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),a=ro(s);return i?e.concat(a,a.visualViewport||[],y_(s)?s:[],a.frameElement&&n?Kb(a.frameElement):[]):e.concat(s,Kb(s,[],n))}function H8(t){const e=Ra(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=_l(t),i=s?t.offsetWidth:n,a=s?t.offsetHeight:r,o=sC(n)!==i||sC(r)!==a;return o&&(n=i,r=a),{width:n,height:r,$:o}}function dI(t){return wl(t)?t:t.contextElement}function Im(t){const e=dI(t);if(!_l(e))return Ed(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=H8(e);let a=(i?sC(n.width):n.width)/r,o=(i?sC(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Wxe=Ed(0);function V8(t){const e=ro(t);return!uI()||!e.visualViewport?Wxe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Gxe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ro(t)?!1:e}function Yh(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=dI(t);let a=Ed(1);e&&(r?wl(r)&&(a=Im(r)):a=Im(t));const o=Gxe(i,n,r)?V8(i):Ed(0);let c=(s.left+o.x)/a.x,u=(s.top+o.y)/a.y,f=s.width/a.x,l=s.height/a.y;if(i){const d=ro(i),m=r&&wl(r)?ro(r):r;let p=d,h=p.frameElement;for(;h&&r&&m!==p;){const y=Im(h),g=h.getBoundingClientRect(),v=Ra(h),w=g.left+(h.clientLeft+parseFloat(v.paddingLeft))*y.x,x=g.top+(h.clientTop+parseFloat(v.paddingTop))*y.y;c*=y.x,u*=y.y,f*=y.x,l*=y.y,c+=w,u+=x,p=ro(h),h=p.frameElement}}return oC({width:f,height:l,x:c,y:u})}function qxe(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",a=Qc(r),o=e?iA(e.floating):!1;if(r===a||o&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ed(1);const f=Ed(0),l=_l(r);if((l||!l&&!i)&&((Rv(r)!=="body"||y_(a))&&(c=oA(r)),_l(r))){const d=Yh(r);u=Im(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+f.x,y:n.y*u.y-c.scrollTop*u.y+f.y}}function Kxe(t){return Array.from(t.getClientRects())}function W8(t){return Yh(Qc(t)).left+oA(t).scrollLeft}function Yxe(t){const e=Qc(t),n=oA(t),r=t.ownerDocument.body,s=Zi(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=Zi(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+W8(t);const o=-n.scrollTop;return Ra(r).direction==="rtl"&&(a+=Zi(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:o}}function Xxe(t,e){const n=ro(t),r=Qc(t),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,o=0,c=0;if(s){i=s.width,a=s.height;const u=uI();(!u||u&&e==="fixed")&&(o=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:o,y:c}}function Qxe(t,e){const n=Yh(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=_l(t)?Im(t):Ed(1),a=t.clientWidth*i.x,o=t.clientHeight*i.y,c=s*i.x,u=r*i.y;return{width:a,height:o,x:c,y:u}}function qz(t,e,n){let r;if(e==="viewport")r=Xxe(t,n);else if(e==="document")r=Yxe(Qc(t));else if(wl(e))r=Qxe(e,n);else{const s=V8(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return oC(r)}function G8(t,e){const n=Ad(t);return n===e||!wl(n)||ov(n)?!1:Ra(n).position==="fixed"||G8(n,e)}function Zxe(t,e){const n=e.get(t);if(n)return n;let r=Kb(t,[],!1).filter(o=>wl(o)&&Rv(o)!=="body"),s=null;const i=Ra(t).position==="fixed";let a=i?Ad(t):t;for(;wl(a)&&!ov(a);){const o=Ra(a),c=cI(a);!c&&o.position==="fixed"&&(s=null),(i?!c&&!s:!c&&o.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||y_(a)&&!c&&G8(t,a))?r=r.filter(f=>f!==a):s=o,a=Ad(a)}return e.set(t,r),r}function Jxe(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const a=[...n==="clippingAncestors"?iA(e)?[]:Zxe(e,this._c):[].concat(n),r],o=a[0],c=a.reduce((u,f)=>{const l=qz(e,f,s);return u.top=Zi(l.top,u.top),u.right=dl(l.right,u.right),u.bottom=dl(l.bottom,u.bottom),u.left=Zi(l.left,u.left),u},qz(e,o,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function eSe(t){const{width:e,height:n}=H8(t);return{width:e,height:n}}function tSe(t,e,n){const r=_l(e),s=Qc(e),i=n==="fixed",a=Yh(t,!0,i,e);let o={scrollLeft:0,scrollTop:0};const c=Ed(0);if(r||!r&&!i)if((Rv(e)!=="body"||y_(s))&&(o=oA(e)),r){const l=Yh(e,!0,i,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else s&&(c.x=W8(s));const u=a.left+o.scrollLeft-c.x,f=a.top+o.scrollTop-c.y;return{x:u,y:f,width:a.width,height:a.height}}function _T(t){return Ra(t).position==="static"}function Kz(t,e){return!_l(t)||Ra(t).position==="fixed"?null:e?e(t):t.offsetParent}function q8(t,e){const n=ro(t);if(iA(t))return n;if(!_l(t)){let s=Ad(t);for(;s&&!ov(s);){if(wl(s)&&!_T(s))return s;s=Ad(s)}return n}let r=Kz(t,e);for(;r&&Hxe(r)&&_T(r);)r=Kz(r,e);return r&&ov(r)&&_T(r)&&!cI(r)?n:r||Vxe(t)||n}const nSe=async function(t){const e=this.getOffsetParent||q8,n=this.getDimensions,r=await n(t.floating);return{reference:tSe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function rSe(t){return Ra(t).direction==="rtl"}const sSe={convertOffsetParentRelativeRectToViewportRelativeRect:qxe,getDocumentElement:Qc,getClippingRect:Jxe,getOffsetParent:q8,getElementRects:nSe,getClientRects:Kxe,getDimensions:eSe,getScale:Im,isElement:wl,isRTL:rSe};function iSe(t,e){let n=null,r;const s=Qc(t);function i(){var o;clearTimeout(r),(o=n)==null||o.disconnect(),n=null}function a(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),i();const{left:u,top:f,width:l,height:d}=t.getBoundingClientRect();if(o||e(),!l||!d)return;const m=oS(f),p=oS(s.clientWidth-(u+l)),h=oS(s.clientHeight-(f+d)),y=oS(u),v={rootMargin:-m+"px "+-p+"px "+-h+"px "+-y+"px",threshold:Zi(0,dl(1,c))||1};let w=!0;function x(A){const k=A[0].intersectionRatio;if(k!==c){if(!w)return a();k?a(!1,k):r=setTimeout(()=>{a(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(t)}return a(!0),i}function oSe(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=dI(t),f=s||i?[...u?Kb(u):[],...Kb(e)]:[];f.forEach(g=>{s&&g.addEventListener("scroll",n,{passive:!0}),i&&g.addEventListener("resize",n)});const l=u&&o?iSe(u,n):null;let d=-1,m=null;a&&(m=new ResizeObserver(g=>{let[v]=g;v&&v.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(e)})),n()}),u&&!c&&m.observe(u),m.observe(e));let p,h=c?Yh(t):null;c&&y();function y(){const g=Yh(t);h&&(g.x!==h.x||g.y!==h.y||g.width!==h.width||g.height!==h.height)&&n(),h=g,p=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),l==null||l(),(g=m)==null||g.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const aSe=jxe,lSe=zxe,cSe=Ixe,uSe=Uxe,dSe=$xe,Yz=Lxe,fSe=Bxe,hSe=(t,e,n)=>{const r=new Map,s={platform:sSe,...n},i={...s.platform,_c:r};return Mxe(t,e,{...s,platform:i})};var US=typeof document<"u"?_.useLayoutEffect:_.useEffect;function aC(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!aC(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!aC(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function K8(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Xz(t,e){const n=K8(t);return Math.round(e*n)/n}function Qz(t){const e=_.useRef(t);return US(()=>{e.current=t}),e}function pSe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:o=!0,whileElementsMounted:c,open:u}=t,[f,l]=_.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[d,m]=_.useState(r);aC(d,r)||m(r);const[p,h]=_.useState(null),[y,g]=_.useState(null),v=_.useCallback(V=>{V!==k.current&&(k.current=V,h(V))},[]),w=_.useCallback(V=>{V!==R.current&&(R.current=V,g(V))},[]),x=i||p,A=a||y,k=_.useRef(null),R=_.useRef(null),E=_.useRef(f),T=c!=null,D=Qz(c),O=Qz(s),L=_.useCallback(()=>{if(!k.current||!R.current)return;const V={placement:e,strategy:n,middleware:d};O.current&&(V.platform=O.current),hSe(k.current,R.current,V).then(H=>{const ee={...H,isPositioned:!0};I.current&&!aC(E.current,ee)&&(E.current=ee,ks.flushSync(()=>{l(ee)}))})},[d,e,n,O]);US(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,l(V=>({...V,isPositioned:!1})))},[u]);const I=_.useRef(!1);US(()=>(I.current=!0,()=>{I.current=!1}),[]),US(()=>{if(x&&(k.current=x),A&&(R.current=A),x&&A){if(D.current)return D.current(x,A,L);L()}},[x,A,L,D,T]);const F=_.useMemo(()=>({reference:k,floating:R,setReference:v,setFloating:w}),[v,w]),U=_.useMemo(()=>({reference:x,floating:A}),[x,A]),Y=_.useMemo(()=>{const V={position:n,left:0,top:0};if(!U.floating)return V;const H=Xz(U.floating,f.x),ee=Xz(U.floating,f.y);return o?{...V,transform:"translate("+H+"px, "+ee+"px)",...K8(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:ee}},[n,o,U.floating,f.x,f.y]);return _.useMemo(()=>({...f,update:L,refs:F,elements:U,floatingStyles:Y}),[f,L,F,U,Y])}const mSe=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?Yz({element:r.current,padding:s}).fn(n):{}:r?Yz({element:r,padding:s}).fn(n):{}}}},gSe=(t,e)=>({...aSe(t),options:[t,e]}),vSe=(t,e)=>({...lSe(t),options:[t,e]}),ySe=(t,e)=>({...fSe(t),options:[t,e]}),bSe=(t,e)=>({...cSe(t),options:[t,e]}),wSe=(t,e)=>({...uSe(t),options:[t,e]}),_Se=(t,e)=>({...dSe(t),options:[t,e]}),xSe=(t,e)=>({...mSe(t),options:[t,e]});var SSe="Arrow",Y8=_.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return P.jsx(De.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:P.jsx("polygon",{points:"0,0 30,0 15,10"})})});Y8.displayName=SSe;var ESe=Y8,fI="Popper",[X8,El]=Pn(fI),[CSe,Q8]=X8(fI),Z8=t=>{const{__scopePopper:e,children:n}=t,[r,s]=_.useState(null);return P.jsx(CSe,{scope:e,anchor:r,onAnchorChange:s,children:n})};Z8.displayName=fI;var J8="PopperAnchor",eG=_.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=Q8(J8,n),a=_.useRef(null),o=tt(e,a);return _.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:P.jsx(De.div,{...s,ref:o})});eG.displayName=J8;var hI="PopperContent",[ASe,RSe]=X8(hI),tG=_.forwardRef((t,e)=>{var ie,be,Ae,_e,Me,Ne;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:l="partial",hideWhenDetached:d=!1,updatePositionStrategy:m="optimized",onPlaced:p,...h}=t,y=Q8(hI,n),[g,v]=_.useState(null),w=tt(e,ye=>v(ye)),[x,A]=_.useState(null),k=g_(x),R=(k==null?void 0:k.width)??0,E=(k==null?void 0:k.height)??0,T=r+(i!=="center"?"-"+i:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},O=Array.isArray(u)?u:[u],L=O.length>0,I={padding:D,boundary:O.filter(TSe),altBoundary:L},{refs:F,floatingStyles:U,placement:Y,isPositioned:V,middlewareData:H}=pSe({strategy:"fixed",placement:T,whileElementsMounted:(...ye)=>oSe(...ye,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[gSe({mainAxis:s+E,alignmentAxis:a}),c&&vSe({mainAxis:!0,crossAxis:!1,limiter:l==="partial"?ySe():void 0,...I}),c&&bSe({...I}),wSe({...I,apply:({elements:ye,rects:$e,availableWidth:ut,availableHeight:Qe})=>{const{width:vt,height:Sn}=$e.reference,Yt=ye.floating.style;Yt.setProperty("--radix-popper-available-width",`${ut}px`),Yt.setProperty("--radix-popper-available-height",`${Qe}px`),Yt.setProperty("--radix-popper-anchor-width",`${vt}px`),Yt.setProperty("--radix-popper-anchor-height",`${Sn}px`)}}),x&&xSe({element:x,padding:o}),kSe({arrowWidth:R,arrowHeight:E}),d&&_Se({strategy:"referenceHidden",...I})]}),[ee,re]=sG(Y),X=Bt(p);Mn(()=>{V&&(X==null||X())},[V,X]);const q=(ie=H.arrow)==null?void 0:ie.x,K=(be=H.arrow)==null?void 0:be.y,Z=((Ae=H.arrow)==null?void 0:Ae.centerOffset)!==0,[ue,de]=_.useState();return Mn(()=>{g&&de(window.getComputedStyle(g).zIndex)},[g]),P.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:V?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(_e=H.transformOrigin)==null?void 0:_e.x,(Me=H.transformOrigin)==null?void 0:Me.y].join(" "),...((Ne=H.hide)==null?void 0:Ne.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:P.jsx(ASe,{scope:n,placedSide:ee,onArrowChange:A,arrowX:q,arrowY:K,shouldHideArrow:Z,children:P.jsx(De.div,{"data-side":ee,"data-align":re,...h,ref:w,style:{...h.style,animation:V?void 0:"none"}})})})});tG.displayName=hI;var nG="PopperArrow",PSe={top:"bottom",right:"left",bottom:"top",left:"right"},rG=_.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=RSe(nG,r),a=PSe[i.placedSide];return P.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:P.jsx(ESe,{...s,ref:n,style:{...s.style,display:"block"}})})});rG.displayName=nG;function TSe(t){return t!==null}var kSe=t=>({name:"transformOrigin",options:t,fn(e){var y,g,v;const{placement:n,rects:r,middlewareData:s}=e,a=((y=s.arrow)==null?void 0:y.centerOffset)!==0,o=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,f]=sG(n),l={start:"0%",center:"50%",end:"100%"}[f],d=(((g=s.arrow)==null?void 0:g.x)??0)+o/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let p="",h="";return u==="bottom"?(p=a?l:`${d}px`,h=`${-c}px`):u==="top"?(p=a?l:`${d}px`,h=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,h=a?l:`${m}px`):u==="left"&&(p=`${r.floating.width+c}px`,h=a?l:`${m}px`),{data:{x:p,y:h}}}});function sG(t){const[e,n="center"]=t.split("-");return[e,n]}var aA=Z8,Pv=eG,b_=tG,w_=rG,xT="rovingFocusGroup.onEntryFocus",DSe={bubbles:!1,cancelable:!0},lA="RovingFocusGroup",[WD,iG,NSe]=qc(lA),[OSe,Cl]=Pn(lA,[NSe]),[MSe,LSe]=OSe(lA),oG=_.forwardRef((t,e)=>P.jsx(WD.Provider,{scope:t.__scopeRovingFocusGroup,children:P.jsx(WD.Slot,{scope:t.__scopeRovingFocusGroup,children:P.jsx(ISe,{...t,ref:e})})}));oG.displayName=lA;var ISe=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...l}=t,d=_.useRef(null),m=tt(e,d),p=ka(i),[h=null,y]=sr({prop:a,defaultProp:o,onChange:c}),[g,v]=_.useState(!1),w=Bt(u),x=iG(n),A=_.useRef(!1),[k,R]=_.useState(0);return _.useEffect(()=>{const E=d.current;if(E)return E.addEventListener(xT,w),()=>E.removeEventListener(xT,w)},[w]),P.jsx(MSe,{scope:n,orientation:r,dir:p,loop:s,currentTabStopId:h,onItemFocus:_.useCallback(E=>y(E),[y]),onItemShiftTab:_.useCallback(()=>v(!0),[]),onFocusableItemAdd:_.useCallback(()=>R(E=>E+1),[]),onFocusableItemRemove:_.useCallback(()=>R(E=>E-1),[]),children:P.jsx(De.div,{tabIndex:g||k===0?-1:0,"data-orientation":r,...l,ref:m,style:{outline:"none",...t.style},onMouseDown:me(t.onMouseDown,()=>{A.current=!0}),onFocus:me(t.onFocus,E=>{const T=!A.current;if(E.target===E.currentTarget&&T&&!g){const D=new CustomEvent(xT,DSe);if(E.currentTarget.dispatchEvent(D),!D.defaultPrevented){const O=x().filter(Y=>Y.focusable),L=O.find(Y=>Y.active),I=O.find(Y=>Y.id===h),U=[L,I,...O].filter(Boolean).map(Y=>Y.ref.current);cG(U,f)}}A.current=!1}),onBlur:me(t.onBlur,()=>v(!1))})})}),aG="RovingFocusGroupItem",lG=_.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,...a}=t,o=Hr(),c=i||o,u=LSe(aG,n),f=u.currentTabStopId===c,l=iG(n),{onFocusableItemAdd:d,onFocusableItemRemove:m}=u;return _.useEffect(()=>{if(r)return d(),()=>m()},[r,d,m]),P.jsx(WD.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:P.jsx(De.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:me(t.onMouseDown,p=>{r?u.onItemFocus(c):p.preventDefault()}),onFocus:me(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:me(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){u.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=jSe(p,u.orientation,u.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let g=l().filter(v=>v.focusable).map(v=>v.ref.current);if(h==="last")g.reverse();else if(h==="prev"||h==="next"){h==="prev"&&g.reverse();const v=g.indexOf(p.currentTarget);g=u.loop?zSe(g,v+1):g.slice(v+1)}setTimeout(()=>cG(g))}})})})});lG.displayName=aG;var $Se={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function FSe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function jSe(t,e,n){const r=FSe(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $Se[r]}function cG(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function zSe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var __=oG,x_=lG,GD=["Enter"," "],BSe=["ArrowDown","PageUp","Home"],uG=["ArrowUp","PageDown","End"],USe=[...BSe,...uG],HSe={ltr:[...GD,"ArrowRight"],rtl:[...GD,"ArrowLeft"]},VSe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},S_="Menu",[Yb,WSe,GSe]=qc(S_),[hp,E_]=Pn(S_,[GSe,El,Cl]),cA=El(),dG=Cl(),[qSe,pp]=hp(S_),[KSe,C_]=hp(S_),fG=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:s,onOpenChange:i,modal:a=!0}=t,o=cA(e),[c,u]=_.useState(null),f=_.useRef(!1),l=Bt(i),d=ka(s);return _.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),P.jsx(aA,{...o,children:P.jsx(qSe,{scope:e,open:n,onOpenChange:l,content:c,onContentChange:u,children:P.jsx(KSe,{scope:e,onClose:_.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:f,dir:d,modal:a,children:r})})})};fG.displayName=S_;var YSe="MenuAnchor",pI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=cA(n);return P.jsx(Pv,{...s,...r,ref:e})});pI.displayName=YSe;var mI="MenuPortal",[XSe,hG]=hp(mI,{forceMount:void 0}),pG=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:s}=t,i=pp(mI,e);return P.jsx(XSe,{scope:e,forceMount:n,children:P.jsx(Un,{present:n||i.open,children:P.jsx(wv,{asChild:!0,container:s,children:r})})})};pG.displayName=mI;var Lo="MenuContent",[QSe,gI]=hp(Lo),mG=_.forwardRef((t,e)=>{const n=hG(Lo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=pp(Lo,t.__scopeMenu),a=C_(Lo,t.__scopeMenu);return P.jsx(Yb.Provider,{scope:t.__scopeMenu,children:P.jsx(Un,{present:r||i.open,children:P.jsx(Yb.Slot,{scope:t.__scopeMenu,children:a.modal?P.jsx(ZSe,{...s,ref:e}):P.jsx(JSe,{...s,ref:e})})})})}),ZSe=_.forwardRef((t,e)=>{const n=pp(Lo,t.__scopeMenu),r=_.useRef(null),s=tt(e,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(vI,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),JSe=_.forwardRef((t,e)=>{const n=pp(Lo,t.__scopeMenu);return P.jsx(vI,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),vI=_.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,disableOutsideScroll:p,...h}=t,y=pp(Lo,n),g=C_(Lo,n),v=cA(n),w=dG(n),x=WSe(n),[A,k]=_.useState(null),R=_.useRef(null),E=tt(e,R,y.onContentChange),T=_.useRef(0),D=_.useRef(""),O=_.useRef(0),L=_.useRef(null),I=_.useRef("right"),F=_.useRef(0),U=p?i_:_.Fragment,Y=p?{as:Ea,allowPinchZoom:!0}:void 0,V=ee=>{var ie,be;const re=D.current+ee,X=x().filter(Ae=>!Ae.disabled),q=document.activeElement,K=(ie=X.find(Ae=>Ae.ref.current===q))==null?void 0:ie.textValue,Z=X.map(Ae=>Ae.textValue),ue=dEe(Z,re,K),de=(be=X.find(Ae=>Ae.textValue===ue))==null?void 0:be.ref.current;(function Ae(_e){D.current=_e,window.clearTimeout(T.current),_e!==""&&(T.current=window.setTimeout(()=>Ae(""),1e3))})(re),de&&setTimeout(()=>de.focus())};_.useEffect(()=>()=>window.clearTimeout(T.current),[]),$1();const H=_.useCallback(ee=>{var X,q;return I.current===((X=L.current)==null?void 0:X.side)&&hEe(ee,(q=L.current)==null?void 0:q.area)},[]);return P.jsx(QSe,{scope:n,searchRef:D,onItemEnter:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),onItemLeave:_.useCallback(ee=>{var re;H(ee)||((re=R.current)==null||re.focus(),k(null))},[H]),onTriggerLeave:_.useCallback(ee=>{H(ee)&&ee.preventDefault()},[H]),pointerGraceTimerRef:O,onPointerGraceIntentChange:_.useCallback(ee=>{L.current=ee},[]),children:P.jsx(U,{...Y,children:P.jsx(s_,{asChild:!0,trapped:s,onMountAutoFocus:me(i,ee=>{var re;ee.preventDefault(),(re=R.current)==null||re.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,onDismiss:m,children:P.jsx(__,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:k,onEntryFocus:me(c,ee=>{g.isUsingKeyboardRef.current||ee.preventDefault()}),preventScrollOnEntryFocus:!0,children:P.jsx(b_,{role:"menu","aria-orientation":"vertical","data-state":DG(y.open),"data-radix-menu-content":"",dir:g.dir,...v,...h,ref:E,style:{outline:"none",...h.style},onKeyDown:me(h.onKeyDown,ee=>{const X=ee.target.closest("[data-radix-menu-content]")===ee.currentTarget,q=ee.ctrlKey||ee.altKey||ee.metaKey,K=ee.key.length===1;X&&(ee.key==="Tab"&&ee.preventDefault(),!q&&K&&V(ee.key));const Z=R.current;if(ee.target!==Z||!USe.includes(ee.key))return;ee.preventDefault();const de=x().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);uG.includes(ee.key)&&de.reverse(),cEe(de)}),onBlur:me(t.onBlur,ee=>{ee.currentTarget.contains(ee.target)||(window.clearTimeout(T.current),D.current="")}),onPointerMove:me(t.onPointerMove,Xb(ee=>{const re=ee.target,X=F.current!==ee.clientX;if(ee.currentTarget.contains(re)&&X){const q=ee.clientX>F.current?"right":"left";I.current=q,F.current=ee.clientX}}))})})})})})})});mG.displayName=Lo;var eEe="MenuGroup",yI=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{role:"group",...r,ref:e})});yI.displayName=eEe;var tEe="MenuLabel",gG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});gG.displayName=tEe;var lC="MenuItem",Zz="menu.itemSelect",uA=_.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...s}=t,i=_.useRef(null),a=C_(lC,t.__scopeMenu),o=gI(lC,t.__scopeMenu),c=tt(e,i),u=_.useRef(!1),f=()=>{const l=i.current;if(!n&&l){const d=new CustomEvent(Zz,{bubbles:!0,cancelable:!0});l.addEventListener(Zz,m=>r==null?void 0:r(m),{once:!0}),Hb(l,d),d.defaultPrevented?u.current=!1:a.onClose()}};return P.jsx(vG,{...s,ref:c,disabled:n,onClick:me(t.onClick,f),onPointerDown:l=>{var d;(d=t.onPointerDown)==null||d.call(t,l),u.current=!0},onPointerUp:me(t.onPointerUp,l=>{var d;u.current||(d=l.currentTarget)==null||d.click()}),onKeyDown:me(t.onKeyDown,l=>{const d=o.searchRef.current!=="";n||d&&l.key===" "||GD.includes(l.key)&&(l.currentTarget.click(),l.preventDefault())})})});uA.displayName=lC;var vG=_.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=t,a=gI(lC,n),o=dG(n),c=_.useRef(null),u=tt(e,c),[f,l]=_.useState(!1),[d,m]=_.useState("");return _.useEffect(()=>{const p=c.current;p&&m((p.textContent??"").trim())},[i.children]),P.jsx(Yb.ItemSlot,{scope:n,disabled:r,textValue:s??d,children:P.jsx(x_,{asChild:!0,...o,focusable:!r,children:P.jsx(De.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:me(t.onPointerMove,Xb(p=>{r?a.onItemLeave(p):(a.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(t.onPointerLeave,Xb(p=>a.onItemLeave(p))),onFocus:me(t.onFocus,()=>l(!0)),onBlur:me(t.onBlur,()=>l(!1))})})})}),nEe="MenuCheckboxItem",yG=_.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...s}=t;return P.jsx(SG,{scope:t.__scopeMenu,checked:n,children:P.jsx(uA,{role:"menuitemcheckbox","aria-checked":cC(n)?"mixed":n,...s,ref:e,"data-state":wI(n),onSelect:me(s.onSelect,()=>r==null?void 0:r(cC(n)?!0:!n),{checkForDefaultPrevented:!1})})})});yG.displayName=nEe;var bG="MenuRadioGroup",[rEe,sEe]=hp(bG,{value:void 0,onValueChange:()=>{}}),wG=_.forwardRef((t,e)=>{const{value:n,onValueChange:r,...s}=t,i=Bt(r);return P.jsx(rEe,{scope:t.__scopeMenu,value:n,onValueChange:i,children:P.jsx(yI,{...s,ref:e})})});wG.displayName=bG;var _G="MenuRadioItem",xG=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=sEe(_G,t.__scopeMenu),i=n===s.value;return P.jsx(SG,{scope:t.__scopeMenu,checked:i,children:P.jsx(uA,{role:"menuitemradio","aria-checked":i,...r,ref:e,"data-state":wI(i),onSelect:me(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});xG.displayName=_G;var bI="MenuItemIndicator",[SG,iEe]=hp(bI,{checked:!1}),EG=_.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...s}=t,i=iEe(bI,n);return P.jsx(Un,{present:r||cC(i.checked)||i.checked===!0,children:P.jsx(De.span,{...s,ref:e,"data-state":wI(i.checked)})})});EG.displayName=bI;var oEe="MenuSeparator",CG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return P.jsx(De.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});CG.displayName=oEe;var aEe="MenuArrow",AG=_.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,s=cA(n);return P.jsx(w_,{...s,...r,ref:e})});AG.displayName=aEe;var lEe="MenuSub",[K4e,RG]=hp(lEe),$y="MenuSubTrigger",PG=_.forwardRef((t,e)=>{const n=pp($y,t.__scopeMenu),r=C_($y,t.__scopeMenu),s=RG($y,t.__scopeMenu),i=gI($y,t.__scopeMenu),a=_.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},f=_.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return _.useEffect(()=>f,[f]),_.useEffect(()=>{const l=o.current;return()=>{window.clearTimeout(l),c(null)}},[o,c]),P.jsx(pI,{asChild:!0,...u,children:P.jsx(vG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":DG(n.open),...t,ref:t_(e,s.onTriggerChange),onClick:l=>{var d;(d=t.onClick)==null||d.call(t,l),!(t.disabled||l.defaultPrevented)&&(l.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(t.onPointerMove,Xb(l=>{i.onItemEnter(l),!l.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:me(t.onPointerLeave,Xb(l=>{var m,p;f();const d=(m=n.content)==null?void 0:m.getBoundingClientRect();if(d){const h=(p=n.content)==null?void 0:p.dataset.side,y=h==="right",g=y?-5:5,v=d[y?"left":"right"],w=d[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:l.clientX+g,y:l.clientY},{x:v,y:d.top},{x:w,y:d.top},{x:w,y:d.bottom},{x:v,y:d.bottom}],side:h}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(l),l.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:me(t.onKeyDown,l=>{var m;const d=i.searchRef.current!=="";t.disabled||d&&l.key===" "||HSe[r.dir].includes(l.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),l.preventDefault())})})})});PG.displayName=$y;var TG="MenuSubContent",kG=_.forwardRef((t,e)=>{const n=hG(Lo,t.__scopeMenu),{forceMount:r=n.forceMount,...s}=t,i=pp(Lo,t.__scopeMenu),a=C_(Lo,t.__scopeMenu),o=RG(TG,t.__scopeMenu),c=_.useRef(null),u=tt(e,c);return P.jsx(Yb.Provider,{scope:t.__scopeMenu,children:P.jsx(Un,{present:r||i.open,children:P.jsx(Yb.Slot,{scope:t.__scopeMenu,children:P.jsx(vI,{id:o.contentId,"aria-labelledby":o.triggerId,...s,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var l;a.isUsingKeyboardRef.current&&((l=c.current)==null||l.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:me(t.onFocusOutside,f=>{f.target!==o.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:me(t.onEscapeKeyDown,f=>{a.onClose(),f.preventDefault()}),onKeyDown:me(t.onKeyDown,f=>{var m;const l=f.currentTarget.contains(f.target),d=VSe[a.dir].includes(f.key);l&&d&&(i.onOpenChange(!1),(m=o.trigger)==null||m.focus(),f.preventDefault())})})})})})});kG.displayName=TG;function DG(t){return t?"open":"closed"}function cC(t){return t==="indeterminate"}function wI(t){return cC(t)?"indeterminate":t?"checked":"unchecked"}function cEe(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function uEe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function dEe(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=uEe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function fEe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function hEe(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return fEe(n,e)}function Xb(t){return e=>e.pointerType==="mouse"?t(e):void 0}var pEe=fG,_I=pI,xI=pG,SI=mG,EI=yI,CI=gG,AI=uA,RI=yG,PI=wG,TI=xG,kI=EG,DI=CG,NI=AG,OI=PG,MI=kG,NG="ContextMenu",[mEe,Y4e]=Pn(NG,[E_]),Ri=E_(),[X4e,OG]=mEe(NG),MG="ContextMenuTrigger",gEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=t,i=OG(MG,n),a=Ri(n),o=_.useRef({x:0,y:0}),c=_.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...o.current})}),u=_.useRef(0),f=_.useCallback(()=>window.clearTimeout(u.current),[]),l=d=>{o.current={x:d.clientX,y:d.clientY},i.onOpenChange(!0)};return _.useEffect(()=>f,[f]),_.useEffect(()=>void(r&&f()),[r,f]),P.jsxs(P.Fragment,{children:[P.jsx(_I,{...a,virtualRef:c}),P.jsx(De.span,{"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:me(t.onContextMenu,d=>{f(),l(d),d.preventDefault()}),onPointerDown:r?t.onPointerDown:me(t.onPointerDown,aS(d=>{f(),u.current=window.setTimeout(()=>l(d),700)})),onPointerMove:r?t.onPointerMove:me(t.onPointerMove,aS(f)),onPointerCancel:r?t.onPointerCancel:me(t.onPointerCancel,aS(f)),onPointerUp:r?t.onPointerUp:me(t.onPointerUp,aS(f))})]})});gEe.displayName=MG;var vEe="ContextMenuPortal",LG=t=>{const{__scopeContextMenu:e,...n}=t,r=Ri(e);return P.jsx(xI,{...r,...n})};LG.displayName=vEe;var IG="ContextMenuContent",$G=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=OG(IG,n),i=Ri(n),a=_.useRef(!1);return P.jsx(SI,{...i,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:o=>{var c;(c=t.onCloseAutoFocus)==null||c.call(t,o),!o.defaultPrevented&&a.current&&o.preventDefault(),a.current=!1},onInteractOutside:o=>{var c;(c=t.onInteractOutside)==null||c.call(t,o),!o.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});$G.displayName=IG;var yEe="ContextMenuGroup",bEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(EI,{...s,...r,ref:e})});bEe.displayName=yEe;var wEe="ContextMenuLabel",FG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(CI,{...s,...r,ref:e})});FG.displayName=wEe;var _Ee="ContextMenuItem",jG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(AI,{...s,...r,ref:e})});jG.displayName=_Ee;var xEe="ContextMenuCheckboxItem",zG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(RI,{...s,...r,ref:e})});zG.displayName=xEe;var SEe="ContextMenuRadioGroup",EEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(PI,{...s,...r,ref:e})});EEe.displayName=SEe;var CEe="ContextMenuRadioItem",BG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(TI,{...s,...r,ref:e})});BG.displayName=CEe;var AEe="ContextMenuItemIndicator",UG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(kI,{...s,...r,ref:e})});UG.displayName=AEe;var REe="ContextMenuSeparator",HG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(DI,{...s,...r,ref:e})});HG.displayName=REe;var PEe="ContextMenuArrow",TEe=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(NI,{...s,...r,ref:e})});TEe.displayName=PEe;var kEe="ContextMenuSubTrigger",VG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(OI,{...s,...r,ref:e})});VG.displayName=kEe;var DEe="ContextMenuSubContent",WG=_.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,s=Ri(n);return P.jsx(MI,{...s,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});WG.displayName=DEe;function aS(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var NEe=LG,GG=$G,qG=FG,KG=jG,YG=zG,XG=BG,QG=UG,ZG=HG,JG=VG,eq=WG;const OEe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(JG,{ref:s,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,P.jsx(r_,{className:"ml-auto h-4 w-4"})]}));OEe.displayName=JG.displayName;const MEe=_.forwardRef(({className:t,...e},n)=>P.jsx(eq,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));MEe.displayName=eq.displayName;const LEe=_.forwardRef(({className:t,...e},n)=>P.jsx(NEe,{children:P.jsx(GG,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e})}));LEe.displayName=GG.displayName;const IEe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(KG,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));IEe.displayName=KG.displayName;const $Ee=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(YG,{ref:s,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(QG,{children:P.jsx(n_,{className:"h-4 w-4"})})}),e]}));$Ee.displayName=YG.displayName;const FEe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(XG,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(QG,{children:P.jsx(I1,{className:"h-2 w-2 fill-current"})})}),e]}));FEe.displayName=XG.displayName;const jEe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(qG,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold text-foreground",e&&"pl-8",t),...n}));jEe.displayName=qG.displayName;const zEe=_.forwardRef(({className:t,...e},n)=>P.jsx(ZG,{ref:n,className:ce("-mx-1 my-1 h-px bg-border",t),...e}));zEe.displayName=ZG.displayName;function wd(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function Jz(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function tq(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Jz(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{children:a,...o}=i,c=_.useMemo(()=>o,Object.values(o));return P.jsx(n.Provider,{value:c,children:a})};r.displayName=t+"Provider";function s(i){const a=_.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function UEe(t,e=[]){let n=[];function r(i,a){const o=_.createContext(a),c=n.length;n=[...n,a];const u=l=>{var g;const{scope:d,children:m,...p}=l,h=((g=d==null?void 0:d[t])==null?void 0:g[c])||o,y=_.useMemo(()=>p,Object.values(p));return P.jsx(h.Provider,{value:y,children:m})};u.displayName=i+"Provider";function f(l,d){var h;const m=((h=d==null?void 0:d[t])==null?void 0:h[c])||o,p=_.useContext(m);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${l}\` must be used within \`${i}\``)}return[u,f]}const s=()=>{const i=n.map(a=>_.createContext(a));return function(o){const c=(o==null?void 0:o[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...o,[t]:c}}),[o,c])}};return s.scopeName=t,[r,HEe(s,...e)]}function HEe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((o,{useScope:c,scopeName:u})=>{const l=c(i)[`__scope${u}`];return{...o,...l}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var LI=_.forwardRef((t,e)=>{const{children:n,...r}=t,s=_.Children.toArray(n),i=s.find(WEe);if(i){const a=i.props.children,o=s.map(c=>c===i?_.Children.count(a)>1?_.Children.only(null):_.isValidElement(a)?a.props.children:null:c);return P.jsx(qD,{...r,ref:e,children:_.isValidElement(a)?_.cloneElement(a,void 0,o):null})}return P.jsx(qD,{...r,ref:e,children:n})});LI.displayName="Slot";var qD=_.forwardRef((t,e)=>{const{children:n,...r}=t;if(_.isValidElement(n)){const s=qEe(n),i=GEe(r,n.props);return n.type!==_.Fragment&&(i.ref=e?tq(e,s):s),_.cloneElement(n,i)}return _.Children.count(n)>1?_.Children.only(null):null});qD.displayName="SlotClone";var VEe=({children:t})=>P.jsx(P.Fragment,{children:t});function WEe(t){return _.isValidElement(t)&&t.type===VEe}function GEe(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...o)=>{i(...o),s(...o)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function qEe(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var KEe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Zc=KEe.reduce((t,e)=>{const n=_.forwardRef((r,s)=>{const{asChild:i,...a}=r,o=i?LI:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),P.jsx(o,{...a,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function YEe(t,e){t&&ks.flushSync(()=>t.dispatchEvent(e))}var XEe="DismissableLayer",KD="dismissableLayer.update",QEe="dismissableLayer.pointerDownOutside",ZEe="dismissableLayer.focusOutside",eB,nq=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rq=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:o,...c}=t,u=_.useContext(nq),[f,l]=_.useState(null),d=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=_.useState({}),p=mp(e,R=>l(R)),h=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=h.indexOf(y),v=f?h.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,x=v>=g,A=tCe(R=>{const E=R.target,T=[...u.branches].some(D=>D.contains(E));!x||T||(s==null||s(R),a==null||a(R),R.defaultPrevented||o==null||o())},d),k=nCe(R=>{const E=R.target;[...u.branches].some(D=>D.contains(E))||(i==null||i(R),a==null||a(R),R.defaultPrevented||o==null||o())},d);return p6(R=>{v===u.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&o&&(R.preventDefault(),o()))},d),_.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(eB=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),tB(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=eB)}},[f,d,n,u]),_.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),tB())},[f,u]),_.useEffect(()=>{const R=()=>m({});return document.addEventListener(KD,R),()=>document.removeEventListener(KD,R)},[]),P.jsx(Zc.div,{...c,ref:p,style:{pointerEvents:w?x?"auto":"none":void 0,...t.style},onFocusCapture:wd(t.onFocusCapture,k.onFocusCapture),onBlurCapture:wd(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:wd(t.onPointerDownCapture,A.onPointerDownCapture)})});rq.displayName=XEe;var JEe="DismissableLayerBranch",eCe=_.forwardRef((t,e)=>{const n=_.useContext(nq),r=_.useRef(null),s=mp(e,r);return _.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),P.jsx(Zc.div,{...t,ref:s})});eCe.displayName=JEe;function tCe(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=o=>{if(o.target&&!r.current){let c=function(){sq(QEe,n,u,{discrete:!0})};const u={originalEvent:o};o.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=c,e.addEventListener("click",s.current,{once:!0})):c()}else e.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function nCe(t,e=globalThis==null?void 0:globalThis.document){const n=Bt(t),r=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!r.current&&sq(ZEe,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tB(){const t=new CustomEvent(KD);document.dispatchEvent(t)}function sq(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?YEe(s,i):s.dispatchEvent(i)}var ST="focusScope.autoFocusOnMount",ET="focusScope.autoFocusOnUnmount",nB={bubbles:!1,cancelable:!0},rCe="FocusScope",iq=_.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=t,[o,c]=_.useState(null),u=Bt(s),f=Bt(i),l=_.useRef(null),d=mp(e,h=>c(h)),m=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let h=function(w){if(m.paused||!o)return;const x=w.target;o.contains(x)?l.current=x:yu(l.current,{select:!0})},y=function(w){if(m.paused||!o)return;const x=w.relatedTarget;x!==null&&(o.contains(x)||yu(l.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const A of w)A.removedNodes.length>0&&yu(o)};document.addEventListener("focusin",h),document.addEventListener("focusout",y);const v=new MutationObserver(g);return o&&v.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",y),v.disconnect()}}},[r,o,m.paused]),_.useEffect(()=>{if(o){sB.add(m);const h=document.activeElement;if(!o.contains(h)){const g=new CustomEvent(ST,nB);o.addEventListener(ST,u),o.dispatchEvent(g),g.defaultPrevented||(sCe(cCe(oq(o)),{select:!0}),document.activeElement===h&&yu(o))}return()=>{o.removeEventListener(ST,u),setTimeout(()=>{const g=new CustomEvent(ET,nB);o.addEventListener(ET,f),o.dispatchEvent(g),g.defaultPrevented||yu(h??document.body,{select:!0}),o.removeEventListener(ET,f),sB.remove(m)},0)}}},[o,u,f,m]);const p=_.useCallback(h=>{if(!n&&!r||m.paused)return;const y=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,g=document.activeElement;if(y&&g){const v=h.currentTarget,[w,x]=iCe(v);w&&x?!h.shiftKey&&g===x?(h.preventDefault(),n&&yu(w,{select:!0})):h.shiftKey&&g===w&&(h.preventDefault(),n&&yu(x,{select:!0})):g===v&&h.preventDefault()}},[n,r,m.paused]);return P.jsx(Zc.div,{tabIndex:-1,...a,ref:d,onKeyDown:p})});iq.displayName=rCe;function sCe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(yu(r,{select:e}),document.activeElement!==n)return}function iCe(t){const e=oq(t),n=rB(e,t),r=rB(e.reverse(),t);return[n,r]}function oq(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function rB(t,e){for(const n of t)if(!oCe(n,{upTo:e}))return n}function oCe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function aCe(t){return t instanceof HTMLInputElement&&"select"in t}function yu(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&aCe(t)&&e&&t.select()}}var sB=lCe();function lCe(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=iB(t,e),t.unshift(e)},remove(e){var n;t=iB(t,e),(n=t[0])==null||n.resume()}}}function iB(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function cCe(t){return t.filter(e=>e.tagName!=="A")}var uCe="Portal",aq=_.forwardRef((t,e)=>{var o;const{container:n,...r}=t,[s,i]=_.useState(!1);Mn(()=>i(!0),[]);const a=n||s&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?e_.createPortal(P.jsx(Zc.div,{...r,ref:e}),a):null});aq.displayName=uCe;function dCe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var dA=t=>{const{present:e,children:n}=t,r=fCe(e),s=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),i=mp(r.ref,hCe(s));return typeof n=="function"||r.isPresent?_.cloneElement(s,{ref:i}):null};dA.displayName="Presence";function fCe(t){const[e,n]=_.useState(),r=_.useRef({}),s=_.useRef(t),i=_.useRef("none"),a=t?"mounted":"unmounted",[o,c]=dCe(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=lS(r.current);i.current=o==="mounted"?u:"none"},[o]),Mn(()=>{const u=r.current,f=s.current;if(f!==t){const d=i.current,m=lS(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(f&&d!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,c]),Mn(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,l=m=>{const h=lS(r.current).includes(m.animationName);if(m.target===e&&h&&(c("ANIMATION_END"),!s.current)){const y=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=y)})}},d=m=>{m.target===e&&(i.current=lS(r.current))};return e.addEventListener("animationstart",d),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",d),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:_.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function lS(t){return(t==null?void 0:t.animationName)||"none"}function hCe(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var CT=0;function pCe(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??oB()),document.body.insertAdjacentElement("beforeend",t[1]??oB()),CT++,()=>{CT===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),CT--}},[])}function oB(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var lq=yL(),AT=function(){},fA=_.forwardRef(function(t,e){var n=_.useRef(null),r=_.useState({onScrollCapture:AT,onWheelCapture:AT,onTouchMoveCapture:AT}),s=r[0],i=r[1],a=t.forwardProps,o=t.children,c=t.className,u=t.removeScrollBar,f=t.enabled,l=t.shards,d=t.sideCar,m=t.noIsolation,p=t.inert,h=t.allowPinchZoom,y=t.as,g=y===void 0?"div":y,v=t.gapMode,w=F1(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=d,A=vL([n,e]),k=fr(fr({},w),s);return _.createElement(_.Fragment,null,f&&_.createElement(x,{sideCar:lq,removeScrollBar:u,shards:l,noIsolation:m,inert:p,setCallbacks:i,allowPinchZoom:!!h,lockRef:n,gapMode:v}),a?_.cloneElement(_.Children.only(o),fr(fr({},k),{ref:A})):_.createElement(g,fr({},k,{className:c,ref:A}),o))});fA.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fA.classNames={fullWidth:Om,zeroRight:Nm};var YD=!1;if(typeof window<"u")try{var cS=Object.defineProperty({},"passive",{get:function(){return YD=!0,!0}});window.addEventListener("test",cS,cS),window.removeEventListener("test",cS,cS)}catch{YD=!1}var zp=YD?{passive:!1}:!1,mCe=function(t){return t.tagName==="TEXTAREA"},cq=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!mCe(t)&&n[e]==="visible")},gCe=function(t){return cq(t,"overflowY")},vCe=function(t){return cq(t,"overflowX")},aB=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=uq(t,r);if(s){var i=dq(t,r),a=i[1],o=i[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},yCe=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},bCe=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},uq=function(t,e){return t==="v"?gCe(e):vCe(e)},dq=function(t,e){return t==="v"?yCe(e):bCe(e)},wCe=function(t,e){return t==="h"&&e==="rtl"?-1:1},_Ce=function(t,e,n,r,s){var i=wCe(t,window.getComputedStyle(e).direction),a=i*r,o=n.target,c=e.contains(o),u=!1,f=a>0,l=0,d=0;do{var m=dq(t,o),p=m[0],h=m[1],y=m[2],g=h-y-i*p;(p||g)&&uq(t,o)&&(l+=g,d+=p),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!c&&o!==document.body||c&&(e.contains(o)||e===o));return(f&&Math.abs(l)<1||!f&&Math.abs(d)<1)&&(u=!0),u},uS=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},lB=function(t){return[t.deltaX,t.deltaY]},cB=function(t){return t&&"current"in t?t.current:t},xCe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},SCe=function(t){return` .block-interactivity-`.concat(t,` {pointer-events: none;} .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},wCe=0,zp=[];function _Ce(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(wCe++)[0],i=_.useState(j1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=pL([t.lockRef.current],(t.shards||[]).map(oB),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=cS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=sB(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=sB(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return vCe(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!zp.length||zp[zp.length-1]!==i)){var g="deltaY"in y?iB(y):cS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&yCe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(oB).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:xCe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=cS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,iB(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,cS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return zp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,jp),document.addEventListener("touchmove",c,jp),document.addEventListener("touchstart",f,jp),function(){zp=zp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,jp),document.removeEventListener("touchmove",c,jp),document.removeEventListener("touchstart",f,jp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:bCe(s)}):null,m?_.createElement(yL,{gapMode:t.gapMode}):null)}function xCe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const SCe=vL(sq,_Ce);var lq=_.forwardRef(function(t,e){return _.createElement(dA,fr({},t,{ref:e,sideCar:SCe}))});lq.classNames=dA.classNames;var MI="Dialog",[cq,V4e]=FEe(MI),[ECe,Na]=cq(MI),uq=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(ECe,{scope:e,triggerRef:o,contentRef:c,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};uq.displayName=MI;var dq="DialogTrigger",CCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(dq,n),i=pp(e,s.triggerRef);return P.jsx(Zc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$I(s.open),...r,ref:i,onClick:wd(t.onClick,s.onOpenToggle)})});CCe.displayName=dq;var LI="DialogPortal",[ACe,fq]=cq(LI,{forceMount:void 0}),hq=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Na(LI,e);return P.jsx(ACe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(uA,{present:n||i.open,children:P.jsx(rq,{asChild:!0,container:s,children:a})}))})};hq.displayName=LI;var cC="DialogOverlay",pq=_.forwardRef((t,e)=>{const n=fq(cC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Na(cC,t.__scopeDialog);return i.modal?P.jsx(uA,{present:r||i.open,children:P.jsx(RCe,{...s,ref:e})}):null});pq.displayName=cC;var RCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(cC,n);return P.jsx(lq,{as:OI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(Zc.div,{"data-state":$I(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Yh="DialogContent",mq=_.forwardRef((t,e)=>{const n=fq(Yh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Na(Yh,t.__scopeDialog);return P.jsx(uA,{present:r||i.open,children:i.modal?P.jsx(PCe,{...s,ref:e}):P.jsx(TCe,{...s,ref:e})})});mq.displayName=Yh;var PCe=_.forwardRef((t,e)=>{const n=Na(Yh,t.__scopeDialog),r=_.useRef(null),s=pp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(gq,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:wd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:wd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:wd(t.onFocusOutside,i=>i.preventDefault())})}),TCe=_.forwardRef((t,e)=>{const n=Na(Yh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(gq,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),gq=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Na(Yh,n),c=_.useRef(null),u=pp(e,c);return uCe(),P.jsxs(P.Fragment,{children:[P.jsx(tq,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(JG,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":$I(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(kCe,{titleId:o.titleId}),P.jsx(NCe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),II="DialogTitle",vq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(II,n);return P.jsx(Zc.h2,{id:s.titleId,...r,ref:e})});vq.displayName=II;var yq="DialogDescription",bq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(yq,n);return P.jsx(Zc.p,{id:s.descriptionId,...r,ref:e})});bq.displayName=yq;var wq="DialogClose",_q=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Na(wq,n);return P.jsx(Zc.button,{type:"button",...r,ref:e,onClick:wd(t.onClick,()=>s.onOpenChange(!1))})});_q.displayName=wq;function $I(t){return t?"open":"closed"}var xq="DialogTitleWarning",[W4e,Sq]=$Ee(xq,{contentName:Yh,titleName:II,docsSlug:"dialog"}),kCe=({titleId:t})=>{const e=Sq(xq),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. +`)},ECe=0,Bp=[];function CCe(t){var e=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),s=_.useState(ECe++)[0],i=_.useState(z1)[0],a=_.useRef(t);_.useEffect(function(){a.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(s));var h=gL([t.lockRef.current],(t.shards||[]).map(cB),!0).filter(Boolean);return h.forEach(function(y){return y.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),h.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(s))})}}},[t.inert,t.lockRef.current,t.shards]);var o=_.useCallback(function(h,y){if("touches"in h&&h.touches.length===2||h.type==="wheel"&&h.ctrlKey)return!a.current.allowPinchZoom;var g=uS(h),v=n.current,w="deltaX"in h?h.deltaX:v[0]-g[0],x="deltaY"in h?h.deltaY:v[1]-g[1],A,k=h.target,R=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in h&&R==="h"&&k.type==="range")return!1;var E=aB(R,k);if(!E)return!0;if(E?A=R:(A=R==="v"?"h":"v",E=aB(R,k)),!E)return!1;if(!r.current&&"changedTouches"in h&&(w||x)&&(r.current=A),!A)return!0;var T=r.current||A;return _Ce(T,y,h,T==="h"?w:x)},[]),c=_.useCallback(function(h){var y=h;if(!(!Bp.length||Bp[Bp.length-1]!==i)){var g="deltaY"in y?lB(y):uS(y),v=e.current.filter(function(A){return A.name===y.type&&(A.target===y.target||y.target===A.shadowParent)&&xCe(A.delta,g)})[0];if(v&&v.should){y.cancelable&&y.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(cB).filter(Boolean).filter(function(A){return A.contains(y.target)}),x=w.length>0?o(y,w[0]):!a.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),u=_.useCallback(function(h,y,g,v){var w={name:h,delta:y,target:g,should:v,shadowParent:ACe(g)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(x){return x!==w})},1)},[]),f=_.useCallback(function(h){n.current=uS(h),r.current=void 0},[]),l=_.useCallback(function(h){u(h.type,lB(h),h.target,o(h,t.lockRef.current))},[]),d=_.useCallback(function(h){u(h.type,uS(h),h.target,o(h,t.lockRef.current))},[]);_.useEffect(function(){return Bp.push(i),t.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:d}),document.addEventListener("wheel",c,zp),document.addEventListener("touchmove",c,zp),document.addEventListener("touchstart",f,zp),function(){Bp=Bp.filter(function(h){return h!==i}),document.removeEventListener("wheel",c,zp),document.removeEventListener("touchmove",c,zp),document.removeEventListener("touchstart",f,zp)}},[]);var m=t.removeScrollBar,p=t.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:SCe(s)}):null,m?_.createElement(wL,{gapMode:t.gapMode}):null)}function ACe(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const RCe=bL(lq,CCe);var fq=_.forwardRef(function(t,e){return _.createElement(fA,fr({},t,{ref:e,sideCar:RCe}))});fq.classNames=fA.classNames;var II="Dialog",[hq,Q4e]=UEe(II),[PCe,Oa]=hq(II),pq=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!0}=t,o=_.useRef(null),c=_.useRef(null),[u=!1,f]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(PCe,{scope:e,triggerRef:o,contentRef:c,contentId:Hr(),titleId:Hr(),descriptionId:Hr(),open:u,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(l=>!l),[f]),modal:a,children:n})};pq.displayName=II;var mq="DialogTrigger",TCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(mq,n),i=mp(e,s.triggerRef);return P.jsx(Zc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":jI(s.open),...r,ref:i,onClick:wd(t.onClick,s.onOpenToggle)})});TCe.displayName=mq;var $I="DialogPortal",[kCe,gq]=hq($I,{forceMount:void 0}),vq=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:s}=t,i=Oa($I,e);return P.jsx(kCe,{scope:e,forceMount:n,children:_.Children.map(r,a=>P.jsx(dA,{present:n||i.open,children:P.jsx(aq,{asChild:!0,container:s,children:a})}))})};vq.displayName=$I;var uC="DialogOverlay",yq=_.forwardRef((t,e)=>{const n=gq(uC,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Oa(uC,t.__scopeDialog);return i.modal?P.jsx(dA,{present:r||i.open,children:P.jsx(DCe,{...s,ref:e})}):null});yq.displayName=uC;var DCe=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(uC,n);return P.jsx(fq,{as:LI,allowPinchZoom:!0,shards:[s.contentRef],children:P.jsx(Zc.div,{"data-state":jI(s.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),Xh="DialogContent",bq=_.forwardRef((t,e)=>{const n=gq(Xh,t.__scopeDialog),{forceMount:r=n.forceMount,...s}=t,i=Oa(Xh,t.__scopeDialog);return P.jsx(dA,{present:r||i.open,children:i.modal?P.jsx(NCe,{...s,ref:e}):P.jsx(OCe,{...s,ref:e})})});bq.displayName=Xh;var NCe=_.forwardRef((t,e)=>{const n=Oa(Xh,t.__scopeDialog),r=_.useRef(null),s=mp(e,n.contentRef,r);return _.useEffect(()=>{const i=r.current;if(i)return _v(i)},[]),P.jsx(wq,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:wd(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:wd(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&i.preventDefault()}),onFocusOutside:wd(t.onFocusOutside,i=>i.preventDefault())})}),OCe=_.forwardRef((t,e)=>{const n=Oa(Xh,t.__scopeDialog),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(wq,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),wq=_.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,o=Oa(Xh,n),c=_.useRef(null),u=mp(e,c);return pCe(),P.jsxs(P.Fragment,{children:[P.jsx(iq,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(rq,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":jI(o.open),...a,ref:u,onDismiss:()=>o.onOpenChange(!1)})}),P.jsxs(P.Fragment,{children:[P.jsx(MCe,{titleId:o.titleId}),P.jsx(ICe,{contentRef:c,descriptionId:o.descriptionId})]})]})}),FI="DialogTitle",_q=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(FI,n);return P.jsx(Zc.h2,{id:s.titleId,...r,ref:e})});_q.displayName=FI;var xq="DialogDescription",Sq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(xq,n);return P.jsx(Zc.p,{id:s.descriptionId,...r,ref:e})});Sq.displayName=xq;var Eq="DialogClose",Cq=_.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,s=Oa(Eq,n);return P.jsx(Zc.button,{type:"button",...r,ref:e,onClick:wd(t.onClick,()=>s.onOpenChange(!1))})});Cq.displayName=Eq;function jI(t){return t?"open":"closed"}var Aq="DialogTitleWarning",[Z4e,Rq]=BEe(Aq,{contentName:Xh,titleName:FI,docsSlug:"dialog"}),MCe=({titleId:t})=>{const e=Rq(Aq),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. -For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},DCe="DialogDescriptionWarning",NCe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Sq(DCe).contentName}}.`;return _.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},OCe=uq,MCe=hq,LCe=pq,ICe=mq,$Ce=vq,FCe=bq,jCe=_q;function zCe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const Eq=se.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),C_=()=>{const t=se.useContext(Eq);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};zCe(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( +For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},LCe="DialogDescriptionWarning",ICe=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rq(LCe).contentName}}.`;return _.useEffect(()=>{var i;const s=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&s&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},$Ce=pq,FCe=vq,jCe=yq,zCe=bq,BCe=_q,UCe=Sq,HCe=Cq;function VCe(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const Pq=se.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),A_=()=>{const t=se.useContext(Pq);if(!t)throw new Error("useDrawerContext must be used within a Drawer.Root");return t};VCe(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not( [data-state=closed] -){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const BCe=24,UCe=typeof window<"u"?_.useLayoutEffect:_.useEffect;function aB(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function HCe(){return FI(/^Mac/)}function VCe(){return FI(/^iPhone/)}function lB(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function WCe(){return FI(/^iPad/)||HCe()&&navigator.maxTouchPoints>1}function Cq(){return VCe()||WCe()}function FI(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const AT=typeof document<"u"&&window.visualViewport;function cB(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function Aq(t){for(cB(t)&&(t=t.parentElement);t&&!cB(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const GCe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let uS=0,RT;function qCe(t={}){let{isDisabled:e}=t;UCe(()=>{if(!e)return uS++,uS===1&&Cq()&&(RT=KCe()),()=>{uS--,uS===0&&(RT==null||RT())}},[e])}function KCe(){let t,e=0,n=l=>{t=Aq(l.target),!(t===document.documentElement&&t===document.body)&&(e=l.changedTouches[0].pageY)},r=l=>{if(!t||t===document.documentElement||t===document.body){l.preventDefault();return}let d=l.changedTouches[0].pageY,m=t.scrollTop,p=t.scrollHeight-t.clientHeight;p!==0&&((m<=0&&d>e||m>=p&&d{let d=l.target;YD(d)&&d!==document.activeElement&&(l.preventDefault(),d.style.transform="translateY(-2000px)",d.focus(),requestAnimationFrame(()=>{d.style.transform=""}))},i=l=>{let d=l.target;YD(d)&&(d.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{d.style.transform="",AT&&(AT.height{uB(d)}):AT.addEventListener("resize",()=>uB(d),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,c=window.pageYOffset,u=aB(YCe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=aB(yy(document,"touchstart",n,{passive:!1,capture:!0}),yy(document,"touchmove",r,{passive:!1,capture:!0}),yy(document,"touchend",s,{passive:!1,capture:!0}),yy(document,"focus",i,!0),yy(window,"scroll",a));return()=>{u(),f(),window.scrollTo(o,c)}}function YCe(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function yy(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function uB(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=Aq(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,s=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+BCe;i>a&&(n.scrollTop+=s-r)}t=n.parentElement}}function YD(t){return t instanceof HTMLInputElement&&!GCe.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function XCe(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function QCe(...t){return e=>t.forEach(n=>XCe(n,e))}function Rq(...t){return _.useCallback(QCe(...t),t)}const Pq=new WeakMap;function Lr(t,e,n=!1){if(!t||!(t instanceof HTMLElement))return;let r={};Object.entries(e).forEach(([s,i])=>{if(s.startsWith("--")){t.style.setProperty(s,i);return}r[s]=t.style[s],t.style[s]=i}),!n&&Pq.set(t,r)}function ZCe(t,e){if(!t||!(t instanceof HTMLElement))return;let n=Pq.get(t);n&&(t.style[e]=n[e])}const Ir=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function dS(t,e){if(!t)return null;const n=window.getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Ir(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Ir(e)?5:4]):null)}function JCe(t){return 8*(Math.log(t+1)-2)}function PT(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function e1e(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}const Jn={DURATION:.5,EASE:[.32,.72,0,1]},Tq=.4,t1e=.25,n1e=100,kq=8,fS=16,XD=26,TT="vaul-dragging";function Dq(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function r1e({defaultProp:t,onChange:e}){const n=se.useState(t),[r]=n,s=se.useRef(r),i=Dq(e);return se.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function Nq({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=r1e({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Dq(n),c=se.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function s1e({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:a,direction:o="bottom",container:c,snapToSequentialPoint:u}){const[f,l]=Nq({prop:t,defaultProp:n==null?void 0:n[0],onChange:e}),[d,m]=se.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);se.useEffect(()=>{function R(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=se.useMemo(()=>f===(n==null?void 0:n[n.length-1])||null,[n,f]),h=se.useMemo(()=>n==null?void 0:n.findIndex(R=>R===f),[n,f]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===f||!n,g=se.useMemo(()=>{const R=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var E;return(E=n==null?void 0:n.map(T=>{const D=typeof T=="string";let O=0;if(D&&(O=parseInt(T,10)),Ir(o)){const I=D?O:d?T*R.height:0;return d?o==="bottom"?R.height-I:-R.height+I:I}const L=D?O:d?T*R.width:0;return d?o==="right"?R.width-L:-R.width+L:L}))!=null?E:[]},[n,d,c]),v=se.useMemo(()=>h!==null?g==null?void 0:g[h]:null,[g,h]),w=se.useCallback(R=>{var E;const T=(E=g==null?void 0:g.findIndex(D=>D===R))!=null?E:null;a(T),Lr(r.current,{transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,transform:Ir(o)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),g&&T!==g.length-1&&T!==i&&T{if(f||t){var R;const E=(R=n==null?void 0:n.findIndex(T=>T===t||T===f))!=null?R:-1;g&&E!==-1&&typeof g[E]=="number"&&w(g[E])}},[f,t,n,g,w]);function x({draggedDistance:R,closeDrawer:E,velocity:T,dismissible:D}){if(i===void 0)return;const O=o==="bottom"||o==="right"?(v??0)-R:(v??0)+R,L=h===i-1,I=h===0,F=R>0;if(L&&Lr(s.current,{transition:`opacity ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`}),!u&&T>2&&!F){D?E():w(g[0]);return}if(!u&&T>2&&F&&g&&n){w(g[n.length-1]);return}const U=g==null?void 0:g.reduce((V,H)=>typeof V!="number"||typeof H!="number"?V:Math.abs(H-O)Tq&&Math.abs(R)0&&p){w(g[n.length-1]);return}if(I&&V<0&&D&&E(),h===null)return;w(g[h+V]);return}w(U)}function A({draggedDistance:R}){if(v===null)return;const E=o==="bottom"||o==="right"?v-R:v+R;(o==="bottom"||o==="right")&&Eg[g.length-1]||Lr(r.current,{transform:Ir(o)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function k(R,E){if(!n||typeof h!="number"||!g||i===void 0)return null;const T=h===i-1;if(h>=i&&E)return 0;if(T&&!E)return 1;if(!y&&!T)return null;const O=T?h+1:h-1,L=T?g[O]-g[O-1]:g[O+1]-g[O],I=R/Math.abs(L);return T?1-I:I}return{isLastSnapPoint:p,activeSnapPoint:f,shouldFade:y,getPercentageDragged:k,setActiveSnapPoint:l,activeSnapPointIndex:h,onRelease:x,onDrag:A,snapPointsOffset:g}}const i1e=()=>()=>{};function o1e(){const{direction:t,isOpen:e,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=C_(),i=se.useRef(null),a=_.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-XD)/window.innerWidth}se.useEffect(()=>{if(e&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;e1e(r&&!s?PT(document.body,{background:"black"}):i1e,PT(c,{transformOrigin:Ir(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Jn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Jn.EASE.join(",")})`}));const u=PT(c,{borderRadius:`${kq}px`,overflow:"hidden",...Ir(t)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Jn.DURATION*1e3)}}},[e,n,a])}let by=null;function a1e({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[a,o]=se.useState(()=>typeof window<"u"?window.location.href:""),c=se.useRef(0),u=se.useCallback(()=>{if(lB()&&by===null&&t&&!i){by={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:l,innerHeight:d}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-l}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const m=d-window.innerHeight;m&&c.current>=d&&(document.body.style.top=`${-(c.current+m)}px`)}),300)}},[t]),f=se.useCallback(()=>{if(lB()&&by!==null&&!i){const l=-parseInt(document.body.style.top,10),d=-parseInt(document.body.style.left,10);Object.assign(document.body.style,by),window.requestAnimationFrame(()=>{if(s&&a!==window.location.href){o(window.location.href);return}window.scrollTo(d,l)}),by=null}},[a]);return se.useEffect(()=>{function l(){c.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),se.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),e||window.setTimeout(()=>{f()},500)):f())},[t,r,a,e,n,u,f]),{restorePositionSetting:f}}function l1e({open:t,onOpenChange:e,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:c=t1e,scrollLockTimeout:u=n1e,dismissible:f=!0,handleOnly:l=!1,fadeFromIndex:d=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:p,fixed:h,modal:y=!0,onClose:g,nested:v,noBodyStyles:w,direction:x="bottom",defaultOpen:A=!1,disablePreventScroll:k=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:E=!1,repositionInputs:T=!0,onAnimationEnd:D,container:O,autoFocus:L=!1}){var I,F;const[U=!1,Y]=Nq({defaultProp:A,prop:t,onChange:Be=>{e==null||e(Be),!Be&&!v&&Oe(),setTimeout(()=>{D==null||D(Be)},Jn.DURATION*1e3),Be&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Be||(document.body.style.pointerEvents="auto")}}),[V,H]=se.useState(!1),[ee,re]=se.useState(!1),[X,q]=se.useState(!1),K=se.useRef(null),Z=se.useRef(null),ue=se.useRef(null),de=se.useRef(null),ie=se.useRef(null),be=se.useRef(!1),Ae=se.useRef(null),_e=se.useRef(0),Me=se.useRef(!1),Ne=se.useRef(0),ye=se.useRef(null),$e=se.useRef(((I=ye.current)==null?void 0:I.getBoundingClientRect().height)||0),ut=se.useRef(((F=ye.current)==null?void 0:F.getBoundingClientRect().width)||0),Qe=se.useRef(0),vt=se.useCallback(Be=>{i&&Be===J.length-1&&(Z.current=new Date)},[]),{activeSnapPoint:Sn,activeSnapPointIndex:Yt,setActiveSnapPoint:mn,onRelease:Xt,snapPointsOffset:J,onDrag:fe,shouldFade:ge,getPercentageDragged:Pe}=s1e({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:p,drawerRef:ye,fadeFromIndex:d,overlayRef:K,onSnapPointChange:vt,direction:x,container:O,snapToSequentialPoint:R});qCe({isDisabled:!U||ee||!y||X||!V||!T||!k});const{restorePositionSetting:Oe}=a1e({isOpen:U,modal:y,nested:v,hasBeenOpened:V,preventScrollRestoration:E,noBodyStyles:w});function xe(){return(window.innerWidth-XD)/window.innerWidth}function Te(Be){var it,ot;!f&&!i||ye.current&&!ye.current.contains(Be.target)||($e.current=((it=ye.current)==null?void 0:it.getBoundingClientRect().height)||0,ut.current=((ot=ye.current)==null?void 0:ot.getBoundingClientRect().width)||0,re(!0),ue.current=new Date,Cq()&&window.addEventListener("touchend",()=>be.current=!1,{once:!0}),Be.target.setPointerCapture(Be.pointerId),_e.current=Ir(x)?Be.pageY:Be.pageX)}function Ye(Be,it){var ot,St;let nt=Be;const Ht=(ot=window.getSelection())==null?void 0:ot.toString(),Ct=ye.current?dS(ye.current,x):null,vn=new Date;if(nt.hasAttribute("data-vaul-no-drag")||nt.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(Z.current&&vn.getTime()-Z.current.getTime()<500)return!1;if(Ct!==null&&(x==="bottom"?Ct>0:Ct<0))return!0;if(Ht&&Ht.length>0)return!1;if(vn.getTime()-((St=ie.current)==null?void 0:St.getTime())nt.clientHeight){if(nt.scrollTop!==0)return ie.current=new Date,!1;if(nt.getAttribute("role")==="dialog")return!0}nt=nt.parentNode}return!0}function Rt(Be){if(ye.current&&ee){const it=x==="bottom"||x==="right"?1:-1,ot=(_e.current-(Ir(x)?Be.pageY:Be.pageX))*it,St=ot>0,nt=i&&!f&&!St;if(nt&&Yt===0)return;const Ht=Math.abs(ot),Ct=document.querySelector("[data-vaul-drawer-wrapper]"),vn=x==="bottom"||x==="top"?$e.current:ut.current;let an=Ht/vn;const ln=Pe(Ht,St);if(ln!==null&&(an=ln),nt&&an>=1||!be.current&&!Ye(Be.target,St))return;if(ye.current.classList.add(TT),be.current=!0,Lr(ye.current,{transition:"none"}),Lr(K.current,{transition:"none"}),i&&fe({draggedDistance:ot}),St&&!i){const hr=JCe(ot),kn=Math.min(hr*-1,0)*it;Lr(ye.current,{transform:Ir(x)?`translate3d(0, ${kn}px, 0)`:`translate3d(${kn}px, 0, 0)`});return}const Tn=1-an;if((ge||d&&Yt===d-1)&&(r==null||r(Be,an),Lr(K.current,{opacity:`${Tn}`,transition:"none"},!0)),Ct&&K.current&&a){const hr=Math.min(xe()+an*(1-xe()),1),kn=8-an*8,te=Math.max(0,14-an*14);Lr(Ct,{borderRadius:`${kn}px`,transform:Ir(x)?`scale(${hr}) translate3d(0, ${te}px, 0)`:`scale(${hr}) translate3d(${te}px, 0, 0)`,transition:"none"},!0)}if(!i){const hr=Ht*it;Lr(ye.current,{transform:Ir(x)?`translate3d(0, ${hr}px, 0)`:`translate3d(${hr}px, 0, 0)`})}}}se.useEffect(()=>{var Be;function it(){if(!ye.current||!T)return;const ot=document.activeElement;if(YD(ot)||Me.current){var St;const nt=((St=window.visualViewport)==null?void 0:St.height)||0,Ht=window.innerHeight;let Ct=Ht-nt;const vn=ye.current.getBoundingClientRect().height||0,an=vn>Ht*.8;Qe.current||(Qe.current=vn);const ln=ye.current.getBoundingClientRect().top;if(Math.abs(Ne.current-Ct)>60&&(Me.current=!Me.current),i&&i.length>0&&J&&Yt){const Tn=J[Yt]||0;Ct+=Tn}if(Ne.current=Ct,vn>nt||Me.current){const Tn=ye.current.getBoundingClientRect().height;let hr=Tn;Tn>nt&&(hr=nt-(an?ln:XD)),h?ye.current.style.height=`${Tn-Math.max(Ct,0)}px`:ye.current.style.height=`${Math.max(hr,nt-ln)}px`}else ye.current.style.height=`${Qe.current}px`;i&&i.length>0&&!Me.current?ye.current.style.bottom="0px":ye.current.style.bottom=`${Math.max(Ct,0)}px`}}return(Be=window.visualViewport)==null||Be.addEventListener("resize",it),()=>{var ot;return(ot=window.visualViewport)==null?void 0:ot.removeEventListener("resize",it)}},[Yt,i,J]);function bt(Be){Kn(),g==null||g(),Be||Y(!1),setTimeout(()=>{i&&mn(i[0])},Jn.DURATION*1e3)}function Os(){if(!ye.current)return;const Be=document.querySelector("[data-vaul-drawer-wrapper]"),it=dS(ye.current,x);Lr(ye.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`}),Lr(K.current,{transition:`opacity ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,opacity:"1"}),a&&it&&it>0&&U&&Lr(Be,{borderRadius:`${kq}px`,overflow:"hidden",...Ir(x)?{transform:`scale(${xe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${xe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Jn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Jn.EASE.join(",")})`},!0)}function Kn(){!ee||!ye.current||(ye.current.classList.remove(TT),be.current=!1,re(!1),de.current=new Date)}function ps(Be){if(!ee||!ye.current)return;ye.current.classList.remove(TT),be.current=!1,re(!1),de.current=new Date;const it=dS(ye.current,x);if(!Ye(Be.target,!1)||!it||Number.isNaN(it)||ue.current===null)return;const ot=de.current.getTime()-ue.current.getTime(),St=_e.current-(Ir(x)?Be.pageY:Be.pageX),nt=Math.abs(St)/ot;if(nt>.05&&(q(!0),setTimeout(()=>{q(!1)},200)),i){Xt({draggedDistance:St*(x==="bottom"||x==="right"?1:-1),closeDrawer:bt,velocity:nt,dismissible:f}),s==null||s(Be,!0);return}if(x==="bottom"||x==="right"?St>0:St<0){Os(),s==null||s(Be,!0);return}if(nt>Tq){bt(),s==null||s(Be,!1);return}var Ht;const Ct=Math.min((Ht=ye.current.getBoundingClientRect().height)!=null?Ht:0,window.innerHeight);var vn;const an=Math.min((vn=ye.current.getBoundingClientRect().width)!=null?vn:0,window.innerWidth),ln=x==="left"||x==="right";if(Math.abs(it)>=(ln?an:Ct)*c){bt(),s==null||s(Be,!1);return}s==null||s(Be,!0),Os()}se.useEffect(()=>(U&&(Lr(document.documentElement,{scrollBehavior:"auto"}),Z.current=new Date),()=>{ZCe(document.documentElement,"scrollBehavior")}),[U]);function Ut(Be){const it=Be?(window.innerWidth-fS)/window.innerWidth:1,ot=Be?-16:0;Ae.current&&window.clearTimeout(Ae.current),Lr(ye.current,{transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,transform:`scale(${it}) translate3d(0, ${ot}px, 0)`}),!Be&&ye.current&&(Ae.current=setTimeout(()=>{const St=dS(ye.current,x);Lr(ye.current,{transition:"none",transform:Ir(x)?`translate3d(0, ${St}px, 0)`:`translate3d(${St}px, 0, 0)`})},500))}function on(Be,it){if(it<0)return;const ot=(window.innerWidth-fS)/window.innerWidth,St=ot+it*(1-ot),nt=-16+it*fS;Lr(ye.current,{transform:Ir(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`,transition:"none"})}function gn(Be,it){const ot=Ir(x)?window.innerHeight:window.innerWidth,St=it?(ot-fS)/ot:1,nt=it?-16:0;it&&Lr(ye.current,{transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,transform:Ir(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`})}return se.createElement(OCe,{defaultOpen:A,onOpenChange:Be=>{!f&&!Be||(Be?H(!0):bt(!0),Y(Be))},open:U},se.createElement(Eq.Provider,{value:{activeSnapPoint:Sn,snapPoints:i,setActiveSnapPoint:mn,drawerRef:ye,overlayRef:K,onOpenChange:e,onPress:Te,onRelease:ps,onDrag:Rt,dismissible:f,handleOnly:l,isOpen:U,isDragging:ee,shouldFade:ge,closeDrawer:bt,onNestedDrag:on,onNestedOpenChange:Ut,onNestedRelease:gn,keyboardIsOpen:Me,modal:y,snapPointsOffset:J,direction:x,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:w,container:O,autoFocus:L}},n))}const Oq=se.forwardRef(function({...t},e){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:a,modal:o}=C_(),c=Rq(e,n),u=r&&r.length>0;return o?se.createElement(LCe,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false",...t}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});Oq.displayName="Drawer.Overlay";const Mq=se.forwardRef(function({onPointerDownOutside:t,style:e,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:a,onRelease:o,onDrag:c,keyboardIsOpen:u,snapPointsOffset:f,modal:l,isOpen:d,direction:m,snapPoints:p,container:h,handleOnly:y,autoFocus:g}=C_(),[v,w]=se.useState(!1),x=Rq(s,i),A=se.useRef(null),k=se.useRef(null),R=se.useRef(!1),E=p&&p.length>0;o1e();const T=(O,L,I=0)=>{if(R.current)return!0;const F=Math.abs(O.y),U=Math.abs(O.x),Y=U>F,V=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(O.x*V<0)&&U>=0&&U<=I)return Y}else if(!(O.y*V<0)&&F>=0&&F<=I)return!Y;return R.current=!0,!0};se.useEffect(()=>{E&&window.requestAnimationFrame(()=>{w(!0)})},[]);function D(O){A.current=null,R.current=!1,o(O)}return se.createElement(ICe,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":v?"true":"false","data-vaul-snap-points":d&&E?"true":"false","data-vaul-custom-container":h?"true":"false",...r,ref:x,style:f&&f.length>0?{"--snap-point-height":`${f[0]}px`,...e}:e,onPointerDown:O=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,O),A.current={x:O.pageX,y:O.pageY},a(O))},onOpenAutoFocus:O=>{n==null||n(O),g||O.preventDefault()},onPointerDownOutside:O=>{if(t==null||t(O),!l||O.defaultPrevented){O.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:O=>{if(!l){O.preventDefault();return}},onPointerMove:O=>{if(k.current=O,y||(r.onPointerMove==null||r.onPointerMove.call(r,O),!A.current))return;const L=O.pageY-A.current.y,I=O.pageX-A.current.x,F=O.pointerType==="touch"?10:2;T({x:I,y:L},m,F)?c(O):(Math.abs(I)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),A.current=null,R.current=!1,o(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),D(k.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),D(k.current)}})});Mq.displayName="Drawer.Content";const c1e=250,u1e=120,d1e=se.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:a,activeSnapPoint:o,setActiveSnapPoint:c,dismissible:u,handleOnly:f,isOpen:l,onPress:d,onDrag:m}=C_(),p=se.useRef(null),h=se.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{g()},u1e)}function g(){if(i||t||h.current){w();return}if(w(),(!a||a.length===0)&&u){s();return}if(o===a[a.length-1]&&u){s();return}const A=a.findIndex(R=>R===o);if(A===-1)return;const k=a[A+1];c(k)}function v(){p.current=window.setTimeout(()=>{h.current=!0},c1e)}function w(){window.clearTimeout(p.current),h.current=!1}return se.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:x=>{f&&d(x),v()},onPointerMove:x=>{f&&m(x)},ref:r,"data-vaul-drawer-visible":l?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},se.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});d1e.displayName="Drawer.Handle";function f1e(t){const e=C_(),{container:n=e.container,...r}=t;return se.createElement(MCe,{container:n,...r})}const Cl={Root:l1e,Content:Mq,Overlay:Oq,Portal:f1e,Close:jCe,Title:$Ce,Description:FCe},h1e=({shouldScaleBackground:t=!0,...e})=>P.jsx(Cl.Root,{shouldScaleBackground:t,...e});h1e.displayName="Drawer";const p1e=Cl.Portal,G4e=Cl.Close,Lq=_.forwardRef(({className:t,...e},n)=>P.jsx(Cl.Overlay,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80",t),...e}));Lq.displayName=Cl.Overlay.displayName;const m1e=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(p1e,{children:[P.jsx(Lq,{}),P.jsxs(Cl.Content,{ref:r,className:ce("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[P.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));m1e.displayName="DrawerContent";const g1e=({className:t,...e})=>P.jsx("div",{className:ce("grid gap-1.5 p-4 text-center sm:text-left",t),...e});g1e.displayName="DrawerHeader";const v1e=({className:t,...e})=>P.jsx("div",{className:ce("mt-auto flex flex-col gap-2 p-4",t),...e});v1e.displayName="DrawerFooter";const y1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Cl.Title,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));y1e.displayName=Cl.Title.displayName;const b1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Cl.Description,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));b1e.displayName=Cl.Description.displayName;var jI="DropdownMenu",[w1e,q4e]=Pn(jI,[S_]),Js=S_(),[_1e,Iq]=w1e(jI),$q=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=t,c=Js(e),u=_.useRef(null),[f=!1,l]=sr({prop:s,defaultProp:i,onChange:a});return P.jsx(_1e,{scope:e,triggerId:Hr(),triggerRef:u,contentId:Hr(),open:f,onOpenChange:l,onOpenToggle:_.useCallback(()=>l(d=>!d),[l]),modal:o,children:P.jsx(uEe,{...c,open:f,onOpenChange:l,dir:r,modal:o,children:n})})};$q.displayName=jI;var Fq="DropdownMenuTrigger",jq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=Iq(Fq,n),a=Js(n);return P.jsx(bI,{asChild:!0,...a,children:P.jsx(De.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:e_(e,i.triggerRef),onPointerDown:me(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(i.onOpenToggle(),i.open||o.preventDefault())}),onKeyDown:me(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&i.onOpenToggle(),o.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});jq.displayName=Fq;var x1e="DropdownMenuPortal",zq=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Js(e);return P.jsx(wI,{...r,...n})};zq.displayName=x1e;var Bq="DropdownMenuContent",Uq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Iq(Bq,n),i=Js(n),a=_.useRef(!1);return P.jsx(_I,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:me(t.onCloseAutoFocus,o=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:me(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Uq.displayName=Bq;var S1e="DropdownMenuGroup",Hq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(xI,{...s,...r,ref:e})});Hq.displayName=S1e;var E1e="DropdownMenuLabel",Vq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(SI,{...s,...r,ref:e})});Vq.displayName=E1e;var C1e="DropdownMenuItem",Wq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(EI,{...s,...r,ref:e})});Wq.displayName=C1e;var A1e="DropdownMenuCheckboxItem",Gq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(CI,{...s,...r,ref:e})});Gq.displayName=A1e;var R1e="DropdownMenuRadioGroup",P1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(AI,{...s,...r,ref:e})});P1e.displayName=R1e;var T1e="DropdownMenuRadioItem",qq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(RI,{...s,...r,ref:e})});qq.displayName=T1e;var k1e="DropdownMenuItemIndicator",Kq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(PI,{...s,...r,ref:e})});Kq.displayName=k1e;var D1e="DropdownMenuSeparator",Yq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(TI,{...s,...r,ref:e})});Yq.displayName=D1e;var N1e="DropdownMenuArrow",O1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(kI,{...s,...r,ref:e})});O1e.displayName=N1e;var M1e="DropdownMenuSubTrigger",Xq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(DI,{...s,...r,ref:e})});Xq.displayName=M1e;var L1e="DropdownMenuSubContent",Qq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(NI,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Qq.displayName=L1e;var I1e=$q,$1e=jq,F1e=zq,Zq=Uq,j1e=Hq,Jq=Vq,eK=Wq,tK=Gq,nK=qq,rK=Kq,sK=Yq,iK=Xq,oK=Qq;const z1e=I1e,B1e=$1e,U1e=j1e,H1e=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(iK,{ref:s,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,P.jsx(n_,{className:"w-4 h-4 ml-auto"})]}));H1e.displayName=iK.displayName;const V1e=_.forwardRef(({className:t,...e},n)=>P.jsx(oK,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));V1e.displayName=oK.displayName;const aK=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(F1e,{children:P.jsx(Zq,{ref:r,sideOffset:e,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));aK.displayName=Zq.displayName;const QD=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(eK,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));QD.displayName=eK.displayName;const W1e=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(tK,{ref:s,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(rK,{children:P.jsx(t_,{className:"w-4 h-4"})})}),e]}));W1e.displayName=tK.displayName;const G1e=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(nK,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(rK,{children:P.jsx(L1,{className:"w-2 h-2 fill-current"})})}),e]}));G1e.displayName=nK.displayName;const lK=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(Jq,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));lK.displayName=Jq.displayName;const ZD=_.forwardRef(({className:t,...e},n)=>P.jsx(sK,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));ZD.displayName=sK.displayName;const q1e=({className:t,...e})=>P.jsx("span",{className:ce("ml-auto text-xs tracking-widest opacity-60",t),...e});q1e.displayName="DropdownMenuShortcut";var A_=t=>t.type==="checkbox",xf=t=>t instanceof Date,Ws=t=>t==null;const cK=t=>typeof t=="object";var br=t=>!Ws(t)&&!Array.isArray(t)&&cK(t)&&!xf(t),uK=t=>br(t)&&t.target?A_(t.target)?t.target.checked:t.target.value:t,K1e=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,dK=(t,e)=>t.has(K1e(e)),Y1e=t=>{const e=t.constructor&&t.constructor.prototype;return br(e)&&e.hasOwnProperty("isPrototypeOf")},zI=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Zn(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(zI&&(t instanceof Blob||r))&&(n||br(t)))if(e=n?[]:{},!n&&!Y1e(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=Zn(t[s]));else return t;return e}var R_=t=>Array.isArray(t)?t.filter(Boolean):[],zn=t=>t===void 0,Ie=(t,e,n)=>{if(!e||!br(t))return n;const r=R_(e.split(/[,[\].]+?/)).reduce((s,i)=>Ws(s)?s:s[i],t);return zn(r)||r===t?zn(t[e])?n:t[e]:r},Xi=t=>typeof t=="boolean",BI=t=>/^\w*$/.test(t),fK=t=>R_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Qt=(t,e,n)=>{let r=-1;const s=BI(e)?[e]:fK(e),i=s.length,a=i-1;for(;++rse.useContext(hK),X1e=t=>{const{children:e,...n}=t;return se.createElement(hK.Provider,{value:n},e)};var pK=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const a=i;return e._proxyFormState[a]!==ko.all&&(e._proxyFormState[a]=!r||ko.all),n&&(n[a]=!0),t[a]}});return s};function Q1e(t){const e=Id(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[a,o]=se.useState(n._formState),c=se.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=se.useRef(s);return u.current=s,se.useEffect(()=>n._subscribe({name:u.current,formState:c.current,exact:i,callback:f=>{!r&&o({...n._formState,...f})}}),[n,r,i]),se.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),se.useMemo(()=>pK(a,n,c.current,!1),[a,n])}var dl=t=>typeof t=="string",mK=(t,e,n,r,s)=>dl(t)?(r&&e.watch.add(t),Ie(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),Ie(n,i))):(r&&(e.watchAll=!0),n);function Z1e(t){const e=Id(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:a}=t||{},o=se.useRef(r),c=se.useRef(s);o.current=r,se.useEffect(()=>n._subscribe({name:o.current,formState:{values:!0},exact:a,callback:l=>!i&&f(mK(o.current,n._names,l.values||n._formValues,!1,c.current))}),[n,i,a]);const[u,f]=se.useState(n._getWatch(r,s));return se.useEffect(()=>n._removeUnmounted()),u}function J1e(t){const e=Id(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,a=dK(s._names.array,n),o=Z1e({control:s,name:n,defaultValue:Ie(s._formValues,n,Ie(s._defaultValues,n,t.defaultValue)),exact:!0}),c=Q1e({control:s,name:n,exact:!0}),u=se.useRef(t),f=se.useRef(s.register(n,{...t.rules,value:o,...Xi(t.disabled)?{disabled:t.disabled}:{}})),l=se.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ie(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ie(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ie(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ie(c.validatingFields,n)},error:{enumerable:!0,get:()=>Ie(c.errors,n)}}),[c,n]),d=se.useCallback(y=>f.current.onChange({target:{value:uK(y),name:n},type:uC.CHANGE}),[n]),m=se.useCallback(()=>f.current.onBlur({target:{value:Ie(s._formValues,n),name:n},type:uC.BLUR}),[n,s._formValues]),p=se.useCallback(y=>{const g=Ie(s._fields,n);g&&y&&(g._f.ref={focus:()=>y.focus(),select:()=>y.select(),setCustomValidity:v=>y.setCustomValidity(v),reportValidity:()=>y.reportValidity()})},[s._fields,n]),h=se.useMemo(()=>({name:n,value:o,...Xi(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:d,onBlur:m,ref:p}),[n,r,c.disabled,d,m,p,o]);return se.useEffect(()=>{const y=s._options.shouldUnregister||i;s.register(n,{...u.current.rules,...Xi(u.current.disabled)?{disabled:u.current.disabled}:{}});const g=(v,w)=>{const x=Ie(s._fields,v);x&&x._f&&(x._f.mount=w)};if(g(n,!0),y){const v=Zn(Ie(s._options.defaultValues,n));Qt(s._defaultValues,n,v),zn(Ie(s._formValues,n))&&Qt(s._formValues,n,v)}return!a&&s.register(n),()=>{(a?y&&!s._state.action:y)?s.unregister(n):g(n,!1)}},[n,s,a,i]),se.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),se.useMemo(()=>({field:h,formState:c,fieldState:l}),[h,c,l])}const eAe=t=>t.render(J1e(t));var gK=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},vi=t=>Array.isArray(t)?t:[t],dB=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}},JD=t=>Ws(t)||!cK(t);function Tu(t,e){if(JD(t)||JD(e))return t===e;if(xf(t)&&xf(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n){const i=t[s];if(!r.includes(s))return!1;if(s!=="ref"){const a=e[s];if(xf(i)&&xf(a)||br(i)&&br(a)||Array.isArray(i)&&Array.isArray(a)?!Tu(i,a):i!==a)return!1}}return!0}var As=t=>br(t)&&!Object.keys(t).length,UI=t=>t.type==="file",va=t=>typeof t=="function",dC=t=>{if(!zI)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},vK=t=>t.type==="select-multiple",HI=t=>t.type==="radio",tAe=t=>HI(t)||A_(t),kT=t=>dC(t)&&t.isConnected;function nAe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{for(const e in t)if(va(t[e]))return!0;return!1};function fC(t,e={}){const n=Array.isArray(t);if(br(t)||n)for(const r in t)Array.isArray(t[r])||br(t[r])&&!yK(t[r])?(e[r]=Array.isArray(t[r])?[]:{},fC(t[r],e[r])):Ws(t[r])||(e[r]=!0);return e}function bK(t,e,n){const r=Array.isArray(t);if(br(t)||r)for(const s in t)Array.isArray(t[s])||br(t[s])&&!yK(t[s])?zn(e)||JD(n[s])?n[s]=Array.isArray(t[s])?fC(t[s],[]):{...fC(t[s])}:bK(t[s],Ws(e)?{}:e[s],n[s]):n[s]=!Tu(t[s],e[s]);return n}var wy=(t,e)=>bK(t,e,fC(e));const fB={value:!1,isValid:!1},hB={value:!0,isValid:!0};var wK=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!zn(t[0].attributes.value)?zn(t[0].value)||t[0].value===""?hB:{value:t[0].value,isValid:!0}:hB:fB}return fB},_K=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>zn(t)?t:e?t===""?NaN:t&&+t:n&&dl(t)?new Date(t):r?r(t):t;const pB={isValid:!1,value:null};var xK=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,pB):pB;function mB(t){const e=t.ref;return UI(e)?e.files:HI(e)?xK(t.refs).value:vK(e)?[...e.selectedOptions].map(({value:n})=>n):A_(e)?wK(t.refs).value:_K(zn(e.value)?t.ref.value:e.value,t)}var sAe=(t,e,n,r)=>{const s={};for(const i of t){const a=Ie(e,i);a&&Qt(s,i,a._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},hC=t=>t instanceof RegExp,_y=t=>zn(t)?t:hC(t)?t.source:br(t)?hC(t.value)?t.value.source:t.value:t,bm=t=>({isOnSubmit:!t||t===ko.onSubmit,isOnBlur:t===ko.onBlur,isOnChange:t===ko.onChange,isOnAll:t===ko.all,isOnTouch:t===ko.onTouched});const gB="AsyncFunction";var iAe=t=>!!t&&!!t.validate&&!!(va(t.validate)&&t.validate.constructor.name===gB||br(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===gB)),oAe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),eN=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const $m=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=Ie(t,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],s)&&!r)return!0;if(a.ref&&e(a.ref,a.name)&&!r)return!0;if($m(o,e))break}else if(br(o)&&$m(o,e))break}}};function vB(t,e,n){const r=Ie(t,n);if(r||BI(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),a=Ie(e,i),o=Ie(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(o&&o.type)return{name:i,error:o};s.pop()}return{name:n}}var aAe=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return As(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||ko.all))},lAe=(t,e,n)=>!t||!e||t===e||vi(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),cAe=(t,e,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(e||t):(n?r.isOnBlur:s.isOnBlur)?!t:(n?r.isOnChange:s.isOnChange)?t:!0,uAe=(t,e)=>!R_(Ie(t,e)).length&&Sr(t,e),SK=(t,e,n)=>{const r=vi(Ie(t,n));return Qt(r,"root",e[n]),Qt(t,n,r),t},US=t=>dl(t);function yB(t,e,n="validate"){if(US(t)||Array.isArray(t)&&t.every(US)||Xi(t)&&!t)return{type:n,message:US(t)?t:"",ref:e}}var Bp=t=>br(t)&&!hC(t)?t:{value:t,message:""},tN=async(t,e,n,r,s,i)=>{const{ref:a,refs:o,required:c,maxLength:u,minLength:f,min:l,max:d,pattern:m,validate:p,name:h,valueAsNumber:y,mount:g}=t._f,v=Ie(n,h);if(!g||e.has(h))return{};const w=o?o[0]:a,x=L=>{s&&w.reportValidity&&(w.setCustomValidity(Xi(L)?"":L||""),w.reportValidity())},A={},k=HI(a),R=A_(a),E=k||R,T=(y||UI(a))&&zn(a.value)&&zn(v)||dC(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,D=gK.bind(null,h,r,A),O=(L,I,F,U=Bl.maxLength,Y=Bl.minLength)=>{const V=L?I:F;A[h]={type:L?U:Y,message:V,ref:a,...D(L?U:Y,V)}};if(i?!Array.isArray(v)||!v.length:c&&(!E&&(T||Ws(v))||Xi(v)&&!v||R&&!wK(o).isValid||k&&!xK(o).isValid)){const{value:L,message:I}=US(c)?{value:!!c,message:c}:Bp(c);if(L&&(A[h]={type:Bl.required,message:I,ref:w,...D(Bl.required,I)},!r))return x(I),A}if(!T&&(!Ws(l)||!Ws(d))){let L,I;const F=Bp(d),U=Bp(l);if(!Ws(v)&&!isNaN(v)){const Y=a.valueAsNumber||v&&+v;Ws(F.value)||(L=Y>F.value),Ws(U.value)||(I=Ynew Date(new Date().toDateString()+" "+re),H=a.type=="time",ee=a.type=="week";dl(F.value)&&v&&(L=H?V(v)>V(F.value):ee?v>F.value:Y>new Date(F.value)),dl(U.value)&&v&&(I=H?V(v)+L.value,U=!Ws(I.value)&&v.length<+I.value;if((F||U)&&(O(F,L.message,I.message),!r))return x(A[h].message),A}if(m&&!T&&dl(v)){const{value:L,message:I}=Bp(m);if(hC(L)&&!v.match(L)&&(A[h]={type:Bl.pattern,message:I,ref:a,...D(Bl.pattern,I)},!r))return x(I),A}if(p){if(va(p)){const L=await p(v,n),I=yB(L,w);if(I&&(A[h]={...I,...D(Bl.validate,I.message)},!r))return x(I.message),A}else if(br(p)){let L={};for(const I in p){if(!As(L)&&!r)break;const F=yB(await p[I](v,n),w,I);F&&(L={...F,...D(I,F.message)},x(F.message),r&&(A[h]=L))}if(!As(L)&&(A[h]={ref:w,...L},!r))return A}}return x(!0),A};const dAe={mode:ko.onSubmit,reValidateMode:ko.onChange,shouldFocusError:!0};function fAe(t={}){let e={...dAe,...t},n={submitCount:0,isDirty:!1,isLoading:va(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let s=br(e.defaultValues)||br(e.values)?Zn(e.values||e.defaultValues)||{}:{},i=e.shouldUnregister?{}:Zn(s),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let l={...f};const d={array:dB(),state:dB()},m=bm(e.mode),p=bm(e.reValidateMode),h=e.criteriaMode===ko.all,y=J=>fe=>{clearTimeout(u),u=setTimeout(J,fe)},g=async J=>{if(!e.disabled&&(f.isValid||l.isValid||J)){const fe=e.resolver?As((await T()).errors):await O(r,!0);fe!==n.isValid&&d.state.next({isValid:fe})}},v=(J,fe)=>{!e.disabled&&(f.isValidating||f.validatingFields||l.isValidating||l.validatingFields)&&((J||Array.from(o.mount)).forEach(ge=>{ge&&(fe?Qt(n.validatingFields,ge,fe):Sr(n.validatingFields,ge))}),d.state.next({validatingFields:n.validatingFields,isValidating:!As(n.validatingFields)}))},w=(J,fe=[],ge,Pe,Oe=!0,xe=!0)=>{if(Pe&&ge&&!e.disabled){if(a.action=!0,xe&&Array.isArray(Ie(r,J))){const Te=ge(Ie(r,J),Pe.argA,Pe.argB);Oe&&Qt(r,J,Te)}if(xe&&Array.isArray(Ie(n.errors,J))){const Te=ge(Ie(n.errors,J),Pe.argA,Pe.argB);Oe&&Qt(n.errors,J,Te),uAe(n.errors,J)}if((f.touchedFields||l.touchedFields)&&xe&&Array.isArray(Ie(n.touchedFields,J))){const Te=ge(Ie(n.touchedFields,J),Pe.argA,Pe.argB);Oe&&Qt(n.touchedFields,J,Te)}(f.dirtyFields||l.dirtyFields)&&(n.dirtyFields=wy(s,i)),d.state.next({name:J,isDirty:I(J,fe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qt(i,J,fe)},x=(J,fe)=>{Qt(n.errors,J,fe),d.state.next({errors:n.errors})},A=J=>{n.errors=J,d.state.next({errors:n.errors,isValid:!1})},k=(J,fe,ge,Pe)=>{const Oe=Ie(r,J);if(Oe){const xe=Ie(i,J,zn(ge)?Ie(s,J):ge);zn(xe)||Pe&&Pe.defaultChecked||fe?Qt(i,J,fe?xe:mB(Oe._f)):Y(J,xe),a.mount&&g()}},R=(J,fe,ge,Pe,Oe)=>{let xe=!1,Te=!1;const Ye={name:J};if(!e.disabled){if(!ge||Pe){(f.isDirty||l.isDirty)&&(Te=n.isDirty,n.isDirty=Ye.isDirty=I(),xe=Te!==Ye.isDirty);const Rt=Tu(Ie(s,J),fe);Te=!!Ie(n.dirtyFields,J),Rt?Sr(n.dirtyFields,J):Qt(n.dirtyFields,J,!0),Ye.dirtyFields=n.dirtyFields,xe=xe||(f.dirtyFields||l.dirtyFields)&&Te!==!Rt}if(ge){const Rt=Ie(n.touchedFields,J);Rt||(Qt(n.touchedFields,J,ge),Ye.touchedFields=n.touchedFields,xe=xe||(f.touchedFields||l.touchedFields)&&Rt!==ge)}xe&&Oe&&d.state.next(Ye)}return xe?Ye:{}},E=(J,fe,ge,Pe)=>{const Oe=Ie(n.errors,J),xe=(f.isValid||l.isValid)&&Xi(fe)&&n.isValid!==fe;if(e.delayError&&ge?(c=y(()=>x(J,ge)),c(e.delayError)):(clearTimeout(u),c=null,ge?Qt(n.errors,J,ge):Sr(n.errors,J)),(ge?!Tu(Oe,ge):Oe)||!As(Pe)||xe){const Te={...Pe,...xe&&Xi(fe)?{isValid:fe}:{},errors:n.errors,name:J};n={...n,...Te},d.state.next(Te)}},T=async J=>{v(J,!0);const fe=await e.resolver(i,e.context,sAe(J||o.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return v(J),fe},D=async J=>{const{errors:fe}=await T(J);if(J)for(const ge of J){const Pe=Ie(fe,ge);Pe?Qt(n.errors,ge,Pe):Sr(n.errors,ge)}else n.errors=fe;return fe},O=async(J,fe,ge={valid:!0})=>{for(const Pe in J){const Oe=J[Pe];if(Oe){const{_f:xe,...Te}=Oe;if(xe){const Ye=o.array.has(xe.name),Rt=Oe._f&&iAe(Oe._f);Rt&&f.validatingFields&&v([Pe],!0);const bt=await tN(Oe,o.disabled,i,h,e.shouldUseNativeValidation&&!fe,Ye);if(Rt&&f.validatingFields&&v([Pe]),bt[xe.name]&&(ge.valid=!1,fe))break;!fe&&(Ie(bt,xe.name)?Ye?SK(n.errors,bt,xe.name):Qt(n.errors,xe.name,bt[xe.name]):Sr(n.errors,xe.name))}!As(Te)&&await O(Te,fe,ge)}}return ge.valid},L=()=>{for(const J of o.unMount){const fe=Ie(r,J);fe&&(fe._f.refs?fe._f.refs.every(ge=>!kT(ge)):!kT(fe._f.ref))&&Ae(J)}o.unMount=new Set},I=(J,fe)=>!e.disabled&&(J&&fe&&Qt(i,J,fe),!Tu(q(),s)),F=(J,fe,ge)=>mK(J,o,{...a.mount?i:zn(fe)?s:dl(J)?{[J]:fe}:fe},ge,fe),U=J=>R_(Ie(a.mount?i:s,J,e.shouldUnregister?Ie(s,J,[]):[])),Y=(J,fe,ge={})=>{const Pe=Ie(r,J);let Oe=fe;if(Pe){const xe=Pe._f;xe&&(!xe.disabled&&Qt(i,J,_K(fe,xe)),Oe=dC(xe.ref)&&Ws(fe)?"":fe,vK(xe.ref)?[...xe.ref.options].forEach(Te=>Te.selected=Oe.includes(Te.value)):xe.refs?A_(xe.ref)?xe.refs.length>1?xe.refs.forEach(Te=>(!Te.defaultChecked||!Te.disabled)&&(Te.checked=Array.isArray(Oe)?!!Oe.find(Ye=>Ye===Te.value):Oe===Te.value)):xe.refs[0]&&(xe.refs[0].checked=!!Oe):xe.refs.forEach(Te=>Te.checked=Te.value===Oe):UI(xe.ref)?xe.ref.value="":(xe.ref.value=Oe,xe.ref.type||d.state.next({name:J,values:Zn(i)})))}(ge.shouldDirty||ge.shouldTouch)&&R(J,Oe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&X(J)},V=(J,fe,ge)=>{for(const Pe in fe){const Oe=fe[Pe],xe=`${J}.${Pe}`,Te=Ie(r,xe);(o.array.has(J)||br(Oe)||Te&&!Te._f)&&!xf(Oe)?V(xe,Oe,ge):Y(xe,Oe,ge)}},H=(J,fe,ge={})=>{const Pe=Ie(r,J),Oe=o.array.has(J),xe=Zn(fe);Qt(i,J,xe),Oe?(d.array.next({name:J,values:Zn(i)}),(f.isDirty||f.dirtyFields||l.isDirty||l.dirtyFields)&&ge.shouldDirty&&d.state.next({name:J,dirtyFields:wy(s,i),isDirty:I(J,xe)})):Pe&&!Pe._f&&!Ws(xe)?V(J,xe,ge):Y(J,xe,ge),eN(J,o)&&d.state.next({...n}),d.state.next({name:a.mount?J:void 0,values:Zn(i)})},ee=async J=>{a.mount=!0;const fe=J.target;let ge=fe.name,Pe=!0;const Oe=Ie(r,ge),xe=Te=>{Pe=Number.isNaN(Te)||xf(Te)&&isNaN(Te.getTime())||Tu(Te,Ie(i,ge,Te))};if(Oe){let Te,Ye;const Rt=fe.type?mB(Oe._f):uK(J),bt=J.type===uC.BLUR||J.type===uC.FOCUS_OUT,Os=!oAe(Oe._f)&&!e.resolver&&!Ie(n.errors,ge)&&!Oe._f.deps||cAe(bt,Ie(n.touchedFields,ge),n.isSubmitted,p,m),Kn=eN(ge,o,bt);Qt(i,ge,Rt),bt?(Oe._f.onBlur&&Oe._f.onBlur(J),c&&c(0)):Oe._f.onChange&&Oe._f.onChange(J);const ps=R(ge,Rt,bt),Ut=!As(ps)||Kn;if(!bt&&d.state.next({name:ge,type:J.type,values:Zn(i)}),Os)return(f.isValid||l.isValid)&&(e.mode==="onBlur"?bt&&g():bt||g()),Ut&&d.state.next({name:ge,...Kn?{}:ps});if(!bt&&Kn&&d.state.next({...n}),e.resolver){const{errors:on}=await T([ge]);if(xe(Rt),Pe){const gn=vB(n.errors,r,ge),Be=vB(on,r,gn.name||ge);Te=Be.error,ge=Be.name,Ye=As(on)}}else v([ge],!0),Te=(await tN(Oe,o.disabled,i,h,e.shouldUseNativeValidation))[ge],v([ge]),xe(Rt),Pe&&(Te?Ye=!1:(f.isValid||l.isValid)&&(Ye=await O(r,!0)));Pe&&(Oe._f.deps&&X(Oe._f.deps),E(ge,Ye,Te,ps))}},re=(J,fe)=>{if(Ie(n.errors,fe)&&J.focus)return J.focus(),1},X=async(J,fe={})=>{let ge,Pe;const Oe=vi(J);if(e.resolver){const xe=await D(zn(J)?J:Oe);ge=As(xe),Pe=J?!Oe.some(Te=>Ie(xe,Te)):ge}else J?(Pe=(await Promise.all(Oe.map(async xe=>{const Te=Ie(r,xe);return await O(Te&&Te._f?{[xe]:Te}:Te)}))).every(Boolean),!(!Pe&&!n.isValid)&&g()):Pe=ge=await O(r);return d.state.next({...!dl(J)||(f.isValid||l.isValid)&&ge!==n.isValid?{}:{name:J},...e.resolver||!J?{isValid:ge}:{},errors:n.errors}),fe.shouldFocus&&!Pe&&$m(r,re,J?Oe:o.mount),Pe},q=J=>{const fe={...a.mount?i:s};return zn(J)?fe:dl(J)?Ie(fe,J):J.map(ge=>Ie(fe,ge))},K=(J,fe)=>({invalid:!!Ie((fe||n).errors,J),isDirty:!!Ie((fe||n).dirtyFields,J),error:Ie((fe||n).errors,J),isValidating:!!Ie(n.validatingFields,J),isTouched:!!Ie((fe||n).touchedFields,J)}),Z=J=>{J&&vi(J).forEach(fe=>Sr(n.errors,fe)),d.state.next({errors:J?n.errors:{}})},ue=(J,fe,ge)=>{const Pe=(Ie(r,J,{_f:{}})._f||{}).ref,Oe=Ie(n.errors,J)||{},{ref:xe,message:Te,type:Ye,...Rt}=Oe;Qt(n.errors,J,{...Rt,...fe,ref:Pe}),d.state.next({name:J,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Pe&&Pe.focus&&Pe.focus()},de=(J,fe)=>va(J)?d.state.subscribe({next:ge=>J(F(void 0,fe),ge)}):F(J,fe,!0),ie=J=>d.state.subscribe({next:fe=>{lAe(J.name,fe.name,J.exact)&&aAe(fe,J.formState||f,Yt,J.reRenderRoot)&&J.callback({values:{...i},...n,...fe})}}).unsubscribe,be=J=>(a.mount=!0,l={...l,...J.formState},ie({...J,formState:l})),Ae=(J,fe={})=>{for(const ge of J?vi(J):o.mount)o.mount.delete(ge),o.array.delete(ge),fe.keepValue||(Sr(r,ge),Sr(i,ge)),!fe.keepError&&Sr(n.errors,ge),!fe.keepDirty&&Sr(n.dirtyFields,ge),!fe.keepTouched&&Sr(n.touchedFields,ge),!fe.keepIsValidating&&Sr(n.validatingFields,ge),!e.shouldUnregister&&!fe.keepDefaultValue&&Sr(s,ge);d.state.next({values:Zn(i)}),d.state.next({...n,...fe.keepDirty?{isDirty:I()}:{}}),!fe.keepIsValid&&g()},_e=({disabled:J,name:fe})=>{(Xi(J)&&a.mount||J||o.disabled.has(fe))&&(J?o.disabled.add(fe):o.disabled.delete(fe))},Me=(J,fe={})=>{let ge=Ie(r,J);const Pe=Xi(fe.disabled)||Xi(e.disabled);return Qt(r,J,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:J}},name:J,mount:!0,...fe}}),o.mount.add(J),ge?_e({disabled:Xi(fe.disabled)?fe.disabled:e.disabled,name:J}):k(J,!0,fe.value),{...Pe?{disabled:fe.disabled||e.disabled}:{},...e.progressive?{required:!!fe.required,min:_y(fe.min),max:_y(fe.max),minLength:_y(fe.minLength),maxLength:_y(fe.maxLength),pattern:_y(fe.pattern)}:{},name:J,onChange:ee,onBlur:ee,ref:Oe=>{if(Oe){Me(J,fe),ge=Ie(r,J);const xe=zn(Oe.value)&&Oe.querySelectorAll&&Oe.querySelectorAll("input,select,textarea")[0]||Oe,Te=tAe(xe),Ye=ge._f.refs||[];if(Te?Ye.find(Rt=>Rt===xe):xe===ge._f.ref)return;Qt(r,J,{_f:{...ge._f,...Te?{refs:[...Ye.filter(kT),xe,...Array.isArray(Ie(s,J))?[{}]:[]],ref:{type:xe.type,name:J}}:{ref:xe}}}),k(J,!1,void 0,xe)}else ge=Ie(r,J,{}),ge._f&&(ge._f.mount=!1),(e.shouldUnregister||fe.shouldUnregister)&&!(dK(o.array,J)&&a.action)&&o.unMount.add(J)}}},Ne=()=>e.shouldFocusError&&$m(r,re,o.mount),ye=J=>{Xi(J)&&(d.state.next({disabled:J}),$m(r,(fe,ge)=>{const Pe=Ie(r,ge);Pe&&(fe.disabled=Pe._f.disabled||J,Array.isArray(Pe._f.refs)&&Pe._f.refs.forEach(Oe=>{Oe.disabled=Pe._f.disabled||J}))},0,!1))},$e=(J,fe)=>async ge=>{let Pe;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Oe=Zn(i);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:xe,values:Te}=await T();n.errors=xe,Oe=Te}else await O(r);if(o.disabled.size)for(const xe of o.disabled)Qt(Oe,xe,void 0);if(Sr(n.errors,"root"),As(n.errors)){d.state.next({errors:{}});try{await J(Oe,ge)}catch(xe){Pe=xe}}else fe&&await fe({...n.errors},ge),Ne(),setTimeout(Ne);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:As(n.errors)&&!Pe,submitCount:n.submitCount+1,errors:n.errors}),Pe)throw Pe},ut=(J,fe={})=>{Ie(r,J)&&(zn(fe.defaultValue)?H(J,Zn(Ie(s,J))):(H(J,fe.defaultValue),Qt(s,J,Zn(fe.defaultValue))),fe.keepTouched||Sr(n.touchedFields,J),fe.keepDirty||(Sr(n.dirtyFields,J),n.isDirty=fe.defaultValue?I(J,Zn(Ie(s,J))):I()),fe.keepError||(Sr(n.errors,J),f.isValid&&g()),d.state.next({...n}))},Qe=(J,fe={})=>{const ge=J?Zn(J):s,Pe=Zn(ge),Oe=As(J),xe=Oe?s:Pe;if(fe.keepDefaultValues||(s=ge),!fe.keepValues){if(fe.keepDirtyValues){const Te=new Set([...o.mount,...Object.keys(wy(s,i))]);for(const Ye of Array.from(Te))Ie(n.dirtyFields,Ye)?Qt(xe,Ye,Ie(i,Ye)):H(Ye,Ie(xe,Ye))}else{if(zI&&zn(J))for(const Te of o.mount){const Ye=Ie(r,Te);if(Ye&&Ye._f){const Rt=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(dC(Rt)){const bt=Rt.closest("form");if(bt){bt.reset();break}}}}for(const Te of o.mount)H(Te,Ie(xe,Te))}i=Zn(xe),d.array.next({values:{...xe}}),d.state.next({values:{...xe}})}o={mount:fe.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!fe.keepIsValid||!!fe.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:fe.keepSubmitCount?n.submitCount:0,isDirty:Oe?!1:fe.keepDirty?n.isDirty:!!(fe.keepDefaultValues&&!Tu(J,s)),isSubmitted:fe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe?{}:fe.keepDirtyValues?fe.keepDefaultValues&&i?wy(s,i):n.dirtyFields:fe.keepDefaultValues&&J?wy(s,J):fe.keepDirty?n.dirtyFields:{},touchedFields:fe.keepTouched?n.touchedFields:{},errors:fe.keepErrors?n.errors:{},isSubmitSuccessful:fe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},vt=(J,fe)=>Qe(va(J)?J(i):J,fe),Sn=(J,fe={})=>{const ge=Ie(r,J),Pe=ge&&ge._f;if(Pe){const Oe=Pe.refs?Pe.refs[0]:Pe.ref;Oe.focus&&(Oe.focus(),fe.shouldSelect&&va(Oe.select)&&Oe.select())}},Yt=J=>{n={...n,...J}},Xt={control:{register:Me,unregister:Ae,getFieldState:K,handleSubmit:$e,setError:ue,_subscribe:ie,_runSchema:T,_getWatch:F,_getDirty:I,_setValid:g,_setFieldArray:w,_setDisabledField:_e,_setErrors:A,_getFieldArray:U,_reset:Qe,_resetDefaultValues:()=>va(e.defaultValues)&&e.defaultValues().then(J=>{vt(J,e.resetOptions),d.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:ye,_subjects:d,_proxyFormState:f,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(J){a=J},get _defaultValues(){return s},get _names(){return o},set _names(J){o=J},get _formState(){return n},get _options(){return e},set _options(J){e={...e,...J}}},subscribe:be,trigger:X,register:Me,handleSubmit:$e,watch:de,setValue:H,getValues:q,reset:vt,resetField:ut,clearErrors:Z,unregister:Ae,setError:ue,setFocus:Sn,getFieldState:K};return{...Xt,formControl:Xt}}var pu=()=>{const t=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(Math.random()*16+t)%16|0;return(e=="x"?n:n&3|8).toString(16)})},DT=(t,e,n={})=>n.shouldFocus||zn(n.shouldFocus)?n.focusName||`${t}.${zn(n.focusIndex)?e:n.focusIndex}.`:"",NT=(t,e)=>[...t,...vi(e)],OT=t=>Array.isArray(t)?t.map(()=>{}):void 0;function MT(t,e,n){return[...t.slice(0,e),...vi(n),...t.slice(e)]}var LT=(t,e,n)=>Array.isArray(t)?(zn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],IT=(t,e)=>[...vi(e),...vi(t)];function hAe(t,e){let n=0;const r=[...t];for(const s of e)r.splice(s-n,1),n++;return R_(r).length?r:[]}var $T=(t,e)=>zn(e)?[]:hAe(t,vi(e).sort((n,r)=>n-r)),FT=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]},bB=(t,e,n)=>(t[e]=n,t);function K4e(t){const e=Id(),{control:n=e.control,name:r,keyName:s="id",shouldUnregister:i,rules:a}=t,[o,c]=se.useState(n._getFieldArray(r)),u=se.useRef(n._getFieldArray(r).map(pu)),f=se.useRef(o),l=se.useRef(r),d=se.useRef(!1);l.current=r,f.current=o,n._names.array.add(r),a&&n.register(r,a),se.useEffect(()=>n._subjects.array.subscribe({next:({values:k,name:R})=>{if(R===l.current||!R){const E=Ie(k,l.current);Array.isArray(E)&&(c(E),u.current=E.map(pu))}}}).unsubscribe,[n]);const m=se.useCallback(k=>{d.current=!0,n._setFieldArray(r,k)},[n,r]),p=(k,R)=>{const E=vi(Zn(k)),T=NT(n._getFieldArray(r),E);n._names.focus=DT(r,T.length-1,R),u.current=NT(u.current,E.map(pu)),m(T),c(T),n._setFieldArray(r,T,NT,{argA:OT(k)})},h=(k,R)=>{const E=vi(Zn(k)),T=IT(n._getFieldArray(r),E);n._names.focus=DT(r,0,R),u.current=IT(u.current,E.map(pu)),m(T),c(T),n._setFieldArray(r,T,IT,{argA:OT(k)})},y=k=>{const R=$T(n._getFieldArray(r),k);u.current=$T(u.current,k),m(R),c(R),!Array.isArray(Ie(n._fields,r))&&Qt(n._fields,r,void 0),n._setFieldArray(r,R,$T,{argA:k})},g=(k,R,E)=>{const T=vi(Zn(R)),D=MT(n._getFieldArray(r),k,T);n._names.focus=DT(r,k,E),u.current=MT(u.current,k,T.map(pu)),m(D),c(D),n._setFieldArray(r,D,MT,{argA:k,argB:OT(R)})},v=(k,R)=>{const E=n._getFieldArray(r);FT(E,k,R),FT(u.current,k,R),m(E),c(E),n._setFieldArray(r,E,FT,{argA:k,argB:R},!1)},w=(k,R)=>{const E=n._getFieldArray(r);LT(E,k,R),LT(u.current,k,R),m(E),c(E),n._setFieldArray(r,E,LT,{argA:k,argB:R},!1)},x=(k,R)=>{const E=Zn(R),T=bB(n._getFieldArray(r),k,E);u.current=[...T].map((D,O)=>!D||O===k?pu():u.current[O]),m(T),c([...T]),n._setFieldArray(r,T,bB,{argA:k,argB:E},!0,!1)},A=k=>{const R=vi(Zn(k));u.current=R.map(pu),m([...R]),c([...R]),n._setFieldArray(r,[...R],E=>E,{},!0,!1)};return se.useEffect(()=>{if(n._state.action=!1,eN(r,n._names)&&n._subjects.state.next({...n._formState}),d.current&&(!bm(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!bm(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(k=>{const R=Ie(k.errors,r),E=Ie(n._formState.errors,r);(E?!R&&E.type||R&&(E.type!==R.type||E.message!==R.message):R&&R.type)&&(R?Qt(n._formState.errors,r,R):Sr(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ie(n._fields,r);k&&k._f&&!(bm(n._options.reValidateMode).isOnSubmit&&bm(n._options.mode).isOnSubmit)&&tN(k,n._names.disabled,n._formValues,n._options.criteriaMode===ko.all,n._options.shouldUseNativeValidation,!0).then(R=>!As(R)&&n._subjects.state.next({errors:SK(n._formState.errors,R,r)}))}n._subjects.state.next({name:r,values:Zn(n._formValues)}),n._names.focus&&$m(n._fields,(k,R)=>{if(n._names.focus&&R.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),d.current=!1},[o,r,n]),se.useEffect(()=>(!Ie(n._formValues,r)&&n._setFieldArray(r),()=>{const k=(R,E)=>{const T=Ie(n._fields,R);T&&T._f&&(T._f.mount=E)};n._options.shouldUnregister||i?n.unregister(r):k(r,!1)}),[r,n,s,i]),{swap:se.useCallback(v,[m,r,n]),move:se.useCallback(w,[m,r,n]),prepend:se.useCallback(h,[m,r,n]),append:se.useCallback(p,[m,r,n]),remove:se.useCallback(y,[m,r,n]),insert:se.useCallback(g,[m,r,n]),update:se.useCallback(x,[m,r,n]),replace:se.useCallback(A,[m,r,n]),fields:se.useMemo(()=>o.map((k,R)=>({...k,[s]:u.current[R]||pu()})),[o,s])}}function pAe(t={}){const e=se.useRef(void 0),n=se.useRef(void 0),[r,s]=se.useState({isDirty:!1,isValidating:!1,isLoading:va(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:va(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...t.formControl?t.formControl:fAe(t),formState:r},t.formControl&&t.defaultValues&&!va(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const i=e.current.control;return i._options=t,se.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),se.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),se.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),se.useEffect(()=>{t.values&&!Tu(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,s(a=>({...a}))):i._resetDefaultValues()},[t.values,i]),se.useEffect(()=>{t.errors&&!As(t.errors)&&i._setErrors(t.errors)},[t.errors,i]),se.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),se.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=pK(r,i),e.current}var mAe="Label",EK=_.forwardRef((t,e)=>P.jsx(De.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));EK.displayName=mAe;var CK=EK;const gAe=jo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),AK=_.forwardRef(({className:t,...e},n)=>P.jsx(CK,{ref:n,className:ce(gAe(),t),...e}));AK.displayName=CK.displayName;const vAe=X1e,RK=_.createContext({}),VI=({...t})=>P.jsx(RK.Provider,{value:{name:t.name},children:P.jsx(eAe,{...t},t.name)}),Tv=()=>{const t=_.useContext(RK),e=_.useContext(PK),{getFieldState:n,formState:r}=Id(),s=n(t.name,r);if(!t)throw new Error("useFormField should be used within ");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},PK=_.createContext({}),fA=_.forwardRef(({className:t,...e},n)=>{const r=_.useId();return P.jsx(PK.Provider,{value:{id:r},children:P.jsx("div",{ref:n,className:ce("space-y-2",t),...e})})});fA.displayName="FormItem";const TK=_.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=Tv();return P.jsx(AK,{ref:n,className:ce(r&&"text-destructive",t),htmlFor:s,...e})});TK.displayName="FormLabel";const hA=_.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=Tv();return P.jsx(Sa,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});hA.displayName="FormControl";const pA=_.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=Tv();return P.jsx("p",{ref:n,id:r,className:ce("text-[0.8rem] text-muted-foreground",t),...e})});pA.displayName="FormDescription";const kK=_.forwardRef(({className:t,children:e,...n},r)=>{const{error:s,formMessageId:i}=Tv(),a=s?String((s==null?void 0:s.message)??""):e;return a?P.jsx("p",{ref:r,id:i,className:ce("text-[0.8rem] font-medium text-destructive",t),...n,children:a}):null});kK.displayName="FormMessage";var jT,DK="HoverCard",[NK,Y4e]=Pn(DK,[Sl]),WI=Sl(),[X4e,GI]=NK(DK),OK="HoverCardTrigger",yAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=GI(OK,n),i=WI(n);return P.jsx(Pv,{asChild:!0,...i,children:P.jsx(De.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:me(t.onPointerEnter,mC(s.onOpen)),onPointerLeave:me(t.onPointerLeave,mC(s.onClose)),onFocus:me(t.onFocus,s.onOpen),onBlur:me(t.onBlur,s.onClose),onTouchStart:me(t.onTouchStart,a=>a.preventDefault())})})});yAe.displayName=OK;var bAe="HoverCardPortal",[Q4e,wAe]=NK(bAe,{forceMount:void 0}),pC="HoverCardContent",MK=_.forwardRef((t,e)=>{const n=wAe(pC,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=GI(pC,t.__scopeHoverCard);return P.jsx(Un,{present:r||i.open,children:P.jsx(_Ae,{"data-state":i.open?"open":"closed",...s,onPointerEnter:me(t.onPointerEnter,mC(i.onOpen)),onPointerLeave:me(t.onPointerLeave,mC(i.onClose)),ref:e})})});MK.displayName=pC;var _Ae=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,...o}=t,c=GI(pC,n),u=WI(n),f=_.useRef(null),l=tt(e,f),[d,m]=_.useState(!1);return _.useEffect(()=>{if(d){const p=document.body;return jT=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=jT,p.style.webkitUserSelect=jT}}},[d]),_.useEffect(()=>{if(f.current){const p=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),_.useEffect(()=>{f.current&&EAe(f.current).forEach(h=>h.setAttribute("tabindex","-1"))}),P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:me(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:P.jsx(y_,{...u,...o,onPointerDown:me(o.onPointerDown,p=>{p.currentTarget.contains(p.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:l,style:{...o.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),xAe="HoverCardArrow",SAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=WI(n);return P.jsx(b_,{...s,...r,ref:e})});SAe.displayName=xAe;function mC(t){return e=>e.pointerType==="touch"?void 0:t()}function EAe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var LK=MK;const CAe=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(LK,{ref:s,align:e,sideOffset:n,className:ce("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));CAe.displayName=LK.displayName;const AAe=_.forwardRef(({className:t,type:e,...n},r)=>P.jsx("input",{type:e,className:ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));AAe.displayName="Input";var mA="Menubar",[nN,RAe,PAe]=qc(mA),[IK,Z4e]=Pn(mA,[PAe,El]),Pi=S_(),$K=El(),[TAe,FK]=IK(mA),jK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:a=!0,dir:o,...c}=t,u=Ta(o),f=$K(n),[l="",d]=sr({prop:r,onChange:s,defaultProp:i}),[m,p]=_.useState(null);return P.jsx(TAe,{scope:n,value:l,onMenuOpen:_.useCallback(h=>{d(h),p(h)},[d]),onMenuClose:_.useCallback(()=>d(""),[d]),onMenuToggle:_.useCallback(h=>{d(y=>y?"":h),p(h)},[d]),dir:u,loop:a,children:P.jsx(nN.Provider,{scope:n,children:P.jsx(nN.Slot,{scope:n,children:P.jsx(w_,{asChild:!0,...f,orientation:"horizontal",loop:a,dir:u,currentTabStopId:m,onCurrentTabStopIdChange:p,children:P.jsx(De.div,{role:"menubar",...c,ref:e})})})})})});jK.displayName=mA;var kAe="MenubarMenu",[J4e,zK]=IK(kAe),rN="MenubarTrigger",BK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=$K(n),a=Pi(n),o=FK(rN,n),c=zK(rN,n),u=_.useRef(null),f=tt(e,u,c.triggerRef),[l,d]=_.useState(!1),m=o.value===c.value;return P.jsx(nN.ItemSlot,{scope:n,value:c.value,disabled:r,children:P.jsx(__,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:P.jsx(bI,{asChild:!0,...a,children:P.jsx(De.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?c.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":m?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f,onPointerDown:me(t.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(o.onMenuOpen(c.value),m||p.preventDefault())}),onPointerEnter:me(t.onPointerEnter,()=>{var h;!!o.value&&!m&&(o.onMenuOpen(c.value),(h=u.current)==null||h.focus())}),onKeyDown:me(t.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&o.onMenuToggle(c.value),p.key==="ArrowDown"&&o.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(p.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:me(t.onFocus,()=>d(!0)),onBlur:me(t.onBlur,()=>d(!1))})})})})});BK.displayName=rN;var DAe="MenubarPortal",UK=t=>{const{__scopeMenubar:e,...n}=t,r=Pi(e);return P.jsx(wI,{...r,...n})};UK.displayName=DAe;var sN="MenubarContent",HK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Pi(n),a=FK(sN,n),o=zK(sN,n),c=RAe(n),u=_.useRef(!1);return P.jsx(_I,{id:o.contentId,"aria-labelledby":o.triggerId,"data-radix-menubar-content":"",...i,...s,ref:e,align:r,onCloseAutoFocus:me(t.onCloseAutoFocus,f=>{var d;!!!a.value&&!u.current&&((d=o.triggerRef.current)==null||d.focus()),u.current=!1,f.preventDefault()}),onFocusOutside:me(t.onFocusOutside,f=>{const l=f.target;c().some(m=>{var p;return(p=m.ref.current)==null?void 0:p.contains(l)})&&f.preventDefault()}),onInteractOutside:me(t.onInteractOutside,()=>{u.current=!0}),onEntryFocus:f=>{o.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:me(t.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const l=f.target,d=l.hasAttribute("data-radix-menubar-subtrigger"),m=l.closest("[data-radix-menubar-content]")!==f.currentTarget,h=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!h&&d||m&&h)return;let v=c().filter(A=>!A.disabled).map(A=>A.value);h&&v.reverse();const w=v.indexOf(o.value);v=a.loop?GAe(v,w+1):v.slice(w+1);const[x]=v;x&&a.onMenuOpen(x)}},{checkForDefaultPrevented:!1}),style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});HK.displayName=sN;var NAe="MenubarGroup",OAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(xI,{...s,...r,ref:e})});OAe.displayName=NAe;var MAe="MenubarLabel",VK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(SI,{...s,...r,ref:e})});VK.displayName=MAe;var LAe="MenubarItem",WK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(EI,{...s,...r,ref:e})});WK.displayName=LAe;var IAe="MenubarCheckboxItem",GK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(CI,{...s,...r,ref:e})});GK.displayName=IAe;var $Ae="MenubarRadioGroup",FAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(AI,{...s,...r,ref:e})});FAe.displayName=$Ae;var jAe="MenubarRadioItem",qK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(RI,{...s,...r,ref:e})});qK.displayName=jAe;var zAe="MenubarItemIndicator",KK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(PI,{...s,...r,ref:e})});KK.displayName=zAe;var BAe="MenubarSeparator",YK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(TI,{...s,...r,ref:e})});YK.displayName=BAe;var UAe="MenubarArrow",HAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(kI,{...s,...r,ref:e})});HAe.displayName=UAe;var VAe="MenubarSubTrigger",XK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(DI,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});XK.displayName=VAe;var WAe="MenubarSubContent",QK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(NI,{...s,"data-radix-menubar-content":"",...r,ref:e,style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});QK.displayName=WAe;function GAe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var ZK=jK,JK=BK,qAe=UK,e7=HK,t7=VK,n7=WK,r7=GK,s7=qK,i7=KK,o7=YK,a7=XK,l7=QK;const KAe=_.forwardRef(({className:t,...e},n)=>P.jsx(ZK,{ref:n,className:ce("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));KAe.displayName=ZK.displayName;const YAe=_.forwardRef(({className:t,...e},n)=>P.jsx(JK,{ref:n,className:ce("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...e}));YAe.displayName=JK.displayName;const XAe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(a7,{ref:s,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,P.jsx(n_,{className:"ml-auto h-4 w-4"})]}));XAe.displayName=a7.displayName;const QAe=_.forwardRef(({className:t,...e},n)=>P.jsx(l7,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));QAe.displayName=l7.displayName;const ZAe=_.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>P.jsx(qAe,{children:P.jsx(e7,{ref:i,align:e,alignOffset:n,sideOffset:r,className:ce("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));ZAe.displayName=e7.displayName;const JAe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(n7,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));JAe.displayName=n7.displayName;const eRe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(r7,{ref:s,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(i7,{children:P.jsx(t_,{className:"h-4 w-4"})})}),e]}));eRe.displayName=r7.displayName;const tRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(s7,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(i7,{children:P.jsx(L1,{className:"h-2 w-2 fill-current"})})}),e]}));tRe.displayName=s7.displayName;const nRe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(t7,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));nRe.displayName=t7.displayName;const rRe=_.forwardRef(({className:t,...e},n)=>P.jsx(o7,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));rRe.displayName=o7.displayName;var sRe="VisuallyHidden",P_=_.forwardRef((t,e)=>P.jsx(De.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));P_.displayName=sRe;var c7=P_,kv="NavigationMenu",[qI,u7,iRe]=qc(kv),[iN,oRe,aRe]=qc(kv),[KI,eUe]=Pn(kv,[iRe,aRe]),[lRe,Bo]=KI(kv),[cRe,uRe]=KI(kv),d7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:a=200,skipDelayDuration:o=300,orientation:c="horizontal",dir:u,...f}=t,[l,d]=_.useState(null),m=tt(e,T=>d(T)),p=Ta(u),h=_.useRef(0),y=_.useRef(0),g=_.useRef(0),[v,w]=_.useState(!0),[x="",A]=sr({prop:r,onChange:T=>{const D=T!=="",O=o>0;D?(window.clearTimeout(g.current),O&&w(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>w(!0),o)),s==null||s(T)},defaultProp:i}),k=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),R=_.useCallback(T=>{window.clearTimeout(y.current),A(T)},[A]),E=_.useCallback(T=>{x===T?window.clearTimeout(y.current):h.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(T)},a)},[x,A,a]);return _.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),P.jsx(h7,{scope:n,isRootMenu:!0,value:x,dir:p,orientation:c,rootNavigationMenu:l,onTriggerEnter:T=>{window.clearTimeout(h.current),v?E(T):R(T)},onTriggerLeave:()=>{window.clearTimeout(h.current),k()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:k,onItemSelect:T=>{A(D=>D===T?"":T)},onItemDismiss:()=>A(""),children:P.jsx(De.nav,{"aria-label":"Main","data-orientation":c,dir:p,...f,ref:m})})});d7.displayName=kv;var f7="NavigationMenuSub",dRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",...o}=t,c=Bo(f7,n),[u="",f]=sr({prop:r,onChange:s,defaultProp:i});return P.jsx(h7,{scope:n,isRootMenu:!1,value:u,dir:c.dir,orientation:a,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:l=>f(l),onItemSelect:l=>f(l),onItemDismiss:()=>f(""),children:P.jsx(De.div,{"data-orientation":a,...o,ref:e})})});dRe.displayName=f7;var h7=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:a,value:o,onItemSelect:c,onItemDismiss:u,onTriggerEnter:f,onTriggerLeave:l,onContentEnter:d,onContentLeave:m}=t,[p,h]=_.useState(null),[y,g]=_.useState(new Map),[v,w]=_.useState(null);return P.jsx(lRe,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:Cv(o),baseId:Hr(),dir:s,orientation:i,viewport:p,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:w,onTriggerEnter:Bt(f),onTriggerLeave:Bt(l),onContentEnter:Bt(d),onContentLeave:Bt(m),onItemSelect:Bt(c),onItemDismiss:Bt(u),onViewportContentChange:_.useCallback((x,A)=>{g(k=>(k.set(x,A),new Map(k)))},[]),onViewportContentRemove:_.useCallback(x=>{g(A=>A.has(x)?(A.delete(x),new Map(A)):A)},[]),children:P.jsx(qI.Provider,{scope:e,children:P.jsx(cRe,{scope:e,items:y,children:a})})})},p7="NavigationMenuList",m7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Bo(p7,n),i=P.jsx(De.ul,{"data-orientation":s.orientation,...r,ref:e});return P.jsx(De.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:P.jsx(qI.Slot,{scope:n,children:s.isRootMenu?P.jsx(S7,{asChild:!0,children:i}):i})})});m7.displayName=p7;var g7="NavigationMenuItem",[fRe,v7]=KI(g7),hRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=Hr(),a=r||i||"LEGACY_REACT_AUTO_VALUE",o=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(()=>{}),l=_.useRef(!1),d=_.useCallback((p="start")=>{if(o.current){f.current();const h=aN(o.current);h.length&&QI(p==="start"?h:h.reverse())}},[]),m=_.useCallback(()=>{if(o.current){const p=aN(o.current);p.length&&(f.current=_Re(p))}},[]);return P.jsx(fRe,{scope:n,value:a,triggerRef:c,contentRef:o,focusProxyRef:u,wasEscapeCloseRef:l,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:m,onContentFocusOutside:m,children:P.jsx(De.li,{...s,ref:e})})});hRe.displayName=g7;var oN="NavigationMenuTrigger",y7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=Bo(oN,t.__scopeNavigationMenu),a=v7(oN,t.__scopeNavigationMenu),o=_.useRef(null),c=tt(o,a.triggerRef,e),u=C7(i.baseId,a.value),f=A7(i.baseId,a.value),l=_.useRef(!1),d=_.useRef(!1),m=a.value===i.value;return P.jsxs(P.Fragment,{children:[P.jsx(qI.ItemSlot,{scope:n,value:a.value,children:P.jsx(E7,{asChild:!0,children:P.jsx(De.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":ZI(m),"aria-expanded":m,"aria-controls":f,...s,ref:c,onPointerEnter:me(t.onPointerEnter,()=>{d.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:me(t.onPointerMove,gC(()=>{r||d.current||a.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(a.value),l.current=!0)})),onPointerLeave:me(t.onPointerLeave,gC(()=>{r||(i.onTriggerLeave(),l.current=!1)})),onClick:me(t.onClick,()=>{i.onItemSelect(a.value),d.current=m}),onKeyDown:me(t.onKeyDown,p=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];m&&p.key===y&&(a.onEntryKeyDown(),p.preventDefault())})})})}),m&&P.jsxs(P.Fragment,{children:[P.jsx(c7,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const h=a.contentRef.current,y=p.relatedTarget,g=y===o.current,v=h==null?void 0:h.contains(y);(g||!v)&&a.onFocusProxyEnter(g?"start":"end")}}),i.viewport&&P.jsx("span",{"aria-owns":f})]})]})});y7.displayName=oN;var pRe="NavigationMenuLink",wB="navigationMenu.linkSelect",mRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return P.jsx(E7,{asChild:!0,children:P.jsx(De.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:me(t.onClick,a=>{const o=a.target,c=new CustomEvent(wB,{bubbles:!0,cancelable:!0});if(o.addEventListener(wB,u=>s==null?void 0:s(u),{once:!0}),Hb(o,c),!c.defaultPrevented&&!a.metaKey){const u=new CustomEvent(HS,{bubbles:!0,cancelable:!0});Hb(o,u)}},{checkForDefaultPrevented:!1})})})});mRe.displayName=pRe;var YI="NavigationMenuIndicator",b7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Bo(YI,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?Jw.createPortal(P.jsx(Un,{present:n||i,children:P.jsx(gRe,{...r,ref:e})}),s.indicatorTrack):null});b7.displayName=YI;var gRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Bo(YI,n),i=u7(n),[a,o]=_.useState(null),[c,u]=_.useState(null),f=s.orientation==="horizontal",l=!!s.value;_.useEffect(()=>{var h;const p=(h=i().find(y=>y.value===s.value))==null?void 0:h.ref.current;p&&o(p)},[i,s.value]);const d=()=>{a&&u({size:f?a.offsetWidth:a.offsetHeight,offset:f?a.offsetLeft:a.offsetTop})};return lN(a,d),lN(s.indicatorTrack,d),c?P.jsx(De.div,{"aria-hidden":!0,"data-state":l?"visible":"hidden","data-orientation":s.orientation,...r,ref:e,style:{position:"absolute",...f?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...r.style}}):null}),av="NavigationMenuContent",w7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Bo(av,t.__scopeNavigationMenu),i=v7(av,t.__scopeNavigationMenu),a=tt(i.contentRef,e),o=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return s.viewport?P.jsx(vRe,{forceMount:n,...c,ref:a}):P.jsx(Un,{present:n||o,children:P.jsx(_7,{"data-state":ZI(o),...c,ref:a,onPointerEnter:me(t.onPointerEnter,s.onContentEnter),onPointerLeave:me(t.onPointerLeave,gC(s.onContentLeave)),style:{pointerEvents:!o&&s.isRootMenu?"none":void 0,...c.style}})})});w7.displayName=av;var vRe=_.forwardRef((t,e)=>{const n=Bo(av,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return Mn(()=>{r(t.value,{ref:e,...t})},[t,e,r]),Mn(()=>()=>s(t.value),[t.value,s]),null}),HS="navigationMenu.rootContentDismiss",_7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:c,...u}=t,f=Bo(av,n),l=_.useRef(null),d=tt(l,e),m=C7(f.baseId,r),p=A7(f.baseId,r),h=u7(n),y=_.useRef(null),{onItemDismiss:g}=f;_.useEffect(()=>{const w=l.current;if(f.isRootMenu&&w){const x=()=>{var A;g(),o(),w.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return w.addEventListener(HS,x),()=>w.removeEventListener(HS,x)}},[f.isRootMenu,t.value,s,g,o]);const v=_.useMemo(()=>{const x=h().map(D=>D.value);f.dir==="rtl"&&x.reverse();const A=x.indexOf(f.value),k=x.indexOf(f.previousValue),R=r===f.value,E=k===x.indexOf(r);if(!R&&!E)return y.current;const T=(()=>{if(A!==k){if(R&&k!==-1)return A>k?"from-end":"from-start";if(E&&A!==-1)return A>k?"to-start":"to-end"}return null})();return y.current=T,T},[f.previousValue,f.value,f.dir,h,r]);return P.jsx(S7,{asChild:!0,children:P.jsx(Yc,{id:p,"aria-labelledby":m,"data-motion":v,"data-orientation":f.orientation,...u,ref:d,disableOutsidePointerEvents:!1,onDismiss:()=>{var x;const w=new Event(HS,{bubbles:!0,cancelable:!0});(x=l.current)==null||x.dispatchEvent(w)},onFocusOutside:me(t.onFocusOutside,w=>{var A;c();const x=w.target;(A=f.rootNavigationMenu)!=null&&A.contains(x)&&w.preventDefault()}),onPointerDownOutside:me(t.onPointerDownOutside,w=>{var R;const x=w.target,A=h().some(E=>{var T;return(T=E.ref.current)==null?void 0:T.contains(x)}),k=f.isRootMenu&&((R=f.viewport)==null?void 0:R.contains(x));(A||k||!f.isRootMenu)&&w.preventDefault()}),onKeyDown:me(t.onKeyDown,w=>{var k;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const R=aN(w.currentTarget),E=document.activeElement,T=R.findIndex(L=>L===E),O=w.shiftKey?R.slice(0,T).reverse():R.slice(T+1,R.length);QI(O)?w.preventDefault():(k=i.current)==null||k.focus()}}),onEscapeKeyDown:me(t.onEscapeKeyDown,w=>{a.current=!0})})})}),XI="NavigationMenuViewport",x7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!Bo(XI,t.__scopeNavigationMenu).value;return P.jsx(Un,{present:n||i,children:P.jsx(yRe,{...r,ref:e})})});x7.displayName=XI;var yRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=Bo(XI,n),a=tt(e,i.onViewportChange),o=uRe(av,t.__scopeNavigationMenu),[c,u]=_.useState(null),[f,l]=_.useState(null),d=c?(c==null?void 0:c.width)+"px":void 0,m=c?(c==null?void 0:c.height)+"px":void 0,p=!!i.value,h=p?i.value:i.previousValue;return lN(f,()=>{f&&u({width:f.offsetWidth,height:f.offsetHeight})}),P.jsx(De.div,{"data-state":ZI(p),"data-orientation":i.orientation,...s,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":d,"--radix-navigation-menu-viewport-height":m,...s.style},onPointerEnter:me(t.onPointerEnter,i.onContentEnter),onPointerLeave:me(t.onPointerLeave,gC(i.onContentLeave)),children:Array.from(o.items).map(([g,{ref:v,forceMount:w,...x}])=>{const A=h===g;return P.jsx(Un,{present:w||A,children:P.jsx(_7,{...x,ref:e_(v,k=>{A&&k&&l(k)})})},g)})})}),bRe="FocusGroup",S7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Bo(bRe,n);return P.jsx(iN.Provider,{scope:n,children:P.jsx(iN.Slot,{scope:n,children:P.jsx(De.div,{dir:s.dir,...r,ref:e})})})}),_B=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],wRe="FocusGroupItem",E7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=oRe(n),i=Bo(wRe,n);return P.jsx(iN.ItemSlot,{scope:n,children:P.jsx(De.button,{...r,ref:e,onKeyDown:me(t.onKeyDown,a=>{if(["Home","End",..._B].includes(a.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&c.reverse(),_B.includes(a.key)){const l=c.indexOf(a.currentTarget);c=c.slice(l+1)}setTimeout(()=>QI(c)),a.preventDefault()}})})})});function aN(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function QI(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function _Re(t){return t.forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}),()=>{t.forEach(e=>{const n=e.dataset.tabindex;e.setAttribute("tabindex",n)})}}function lN(t,e){const n=Bt(e);Mn(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}function ZI(t){return t?"open":"closed"}function C7(t,e){return`${t}-trigger-${e}`}function A7(t,e){return`${t}-content-${e}`}function gC(t){return e=>e.pointerType==="mouse"?t(e):void 0}var R7=d7,P7=m7,T7=y7,k7=b7,D7=w7,N7=x7;const xRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(R7,{ref:r,className:ce("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,P.jsx(O7,{})]}));xRe.displayName=R7.displayName;const SRe=_.forwardRef(({className:t,...e},n)=>P.jsx(P7,{ref:n,className:ce("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));SRe.displayName=P7.displayName;const ERe=jo("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),CRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(T7,{ref:r,className:ce(ERe(),"group",t),...n,children:[e," ",P.jsx(M1,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));CRe.displayName=T7.displayName;const ARe=_.forwardRef(({className:t,...e},n)=>P.jsx(D7,{ref:n,className:ce("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...e}));ARe.displayName=D7.displayName;const O7=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:ce("absolute left-0 top-full flex justify-center"),children:P.jsx(N7,{className:ce("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:n,...e})}));O7.displayName=N7.displayName;const RRe=_.forwardRef(({className:t,...e},n)=>P.jsx(k7,{ref:n,className:ce("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...e,children:P.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));RRe.displayName=k7.displayName;var PRe=typeof window>"u",cN=PRe?se.useEffect:se.useLayoutEffect,TRe=0,xB=()=>++TRe,SB=!1;function kRe(){let[t,e]=se.useState(SB?xB:void 0);return cN(()=>{t===void 0&&e(xB()),SB=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function DRe(){return se.useMemo(()=>"useId"in se?se.useId:kRe,[])()}var uN="__wrap_b",pb="__wrap_n",EB="__wrap_o",M7=(t,e,n)=>{n=n||document.querySelector(`[data-br="${t}"]`);let r=n==null?void 0:n.parentElement;if(!r)return;let s=f=>n.style.maxWidth=f+"px";n.style.maxWidth="";let i=r.clientWidth,a=r.clientHeight,o=i/2-.25,c=i+.5,u;if(i){for(s(o),o=Math.max(n.scrollWidth,o);o+1{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},NRe=M7.toString(),ORe='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',MRe=(t,e,n="")=>(n&&(n=`self.${pb}!=1&&${n}`),se.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${pb}=self.${pb}||${ORe};self.${uN}=${NRe};`)+n},nonce:e})),LRe=se.createContext({preferNative:!0,hasProvider:!1});se.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},a)=>{let o=DRe(),c=se.useRef(),u=se.useContext(LRe),f=e??u.preferNative,l=s||"span";return se.useImperativeHandle(a,()=>c.current,[]),cN(()=>{f&&self[pb]===1||c.current&&(self[uN]=M7)(0,t,c.current)},[r,f,t]),cN(()=>{if(!(f&&self[pb]===1))return()=>{if(!c.current)return;let d=c.current[EB];d&&(d.disconnect(),delete c.current[EB])}},[f]),se.createElement(se.Fragment,null,se.createElement(l,{...i,"data-br":o,"data-brr":t,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:f?"balance":"initial"},suppressHydrationWarning:!0},r),MRe(u.hasProvider,n,`self.${uN}("${o}",${t})`))});var IRe="Separator",CB="horizontal",$Re=["horizontal","vertical"],L7=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=CB,...s}=t,i=FRe(r)?r:CB,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return P.jsx(De.div,{"data-orientation":i,...o,...s,ref:e})});L7.displayName=IRe;function FRe(t){return $Re.includes(t)}var I7=L7;const jRe=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>P.jsx(I7,{ref:s,decorative:n,orientation:e,className:ce("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));jRe.displayName=I7.displayName;const zRe=_.forwardRef(({className:t,...e},n)=>P.jsx("ul",{ref:n,className:ce("flex flex-row items-center gap-1",t),...e}));zRe.displayName="PaginationContent";const BRe=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:ce("",t),...e}));BRe.displayName="PaginationItem";var JI="Popover",[$7,tUe]=Pn(JI,[Sl]),T_=Sl(),[URe,$d]=$7(JI),F7=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,o=T_(e),c=_.useRef(null),[u,f]=_.useState(!1),[l=!1,d]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(oA,{...o,children:P.jsx(URe,{scope:e,contentId:Hr(),triggerRef:c,open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(m=>!m),[d]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:a,children:n})})};F7.displayName=JI;var j7="PopoverAnchor",HRe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$d(j7,n),i=T_(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return _.useEffect(()=>(a(),()=>o()),[a,o]),P.jsx(Pv,{...i,...r,ref:e})});HRe.displayName=j7;var z7="PopoverTrigger",B7=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$d(z7,n),i=T_(n),a=tt(e,s.triggerRef),o=P.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":G7(s.open),...r,ref:a,onClick:me(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:P.jsx(Pv,{asChild:!0,...i,children:o})});B7.displayName=z7;var e$="PopoverPortal",[VRe,WRe]=$7(e$,{forceMount:void 0}),U7=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=$d(e$,e);return P.jsx(VRe,{scope:e,forceMount:n,children:P.jsx(Un,{present:n||i.open,children:P.jsx(wv,{asChild:!0,container:s,children:r})})})};U7.displayName=e$;var lv="PopoverContent",H7=_.forwardRef((t,e)=>{const n=WRe(lv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=$d(lv,t.__scopePopover);return P.jsx(Un,{present:r||i.open,children:i.modal?P.jsx(GRe,{...s,ref:e}):P.jsx(qRe,{...s,ref:e})})});H7.displayName=lv;var GRe=_.forwardRef((t,e)=>{const n=$d(lv,t.__scopePopover),r=_.useRef(null),s=tt(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return _v(a)},[]),P.jsx(s_,{as:Sa,allowPinchZoom:!0,children:P.jsx(V7,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),i.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:me(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),qRe=_.forwardRef((t,e)=>{const n=$d(lv,t.__scopePopover),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(V7,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),V7=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...l}=t,d=$d(lv,n),m=T_(n);return I1(),P.jsx(r_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:P.jsx(y_,{"data-state":G7(d.open),role:"dialog",id:d.contentId,...m,...l,ref:e,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),W7="PopoverClose",KRe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$d(W7,n);return P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});KRe.displayName=W7;var YRe="PopoverArrow",XRe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=T_(n);return P.jsx(b_,{...s,...r,ref:e})});XRe.displayName=YRe;function G7(t){return t?"open":"closed"}var QRe=F7,ZRe=B7,JRe=U7,q7=H7;const ePe=QRe,tPe=ZRe,K7=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(JRe,{children:P.jsx(q7,{ref:s,align:e,sideOffset:n,className:ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));K7.displayName=q7.displayName;var t$="Progress",n$=100,[nPe,nUe]=Pn(t$),[rPe,sPe]=nPe(t$),Y7=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=iPe,...a}=t;(s||s===0)&&!AB(s)&&console.error(oPe(`${s}`,"Progress"));const o=AB(s)?s:n$;r!==null&&!RB(r,o)&&console.error(aPe(`${r}`,"Progress"));const c=RB(r,o)?r:null,u=vC(c)?i(c,o):void 0;return P.jsx(rPe,{scope:n,value:c,max:o,children:P.jsx(De.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":vC(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":Z7(c,o),"data-value":c??void 0,"data-max":o,...a,ref:e})})});Y7.displayName=t$;var X7="ProgressIndicator",Q7=_.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=sPe(X7,n);return P.jsx(De.div,{"data-state":Z7(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});Q7.displayName=X7;function iPe(t,e){return`${Math.round(t/e*100)}%`}function Z7(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function vC(t){return typeof t=="number"}function AB(t){return vC(t)&&!isNaN(t)&&t>0}function RB(t,e){return vC(t)&&!isNaN(t)&&t<=e&&t>=0}function oPe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${n$}\`.`}function aPe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: +){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);const WCe=24,GCe=typeof window<"u"?_.useLayoutEffect:_.useEffect;function uB(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function qCe(){return zI(/^Mac/)}function KCe(){return zI(/^iPhone/)}function dB(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function YCe(){return zI(/^iPad/)||qCe()&&navigator.maxTouchPoints>1}function Tq(){return KCe()||YCe()}function zI(t){return typeof window<"u"&&window.navigator!=null?t.test(window.navigator.platform):void 0}const RT=typeof document<"u"&&window.visualViewport;function fB(t){let e=window.getComputedStyle(t);return/(auto|scroll)/.test(e.overflow+e.overflowX+e.overflowY)}function kq(t){for(fB(t)&&(t=t.parentElement);t&&!fB(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}const XCe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let dS=0,PT;function QCe(t={}){let{isDisabled:e}=t;GCe(()=>{if(!e)return dS++,dS===1&&Tq()&&(PT=ZCe()),()=>{dS--,dS===0&&(PT==null||PT())}},[e])}function ZCe(){let t,e=0,n=l=>{t=kq(l.target),!(t===document.documentElement&&t===document.body)&&(e=l.changedTouches[0].pageY)},r=l=>{if(!t||t===document.documentElement||t===document.body){l.preventDefault();return}let d=l.changedTouches[0].pageY,m=t.scrollTop,p=t.scrollHeight-t.clientHeight;p!==0&&((m<=0&&d>e||m>=p&&d{let d=l.target;XD(d)&&d!==document.activeElement&&(l.preventDefault(),d.style.transform="translateY(-2000px)",d.focus(),requestAnimationFrame(()=>{d.style.transform=""}))},i=l=>{let d=l.target;XD(d)&&(d.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{d.style.transform="",RT&&(RT.height{hB(d)}):RT.addEventListener("resize",()=>hB(d),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},o=window.pageXOffset,c=window.pageYOffset,u=uB(JCe(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let f=uB(yy(document,"touchstart",n,{passive:!1,capture:!0}),yy(document,"touchmove",r,{passive:!1,capture:!0}),yy(document,"touchend",s,{passive:!1,capture:!0}),yy(document,"focus",i,!0),yy(window,"scroll",a));return()=>{u(),f(),window.scrollTo(o,c)}}function JCe(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function yy(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function hB(t){let e=document.scrollingElement||document.documentElement;for(;t&&t!==e;){let n=kq(t);if(n!==document.documentElement&&n!==document.body&&n!==t){let r=n.getBoundingClientRect().top,s=t.getBoundingClientRect().top,i=t.getBoundingClientRect().bottom;const a=n.getBoundingClientRect().bottom+WCe;i>a&&(n.scrollTop+=s-r)}t=n.parentElement}}function XD(t){return t instanceof HTMLInputElement&&!XCe.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}function e1e(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function t1e(...t){return e=>t.forEach(n=>e1e(n,e))}function Dq(...t){return _.useCallback(t1e(...t),t)}const Nq=new WeakMap;function Lr(t,e,n=!1){if(!t||!(t instanceof HTMLElement))return;let r={};Object.entries(e).forEach(([s,i])=>{if(s.startsWith("--")){t.style.setProperty(s,i);return}r[s]=t.style[s],t.style[s]=i}),!n&&Nq.set(t,r)}function n1e(t,e){if(!t||!(t instanceof HTMLElement))return;let n=Nq.get(t);n&&(t.style[e]=n[e])}const Ir=t=>{switch(t){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return t}};function fS(t,e){if(!t)return null;const n=window.getComputedStyle(t),r=n.transform||n.webkitTransform||n.mozTransform;let s=r.match(/^matrix3d\((.+)\)$/);return s?parseFloat(s[1].split(", ")[Ir(e)?13:12]):(s=r.match(/^matrix\((.+)\)$/),s?parseFloat(s[1].split(", ")[Ir(e)?5:4]):null)}function r1e(t){return 8*(Math.log(t+1)-2)}function TT(t,e){if(!t)return()=>{};const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function s1e(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}const Jn={DURATION:.5,EASE:[.32,.72,0,1]},Oq=.4,i1e=.25,o1e=100,Mq=8,hS=16,QD=26,kT="vaul-dragging";function Lq(t){const e=se.useRef(t);return se.useEffect(()=>{e.current=t}),se.useMemo(()=>(...n)=>e.current==null?void 0:e.current.call(e,...n),[])}function a1e({defaultProp:t,onChange:e}){const n=se.useState(t),[r]=n,s=se.useRef(r),i=Lq(e);return se.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}function Iq({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=a1e({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:r,o=Lq(n),c=se.useCallback(u=>{if(i){const l=typeof u=="function"?u(t):u;l!==t&&o(l)}else s(u)},[i,t,s,o]);return[a,c]}function l1e({activeSnapPointProp:t,setActiveSnapPointProp:e,snapPoints:n,drawerRef:r,overlayRef:s,fadeFromIndex:i,onSnapPointChange:a,direction:o="bottom",container:c,snapToSequentialPoint:u}){const[f,l]=Iq({prop:t,defaultProp:n==null?void 0:n[0],onChange:e}),[d,m]=se.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);se.useEffect(()=>{function R(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const p=se.useMemo(()=>f===(n==null?void 0:n[n.length-1])||null,[n,f]),h=se.useMemo(()=>n==null?void 0:n.findIndex(R=>R===f),[n,f]),y=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===f||!n,g=se.useMemo(()=>{const R=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var E;return(E=n==null?void 0:n.map(T=>{const D=typeof T=="string";let O=0;if(D&&(O=parseInt(T,10)),Ir(o)){const I=D?O:d?T*R.height:0;return d?o==="bottom"?R.height-I:-R.height+I:I}const L=D?O:d?T*R.width:0;return d?o==="right"?R.width-L:-R.width+L:L}))!=null?E:[]},[n,d,c]),v=se.useMemo(()=>h!==null?g==null?void 0:g[h]:null,[g,h]),w=se.useCallback(R=>{var E;const T=(E=g==null?void 0:g.findIndex(D=>D===R))!=null?E:null;a(T),Lr(r.current,{transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,transform:Ir(o)?`translate3d(0, ${R}px, 0)`:`translate3d(${R}px, 0, 0)`}),g&&T!==g.length-1&&T!==i&&T{if(f||t){var R;const E=(R=n==null?void 0:n.findIndex(T=>T===t||T===f))!=null?R:-1;g&&E!==-1&&typeof g[E]=="number"&&w(g[E])}},[f,t,n,g,w]);function x({draggedDistance:R,closeDrawer:E,velocity:T,dismissible:D}){if(i===void 0)return;const O=o==="bottom"||o==="right"?(v??0)-R:(v??0)+R,L=h===i-1,I=h===0,F=R>0;if(L&&Lr(s.current,{transition:`opacity ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`}),!u&&T>2&&!F){D?E():w(g[0]);return}if(!u&&T>2&&F&&g&&n){w(g[n.length-1]);return}const U=g==null?void 0:g.reduce((V,H)=>typeof V!="number"||typeof H!="number"?V:Math.abs(H-O)Oq&&Math.abs(R)0&&p){w(g[n.length-1]);return}if(I&&V<0&&D&&E(),h===null)return;w(g[h+V]);return}w(U)}function A({draggedDistance:R}){if(v===null)return;const E=o==="bottom"||o==="right"?v-R:v+R;(o==="bottom"||o==="right")&&Eg[g.length-1]||Lr(r.current,{transform:Ir(o)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`})}function k(R,E){if(!n||typeof h!="number"||!g||i===void 0)return null;const T=h===i-1;if(h>=i&&E)return 0;if(T&&!E)return 1;if(!y&&!T)return null;const O=T?h+1:h-1,L=T?g[O]-g[O-1]:g[O+1]-g[O],I=R/Math.abs(L);return T?1-I:I}return{isLastSnapPoint:p,activeSnapPoint:f,shouldFade:y,getPercentageDragged:k,setActiveSnapPoint:l,activeSnapPointIndex:h,onRelease:x,onDrag:A,snapPointsOffset:g}}const c1e=()=>()=>{};function u1e(){const{direction:t,isOpen:e,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:s}=A_(),i=se.useRef(null),a=_.useMemo(()=>document.body.style.backgroundColor,[]);function o(){return(window.innerWidth-QD)/window.innerWidth}se.useEffect(()=>{if(e&&n){i.current&&clearTimeout(i.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;s1e(r&&!s?TT(document.body,{background:"black"}):c1e,TT(c,{transformOrigin:Ir(t)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Jn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Jn.EASE.join(",")})`}));const u=TT(c,{borderRadius:`${Mq}px`,overflow:"hidden",...Ir(t)?{transform:`scale(${o()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${o()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{a?document.body.style.background=a:document.body.style.removeProperty("background")},Jn.DURATION*1e3)}}},[e,n,a])}let by=null;function d1e({isOpen:t,modal:e,nested:n,hasBeenOpened:r,preventScrollRestoration:s,noBodyStyles:i}){const[a,o]=se.useState(()=>typeof window<"u"?window.location.href:""),c=se.useRef(0),u=se.useCallback(()=>{if(dB()&&by===null&&t&&!i){by={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:l,innerHeight:d}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-l}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const m=d-window.innerHeight;m&&c.current>=d&&(document.body.style.top=`${-(c.current+m)}px`)}),300)}},[t]),f=se.useCallback(()=>{if(dB()&&by!==null&&!i){const l=-parseInt(document.body.style.top,10),d=-parseInt(document.body.style.left,10);Object.assign(document.body.style,by),window.requestAnimationFrame(()=>{if(s&&a!==window.location.href){o(window.location.href);return}window.scrollTo(d,l)}),by=null}},[a]);return se.useEffect(()=>{function l(){c.current=window.scrollY}return l(),window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}},[]),se.useEffect(()=>{n||!r||(t?(!window.matchMedia("(display-mode: standalone)").matches&&u(),e||window.setTimeout(()=>{f()},500)):f())},[t,r,a,e,n,u,f]),{restorePositionSetting:f}}function f1e({open:t,onOpenChange:e,children:n,onDrag:r,onRelease:s,snapPoints:i,shouldScaleBackground:a=!1,setBackgroundColorOnScale:o=!0,closeThreshold:c=i1e,scrollLockTimeout:u=o1e,dismissible:f=!0,handleOnly:l=!1,fadeFromIndex:d=i&&i.length-1,activeSnapPoint:m,setActiveSnapPoint:p,fixed:h,modal:y=!0,onClose:g,nested:v,noBodyStyles:w,direction:x="bottom",defaultOpen:A=!1,disablePreventScroll:k=!0,snapToSequentialPoint:R=!1,preventScrollRestoration:E=!1,repositionInputs:T=!0,onAnimationEnd:D,container:O,autoFocus:L=!1}){var I,F;const[U=!1,Y]=Iq({defaultProp:A,prop:t,onChange:Be=>{e==null||e(Be),!Be&&!v&&Oe(),setTimeout(()=>{D==null||D(Be)},Jn.DURATION*1e3),Be&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Be||(document.body.style.pointerEvents="auto")}}),[V,H]=se.useState(!1),[ee,re]=se.useState(!1),[X,q]=se.useState(!1),K=se.useRef(null),Z=se.useRef(null),ue=se.useRef(null),de=se.useRef(null),ie=se.useRef(null),be=se.useRef(!1),Ae=se.useRef(null),_e=se.useRef(0),Me=se.useRef(!1),Ne=se.useRef(0),ye=se.useRef(null),$e=se.useRef(((I=ye.current)==null?void 0:I.getBoundingClientRect().height)||0),ut=se.useRef(((F=ye.current)==null?void 0:F.getBoundingClientRect().width)||0),Qe=se.useRef(0),vt=se.useCallback(Be=>{i&&Be===J.length-1&&(Z.current=new Date)},[]),{activeSnapPoint:Sn,activeSnapPointIndex:Yt,setActiveSnapPoint:mn,onRelease:Xt,snapPointsOffset:J,onDrag:fe,shouldFade:ge,getPercentageDragged:Pe}=l1e({snapPoints:i,activeSnapPointProp:m,setActiveSnapPointProp:p,drawerRef:ye,fadeFromIndex:d,overlayRef:K,onSnapPointChange:vt,direction:x,container:O,snapToSequentialPoint:R});QCe({isDisabled:!U||ee||!y||X||!V||!T||!k});const{restorePositionSetting:Oe}=d1e({isOpen:U,modal:y,nested:v,hasBeenOpened:V,preventScrollRestoration:E,noBodyStyles:w});function xe(){return(window.innerWidth-QD)/window.innerWidth}function Te(Be){var it,ot;!f&&!i||ye.current&&!ye.current.contains(Be.target)||($e.current=((it=ye.current)==null?void 0:it.getBoundingClientRect().height)||0,ut.current=((ot=ye.current)==null?void 0:ot.getBoundingClientRect().width)||0,re(!0),ue.current=new Date,Tq()&&window.addEventListener("touchend",()=>be.current=!1,{once:!0}),Be.target.setPointerCapture(Be.pointerId),_e.current=Ir(x)?Be.pageY:Be.pageX)}function Ye(Be,it){var ot,St;let nt=Be;const Ht=(ot=window.getSelection())==null?void 0:ot.toString(),Ct=ye.current?fS(ye.current,x):null,vn=new Date;if(nt.hasAttribute("data-vaul-no-drag")||nt.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(Z.current&&vn.getTime()-Z.current.getTime()<500)return!1;if(Ct!==null&&(x==="bottom"?Ct>0:Ct<0))return!0;if(Ht&&Ht.length>0)return!1;if(vn.getTime()-((St=ie.current)==null?void 0:St.getTime())nt.clientHeight){if(nt.scrollTop!==0)return ie.current=new Date,!1;if(nt.getAttribute("role")==="dialog")return!0}nt=nt.parentNode}return!0}function Rt(Be){if(ye.current&&ee){const it=x==="bottom"||x==="right"?1:-1,ot=(_e.current-(Ir(x)?Be.pageY:Be.pageX))*it,St=ot>0,nt=i&&!f&&!St;if(nt&&Yt===0)return;const Ht=Math.abs(ot),Ct=document.querySelector("[data-vaul-drawer-wrapper]"),vn=x==="bottom"||x==="top"?$e.current:ut.current;let an=Ht/vn;const ln=Pe(Ht,St);if(ln!==null&&(an=ln),nt&&an>=1||!be.current&&!Ye(Be.target,St))return;if(ye.current.classList.add(kT),be.current=!0,Lr(ye.current,{transition:"none"}),Lr(K.current,{transition:"none"}),i&&fe({draggedDistance:ot}),St&&!i){const hr=r1e(ot),kn=Math.min(hr*-1,0)*it;Lr(ye.current,{transform:Ir(x)?`translate3d(0, ${kn}px, 0)`:`translate3d(${kn}px, 0, 0)`});return}const Tn=1-an;if((ge||d&&Yt===d-1)&&(r==null||r(Be,an),Lr(K.current,{opacity:`${Tn}`,transition:"none"},!0)),Ct&&K.current&&a){const hr=Math.min(xe()+an*(1-xe()),1),kn=8-an*8,te=Math.max(0,14-an*14);Lr(Ct,{borderRadius:`${kn}px`,transform:Ir(x)?`scale(${hr}) translate3d(0, ${te}px, 0)`:`scale(${hr}) translate3d(${te}px, 0, 0)`,transition:"none"},!0)}if(!i){const hr=Ht*it;Lr(ye.current,{transform:Ir(x)?`translate3d(0, ${hr}px, 0)`:`translate3d(${hr}px, 0, 0)`})}}}se.useEffect(()=>{var Be;function it(){if(!ye.current||!T)return;const ot=document.activeElement;if(XD(ot)||Me.current){var St;const nt=((St=window.visualViewport)==null?void 0:St.height)||0,Ht=window.innerHeight;let Ct=Ht-nt;const vn=ye.current.getBoundingClientRect().height||0,an=vn>Ht*.8;Qe.current||(Qe.current=vn);const ln=ye.current.getBoundingClientRect().top;if(Math.abs(Ne.current-Ct)>60&&(Me.current=!Me.current),i&&i.length>0&&J&&Yt){const Tn=J[Yt]||0;Ct+=Tn}if(Ne.current=Ct,vn>nt||Me.current){const Tn=ye.current.getBoundingClientRect().height;let hr=Tn;Tn>nt&&(hr=nt-(an?ln:QD)),h?ye.current.style.height=`${Tn-Math.max(Ct,0)}px`:ye.current.style.height=`${Math.max(hr,nt-ln)}px`}else ye.current.style.height=`${Qe.current}px`;i&&i.length>0&&!Me.current?ye.current.style.bottom="0px":ye.current.style.bottom=`${Math.max(Ct,0)}px`}}return(Be=window.visualViewport)==null||Be.addEventListener("resize",it),()=>{var ot;return(ot=window.visualViewport)==null?void 0:ot.removeEventListener("resize",it)}},[Yt,i,J]);function bt(Be){Kn(),g==null||g(),Be||Y(!1),setTimeout(()=>{i&&mn(i[0])},Jn.DURATION*1e3)}function Os(){if(!ye.current)return;const Be=document.querySelector("[data-vaul-drawer-wrapper]"),it=fS(ye.current,x);Lr(ye.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`}),Lr(K.current,{transition:`opacity ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,opacity:"1"}),a&&it&&it>0&&U&&Lr(Be,{borderRadius:`${Mq}px`,overflow:"hidden",...Ir(x)?{transform:`scale(${xe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${xe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Jn.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Jn.EASE.join(",")})`},!0)}function Kn(){!ee||!ye.current||(ye.current.classList.remove(kT),be.current=!1,re(!1),de.current=new Date)}function ps(Be){if(!ee||!ye.current)return;ye.current.classList.remove(kT),be.current=!1,re(!1),de.current=new Date;const it=fS(ye.current,x);if(!Ye(Be.target,!1)||!it||Number.isNaN(it)||ue.current===null)return;const ot=de.current.getTime()-ue.current.getTime(),St=_e.current-(Ir(x)?Be.pageY:Be.pageX),nt=Math.abs(St)/ot;if(nt>.05&&(q(!0),setTimeout(()=>{q(!1)},200)),i){Xt({draggedDistance:St*(x==="bottom"||x==="right"?1:-1),closeDrawer:bt,velocity:nt,dismissible:f}),s==null||s(Be,!0);return}if(x==="bottom"||x==="right"?St>0:St<0){Os(),s==null||s(Be,!0);return}if(nt>Oq){bt(),s==null||s(Be,!1);return}var Ht;const Ct=Math.min((Ht=ye.current.getBoundingClientRect().height)!=null?Ht:0,window.innerHeight);var vn;const an=Math.min((vn=ye.current.getBoundingClientRect().width)!=null?vn:0,window.innerWidth),ln=x==="left"||x==="right";if(Math.abs(it)>=(ln?an:Ct)*c){bt(),s==null||s(Be,!1);return}s==null||s(Be,!0),Os()}se.useEffect(()=>(U&&(Lr(document.documentElement,{scrollBehavior:"auto"}),Z.current=new Date),()=>{n1e(document.documentElement,"scrollBehavior")}),[U]);function Ut(Be){const it=Be?(window.innerWidth-hS)/window.innerWidth:1,ot=Be?-16:0;Ae.current&&window.clearTimeout(Ae.current),Lr(ye.current,{transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,transform:`scale(${it}) translate3d(0, ${ot}px, 0)`}),!Be&&ye.current&&(Ae.current=setTimeout(()=>{const St=fS(ye.current,x);Lr(ye.current,{transition:"none",transform:Ir(x)?`translate3d(0, ${St}px, 0)`:`translate3d(${St}px, 0, 0)`})},500))}function on(Be,it){if(it<0)return;const ot=(window.innerWidth-hS)/window.innerWidth,St=ot+it*(1-ot),nt=-16+it*hS;Lr(ye.current,{transform:Ir(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`,transition:"none"})}function gn(Be,it){const ot=Ir(x)?window.innerHeight:window.innerWidth,St=it?(ot-hS)/ot:1,nt=it?-16:0;it&&Lr(ye.current,{transition:`transform ${Jn.DURATION}s cubic-bezier(${Jn.EASE.join(",")})`,transform:Ir(x)?`scale(${St}) translate3d(0, ${nt}px, 0)`:`scale(${St}) translate3d(${nt}px, 0, 0)`})}return se.createElement($Ce,{defaultOpen:A,onOpenChange:Be=>{!f&&!Be||(Be?H(!0):bt(!0),Y(Be))},open:U},se.createElement(Pq.Provider,{value:{activeSnapPoint:Sn,snapPoints:i,setActiveSnapPoint:mn,drawerRef:ye,overlayRef:K,onOpenChange:e,onPress:Te,onRelease:ps,onDrag:Rt,dismissible:f,handleOnly:l,isOpen:U,isDragging:ee,shouldFade:ge,closeDrawer:bt,onNestedDrag:on,onNestedOpenChange:Ut,onNestedRelease:gn,keyboardIsOpen:Me,modal:y,snapPointsOffset:J,direction:x,shouldScaleBackground:a,setBackgroundColorOnScale:o,noBodyStyles:w,container:O,autoFocus:L}},n))}const $q=se.forwardRef(function({...t},e){const{overlayRef:n,snapPoints:r,onRelease:s,shouldFade:i,isOpen:a,modal:o}=A_(),c=Dq(e,n),u=r&&r.length>0;return o?se.createElement(jCe,{onMouseUp:s,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":a&&u?"true":"false","data-vaul-snap-points-overlay":a&&i?"true":"false",...t}):(typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),null)});$q.displayName="Drawer.Overlay";const Fq=se.forwardRef(function({onPointerDownOutside:t,style:e,onOpenAutoFocus:n,...r},s){const{drawerRef:i,onPress:a,onRelease:o,onDrag:c,keyboardIsOpen:u,snapPointsOffset:f,modal:l,isOpen:d,direction:m,snapPoints:p,container:h,handleOnly:y,autoFocus:g}=A_(),[v,w]=se.useState(!1),x=Dq(s,i),A=se.useRef(null),k=se.useRef(null),R=se.useRef(!1),E=p&&p.length>0;u1e();const T=(O,L,I=0)=>{if(R.current)return!0;const F=Math.abs(O.y),U=Math.abs(O.x),Y=U>F,V=["bottom","right"].includes(L)?1:-1;if(L==="left"||L==="right"){if(!(O.x*V<0)&&U>=0&&U<=I)return Y}else if(!(O.y*V<0)&&F>=0&&F<=I)return!Y;return R.current=!0,!0};se.useEffect(()=>{E&&window.requestAnimationFrame(()=>{w(!0)})},[]);function D(O){A.current=null,R.current=!1,o(O)}return se.createElement(zCe,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":v?"true":"false","data-vaul-snap-points":d&&E?"true":"false","data-vaul-custom-container":h?"true":"false",...r,ref:x,style:f&&f.length>0?{"--snap-point-height":`${f[0]}px`,...e}:e,onPointerDown:O=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,O),A.current={x:O.pageX,y:O.pageY},a(O))},onOpenAutoFocus:O=>{n==null||n(O),g||O.preventDefault()},onPointerDownOutside:O=>{if(t==null||t(O),!l||O.defaultPrevented){O.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:O=>{if(!l){O.preventDefault();return}},onPointerMove:O=>{if(k.current=O,y||(r.onPointerMove==null||r.onPointerMove.call(r,O),!A.current))return;const L=O.pageY-A.current.y,I=O.pageX-A.current.x,F=O.pointerType==="touch"?10:2;T({x:I,y:L},m,F)?c(O):(Math.abs(I)>F||Math.abs(L)>F)&&(A.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),A.current=null,R.current=!1,o(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),D(k.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),D(k.current)}})});Fq.displayName="Drawer.Content";const h1e=250,p1e=120,m1e=se.forwardRef(function({preventCycle:t=!1,children:e,...n},r){const{closeDrawer:s,isDragging:i,snapPoints:a,activeSnapPoint:o,setActiveSnapPoint:c,dismissible:u,handleOnly:f,isOpen:l,onPress:d,onDrag:m}=A_(),p=se.useRef(null),h=se.useRef(!1);function y(){if(h.current){w();return}window.setTimeout(()=>{g()},p1e)}function g(){if(i||t||h.current){w();return}if(w(),(!a||a.length===0)&&u){s();return}if(o===a[a.length-1]&&u){s();return}const A=a.findIndex(R=>R===o);if(A===-1)return;const k=a[A+1];c(k)}function v(){p.current=window.setTimeout(()=>{h.current=!0},h1e)}function w(){window.clearTimeout(p.current),h.current=!1}return se.createElement("div",{onClick:y,onPointerCancel:w,onPointerDown:x=>{f&&d(x),v()},onPointerMove:x=>{f&&m(x)},ref:r,"data-vaul-drawer-visible":l?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},se.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},e))});m1e.displayName="Drawer.Handle";function g1e(t){const e=A_(),{container:n=e.container,...r}=t;return se.createElement(FCe,{container:n,...r})}const Al={Root:f1e,Content:Fq,Overlay:$q,Portal:g1e,Close:HCe,Title:BCe,Description:UCe},v1e=({shouldScaleBackground:t=!0,...e})=>P.jsx(Al.Root,{shouldScaleBackground:t,...e});v1e.displayName="Drawer";const y1e=Al.Portal,J4e=Al.Close,jq=_.forwardRef(({className:t,...e},n)=>P.jsx(Al.Overlay,{ref:n,className:ce("fixed inset-0 z-50 bg-black/80",t),...e}));jq.displayName=Al.Overlay.displayName;const b1e=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(y1e,{children:[P.jsx(jq,{}),P.jsxs(Al.Content,{ref:r,className:ce("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...n,children:[P.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),e]})]}));b1e.displayName="DrawerContent";const w1e=({className:t,...e})=>P.jsx("div",{className:ce("grid gap-1.5 p-4 text-center sm:text-left",t),...e});w1e.displayName="DrawerHeader";const _1e=({className:t,...e})=>P.jsx("div",{className:ce("mt-auto flex flex-col gap-2 p-4",t),...e});_1e.displayName="DrawerFooter";const x1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Al.Title,{ref:n,className:ce("text-lg font-semibold leading-none tracking-tight",t),...e}));x1e.displayName=Al.Title.displayName;const S1e=_.forwardRef(({className:t,...e},n)=>P.jsx(Al.Description,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));S1e.displayName=Al.Description.displayName;var BI="DropdownMenu",[E1e,eUe]=Pn(BI,[E_]),Js=E_(),[C1e,zq]=E1e(BI),Bq=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:a,modal:o=!0}=t,c=Js(e),u=_.useRef(null),[f=!1,l]=sr({prop:s,defaultProp:i,onChange:a});return P.jsx(C1e,{scope:e,triggerId:Hr(),triggerRef:u,contentId:Hr(),open:f,onOpenChange:l,onOpenToggle:_.useCallback(()=>l(d=>!d),[l]),modal:o,children:P.jsx(pEe,{...c,open:f,onOpenChange:l,dir:r,modal:o,children:n})})};Bq.displayName=BI;var Uq="DropdownMenuTrigger",Hq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=t,i=zq(Uq,n),a=Js(n);return P.jsx(_I,{asChild:!0,...a,children:P.jsx(De.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:t_(e,i.triggerRef),onPointerDown:me(t.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(i.onOpenToggle(),i.open||o.preventDefault())}),onKeyDown:me(t.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&i.onOpenToggle(),o.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});Hq.displayName=Uq;var A1e="DropdownMenuPortal",Vq=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Js(e);return P.jsx(xI,{...r,...n})};Vq.displayName=A1e;var Wq="DropdownMenuContent",Gq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=zq(Wq,n),i=Js(n),a=_.useRef(!1);return P.jsx(SI,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:e,onCloseAutoFocus:me(t.onCloseAutoFocus,o=>{var c;a.current||(c=s.triggerRef.current)==null||c.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:me(t.onInteractOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,f=c.button===2||u;(!s.modal||f)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Gq.displayName=Wq;var R1e="DropdownMenuGroup",qq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(EI,{...s,...r,ref:e})});qq.displayName=R1e;var P1e="DropdownMenuLabel",Kq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(CI,{...s,...r,ref:e})});Kq.displayName=P1e;var T1e="DropdownMenuItem",Yq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(AI,{...s,...r,ref:e})});Yq.displayName=T1e;var k1e="DropdownMenuCheckboxItem",Xq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(RI,{...s,...r,ref:e})});Xq.displayName=k1e;var D1e="DropdownMenuRadioGroup",N1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(PI,{...s,...r,ref:e})});N1e.displayName=D1e;var O1e="DropdownMenuRadioItem",Qq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(TI,{...s,...r,ref:e})});Qq.displayName=O1e;var M1e="DropdownMenuItemIndicator",Zq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(kI,{...s,...r,ref:e})});Zq.displayName=M1e;var L1e="DropdownMenuSeparator",Jq=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(DI,{...s,...r,ref:e})});Jq.displayName=L1e;var I1e="DropdownMenuArrow",$1e=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(NI,{...s,...r,ref:e})});$1e.displayName=I1e;var F1e="DropdownMenuSubTrigger",eK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(OI,{...s,...r,ref:e})});eK.displayName=F1e;var j1e="DropdownMenuSubContent",tK=_.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,s=Js(n);return P.jsx(MI,{...s,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tK.displayName=j1e;var z1e=Bq,B1e=Hq,U1e=Vq,nK=Gq,H1e=qq,rK=Kq,sK=Yq,iK=Xq,oK=Qq,aK=Zq,lK=Jq,cK=eK,uK=tK;const V1e=z1e,W1e=B1e,G1e=H1e,q1e=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(cK,{ref:s,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...r,children:[n,P.jsx(r_,{className:"w-4 h-4 ml-auto"})]}));q1e.displayName=cK.displayName;const K1e=_.forwardRef(({className:t,...e},n)=>P.jsx(uK,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));K1e.displayName=uK.displayName;const dK=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(U1e,{children:P.jsx(nK,{ref:r,sideOffset:e,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));dK.displayName=nK.displayName;const ZD=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(sK,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));ZD.displayName=sK.displayName;const Y1e=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(iK,{ref:s,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(aK,{children:P.jsx(n_,{className:"w-4 h-4"})})}),e]}));Y1e.displayName=iK.displayName;const X1e=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(oK,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(aK,{children:P.jsx(I1,{className:"w-2 h-2 fill-current"})})}),e]}));X1e.displayName=oK.displayName;const fK=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(rK,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));fK.displayName=rK.displayName;const JD=_.forwardRef(({className:t,...e},n)=>P.jsx(lK,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));JD.displayName=lK.displayName;const Q1e=({className:t,...e})=>P.jsx("span",{className:ce("ml-auto text-xs tracking-widest opacity-60",t),...e});Q1e.displayName="DropdownMenuShortcut";var R_=t=>t.type==="checkbox",xf=t=>t instanceof Date,Ws=t=>t==null;const hK=t=>typeof t=="object";var br=t=>!Ws(t)&&!Array.isArray(t)&&hK(t)&&!xf(t),pK=t=>br(t)&&t.target?R_(t.target)?t.target.checked:t.target.value:t,Z1e=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,mK=(t,e)=>t.has(Z1e(e)),J1e=t=>{const e=t.constructor&&t.constructor.prototype;return br(e)&&e.hasOwnProperty("isPrototypeOf")},UI=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Zn(t){let e;const n=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(t instanceof Set)e=new Set(t);else if(!(UI&&(t instanceof Blob||r))&&(n||br(t)))if(e=n?[]:{},!n&&!J1e(t))e=t;else for(const s in t)t.hasOwnProperty(s)&&(e[s]=Zn(t[s]));else return t;return e}var P_=t=>Array.isArray(t)?t.filter(Boolean):[],zn=t=>t===void 0,Ie=(t,e,n)=>{if(!e||!br(t))return n;const r=P_(e.split(/[,[\].]+?/)).reduce((s,i)=>Ws(s)?s:s[i],t);return zn(r)||r===t?zn(t[e])?n:t[e]:r},Xi=t=>typeof t=="boolean",HI=t=>/^\w*$/.test(t),gK=t=>P_(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Qt=(t,e,n)=>{let r=-1;const s=HI(e)?[e]:gK(e),i=s.length,a=i-1;for(;++rse.useContext(vK),eAe=t=>{const{children:e,...n}=t;return se.createElement(vK.Provider,{value:n},e)};var yK=(t,e,n,r=!0)=>{const s={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(s,i,{get:()=>{const a=i;return e._proxyFormState[a]!==ko.all&&(e._proxyFormState[a]=!r||ko.all),n&&(n[a]=!0),t[a]}});return s};function tAe(t){const e=Id(),{control:n=e.control,disabled:r,name:s,exact:i}=t||{},[a,o]=se.useState(n._formState),c=se.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=se.useRef(s);return u.current=s,se.useEffect(()=>n._subscribe({name:u.current,formState:c.current,exact:i,callback:f=>{!r&&o({...n._formState,...f})}}),[n,r,i]),se.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),se.useMemo(()=>yK(a,n,c.current,!1),[a,n])}var fl=t=>typeof t=="string",bK=(t,e,n,r,s)=>fl(t)?(r&&e.watch.add(t),Ie(n,t,s)):Array.isArray(t)?t.map(i=>(r&&e.watch.add(i),Ie(n,i))):(r&&(e.watchAll=!0),n);function nAe(t){const e=Id(),{control:n=e.control,name:r,defaultValue:s,disabled:i,exact:a}=t||{},o=se.useRef(r),c=se.useRef(s);o.current=r,se.useEffect(()=>n._subscribe({name:o.current,formState:{values:!0},exact:a,callback:l=>!i&&f(bK(o.current,n._names,l.values||n._formValues,!1,c.current))}),[n,i,a]);const[u,f]=se.useState(n._getWatch(r,s));return se.useEffect(()=>n._removeUnmounted()),u}function rAe(t){const e=Id(),{name:n,disabled:r,control:s=e.control,shouldUnregister:i}=t,a=mK(s._names.array,n),o=nAe({control:s,name:n,defaultValue:Ie(s._formValues,n,Ie(s._defaultValues,n,t.defaultValue)),exact:!0}),c=tAe({control:s,name:n,exact:!0}),u=se.useRef(t),f=se.useRef(s.register(n,{...t.rules,value:o,...Xi(t.disabled)?{disabled:t.disabled}:{}})),l=se.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ie(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ie(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ie(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ie(c.validatingFields,n)},error:{enumerable:!0,get:()=>Ie(c.errors,n)}}),[c,n]),d=se.useCallback(y=>f.current.onChange({target:{value:pK(y),name:n},type:dC.CHANGE}),[n]),m=se.useCallback(()=>f.current.onBlur({target:{value:Ie(s._formValues,n),name:n},type:dC.BLUR}),[n,s._formValues]),p=se.useCallback(y=>{const g=Ie(s._fields,n);g&&y&&(g._f.ref={focus:()=>y.focus(),select:()=>y.select(),setCustomValidity:v=>y.setCustomValidity(v),reportValidity:()=>y.reportValidity()})},[s._fields,n]),h=se.useMemo(()=>({name:n,value:o,...Xi(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:d,onBlur:m,ref:p}),[n,r,c.disabled,d,m,p,o]);return se.useEffect(()=>{const y=s._options.shouldUnregister||i;s.register(n,{...u.current.rules,...Xi(u.current.disabled)?{disabled:u.current.disabled}:{}});const g=(v,w)=>{const x=Ie(s._fields,v);x&&x._f&&(x._f.mount=w)};if(g(n,!0),y){const v=Zn(Ie(s._options.defaultValues,n));Qt(s._defaultValues,n,v),zn(Ie(s._formValues,n))&&Qt(s._formValues,n,v)}return!a&&s.register(n),()=>{(a?y&&!s._state.action:y)?s.unregister(n):g(n,!1)}},[n,s,a,i]),se.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),se.useMemo(()=>({field:h,formState:c,fieldState:l}),[h,c,l])}const sAe=t=>t.render(rAe(t));var wK=(t,e,n,r,s)=>e?{...n[t],types:{...n[t]&&n[t].types?n[t].types:{},[r]:s||!0}}:{},vi=t=>Array.isArray(t)?t:[t],pB=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}},eN=t=>Ws(t)||!hK(t);function Tu(t,e){if(eN(t)||eN(e))return t===e;if(xf(t)&&xf(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const s of n){const i=t[s];if(!r.includes(s))return!1;if(s!=="ref"){const a=e[s];if(xf(i)&&xf(a)||br(i)&&br(a)||Array.isArray(i)&&Array.isArray(a)?!Tu(i,a):i!==a)return!1}}return!0}var As=t=>br(t)&&!Object.keys(t).length,VI=t=>t.type==="file",ya=t=>typeof t=="function",fC=t=>{if(!UI)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},_K=t=>t.type==="select-multiple",WI=t=>t.type==="radio",iAe=t=>WI(t)||R_(t),DT=t=>fC(t)&&t.isConnected;function oAe(t,e){const n=e.slice(0,-1).length;let r=0;for(;r{for(const e in t)if(ya(t[e]))return!0;return!1};function hC(t,e={}){const n=Array.isArray(t);if(br(t)||n)for(const r in t)Array.isArray(t[r])||br(t[r])&&!xK(t[r])?(e[r]=Array.isArray(t[r])?[]:{},hC(t[r],e[r])):Ws(t[r])||(e[r]=!0);return e}function SK(t,e,n){const r=Array.isArray(t);if(br(t)||r)for(const s in t)Array.isArray(t[s])||br(t[s])&&!xK(t[s])?zn(e)||eN(n[s])?n[s]=Array.isArray(t[s])?hC(t[s],[]):{...hC(t[s])}:SK(t[s],Ws(e)?{}:e[s],n[s]):n[s]=!Tu(t[s],e[s]);return n}var wy=(t,e)=>SK(t,e,hC(e));const mB={value:!1,isValid:!1},gB={value:!0,isValid:!0};var EK=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!zn(t[0].attributes.value)?zn(t[0].value)||t[0].value===""?gB:{value:t[0].value,isValid:!0}:gB:mB}return mB},CK=(t,{valueAsNumber:e,valueAsDate:n,setValueAs:r})=>zn(t)?t:e?t===""?NaN:t&&+t:n&&fl(t)?new Date(t):r?r(t):t;const vB={isValid:!1,value:null};var AK=t=>Array.isArray(t)?t.reduce((e,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:e,vB):vB;function yB(t){const e=t.ref;return VI(e)?e.files:WI(e)?AK(t.refs).value:_K(e)?[...e.selectedOptions].map(({value:n})=>n):R_(e)?EK(t.refs).value:CK(zn(e.value)?t.ref.value:e.value,t)}var lAe=(t,e,n,r)=>{const s={};for(const i of t){const a=Ie(e,i);a&&Qt(s,i,a._f)}return{criteriaMode:n,names:[...t],fields:s,shouldUseNativeValidation:r}},pC=t=>t instanceof RegExp,_y=t=>zn(t)?t:pC(t)?t.source:br(t)?pC(t.value)?t.value.source:t.value:t,wm=t=>({isOnSubmit:!t||t===ko.onSubmit,isOnBlur:t===ko.onBlur,isOnChange:t===ko.onChange,isOnAll:t===ko.all,isOnTouch:t===ko.onTouched});const bB="AsyncFunction";var cAe=t=>!!t&&!!t.validate&&!!(ya(t.validate)&&t.validate.constructor.name===bB||br(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===bB)),uAe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),tN=(t,e,n)=>!n&&(e.watchAll||e.watch.has(t)||[...e.watch].some(r=>t.startsWith(r)&&/^\.\w+/.test(t.slice(r.length))));const $m=(t,e,n,r)=>{for(const s of n||Object.keys(t)){const i=Ie(t,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],s)&&!r)return!0;if(a.ref&&e(a.ref,a.name)&&!r)return!0;if($m(o,e))break}else if(br(o)&&$m(o,e))break}}};function wB(t,e,n){const r=Ie(t,n);if(r||HI(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const i=s.join("."),a=Ie(e,i),o=Ie(t,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(o&&o.type)return{name:i,error:o};s.pop()}return{name:n}}var dAe=(t,e,n,r)=>{n(t);const{name:s,...i}=t;return As(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!r||ko.all))},fAe=(t,e,n)=>!t||!e||t===e||vi(t).some(r=>r&&(n?r===e:r.startsWith(e)||e.startsWith(r))),hAe=(t,e,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(e||t):(n?r.isOnBlur:s.isOnBlur)?!t:(n?r.isOnChange:s.isOnChange)?t:!0,pAe=(t,e)=>!P_(Ie(t,e)).length&&Sr(t,e),RK=(t,e,n)=>{const r=vi(Ie(t,n));return Qt(r,"root",e[n]),Qt(t,n,r),t},HS=t=>fl(t);function _B(t,e,n="validate"){if(HS(t)||Array.isArray(t)&&t.every(HS)||Xi(t)&&!t)return{type:n,message:HS(t)?t:"",ref:e}}var Up=t=>br(t)&&!pC(t)?t:{value:t,message:""},nN=async(t,e,n,r,s,i)=>{const{ref:a,refs:o,required:c,maxLength:u,minLength:f,min:l,max:d,pattern:m,validate:p,name:h,valueAsNumber:y,mount:g}=t._f,v=Ie(n,h);if(!g||e.has(h))return{};const w=o?o[0]:a,x=L=>{s&&w.reportValidity&&(w.setCustomValidity(Xi(L)?"":L||""),w.reportValidity())},A={},k=WI(a),R=R_(a),E=k||R,T=(y||VI(a))&&zn(a.value)&&zn(v)||fC(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,D=wK.bind(null,h,r,A),O=(L,I,F,U=Ul.maxLength,Y=Ul.minLength)=>{const V=L?I:F;A[h]={type:L?U:Y,message:V,ref:a,...D(L?U:Y,V)}};if(i?!Array.isArray(v)||!v.length:c&&(!E&&(T||Ws(v))||Xi(v)&&!v||R&&!EK(o).isValid||k&&!AK(o).isValid)){const{value:L,message:I}=HS(c)?{value:!!c,message:c}:Up(c);if(L&&(A[h]={type:Ul.required,message:I,ref:w,...D(Ul.required,I)},!r))return x(I),A}if(!T&&(!Ws(l)||!Ws(d))){let L,I;const F=Up(d),U=Up(l);if(!Ws(v)&&!isNaN(v)){const Y=a.valueAsNumber||v&&+v;Ws(F.value)||(L=Y>F.value),Ws(U.value)||(I=Ynew Date(new Date().toDateString()+" "+re),H=a.type=="time",ee=a.type=="week";fl(F.value)&&v&&(L=H?V(v)>V(F.value):ee?v>F.value:Y>new Date(F.value)),fl(U.value)&&v&&(I=H?V(v)+L.value,U=!Ws(I.value)&&v.length<+I.value;if((F||U)&&(O(F,L.message,I.message),!r))return x(A[h].message),A}if(m&&!T&&fl(v)){const{value:L,message:I}=Up(m);if(pC(L)&&!v.match(L)&&(A[h]={type:Ul.pattern,message:I,ref:a,...D(Ul.pattern,I)},!r))return x(I),A}if(p){if(ya(p)){const L=await p(v,n),I=_B(L,w);if(I&&(A[h]={...I,...D(Ul.validate,I.message)},!r))return x(I.message),A}else if(br(p)){let L={};for(const I in p){if(!As(L)&&!r)break;const F=_B(await p[I](v,n),w,I);F&&(L={...F,...D(I,F.message)},x(F.message),r&&(A[h]=L))}if(!As(L)&&(A[h]={ref:w,...L},!r))return A}}return x(!0),A};const mAe={mode:ko.onSubmit,reValidateMode:ko.onChange,shouldFocusError:!0};function gAe(t={}){let e={...mAe,...t},n={submitCount:0,isDirty:!1,isLoading:ya(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1};const r={};let s=br(e.defaultValues)||br(e.values)?Zn(e.values||e.defaultValues)||{}:{},i=e.shouldUnregister?{}:Zn(s),a={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let l={...f};const d={array:pB(),state:pB()},m=wm(e.mode),p=wm(e.reValidateMode),h=e.criteriaMode===ko.all,y=J=>fe=>{clearTimeout(u),u=setTimeout(J,fe)},g=async J=>{if(!e.disabled&&(f.isValid||l.isValid||J)){const fe=e.resolver?As((await T()).errors):await O(r,!0);fe!==n.isValid&&d.state.next({isValid:fe})}},v=(J,fe)=>{!e.disabled&&(f.isValidating||f.validatingFields||l.isValidating||l.validatingFields)&&((J||Array.from(o.mount)).forEach(ge=>{ge&&(fe?Qt(n.validatingFields,ge,fe):Sr(n.validatingFields,ge))}),d.state.next({validatingFields:n.validatingFields,isValidating:!As(n.validatingFields)}))},w=(J,fe=[],ge,Pe,Oe=!0,xe=!0)=>{if(Pe&&ge&&!e.disabled){if(a.action=!0,xe&&Array.isArray(Ie(r,J))){const Te=ge(Ie(r,J),Pe.argA,Pe.argB);Oe&&Qt(r,J,Te)}if(xe&&Array.isArray(Ie(n.errors,J))){const Te=ge(Ie(n.errors,J),Pe.argA,Pe.argB);Oe&&Qt(n.errors,J,Te),pAe(n.errors,J)}if((f.touchedFields||l.touchedFields)&&xe&&Array.isArray(Ie(n.touchedFields,J))){const Te=ge(Ie(n.touchedFields,J),Pe.argA,Pe.argB);Oe&&Qt(n.touchedFields,J,Te)}(f.dirtyFields||l.dirtyFields)&&(n.dirtyFields=wy(s,i)),d.state.next({name:J,isDirty:I(J,fe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qt(i,J,fe)},x=(J,fe)=>{Qt(n.errors,J,fe),d.state.next({errors:n.errors})},A=J=>{n.errors=J,d.state.next({errors:n.errors,isValid:!1})},k=(J,fe,ge,Pe)=>{const Oe=Ie(r,J);if(Oe){const xe=Ie(i,J,zn(ge)?Ie(s,J):ge);zn(xe)||Pe&&Pe.defaultChecked||fe?Qt(i,J,fe?xe:yB(Oe._f)):Y(J,xe),a.mount&&g()}},R=(J,fe,ge,Pe,Oe)=>{let xe=!1,Te=!1;const Ye={name:J};if(!e.disabled){if(!ge||Pe){(f.isDirty||l.isDirty)&&(Te=n.isDirty,n.isDirty=Ye.isDirty=I(),xe=Te!==Ye.isDirty);const Rt=Tu(Ie(s,J),fe);Te=!!Ie(n.dirtyFields,J),Rt?Sr(n.dirtyFields,J):Qt(n.dirtyFields,J,!0),Ye.dirtyFields=n.dirtyFields,xe=xe||(f.dirtyFields||l.dirtyFields)&&Te!==!Rt}if(ge){const Rt=Ie(n.touchedFields,J);Rt||(Qt(n.touchedFields,J,ge),Ye.touchedFields=n.touchedFields,xe=xe||(f.touchedFields||l.touchedFields)&&Rt!==ge)}xe&&Oe&&d.state.next(Ye)}return xe?Ye:{}},E=(J,fe,ge,Pe)=>{const Oe=Ie(n.errors,J),xe=(f.isValid||l.isValid)&&Xi(fe)&&n.isValid!==fe;if(e.delayError&&ge?(c=y(()=>x(J,ge)),c(e.delayError)):(clearTimeout(u),c=null,ge?Qt(n.errors,J,ge):Sr(n.errors,J)),(ge?!Tu(Oe,ge):Oe)||!As(Pe)||xe){const Te={...Pe,...xe&&Xi(fe)?{isValid:fe}:{},errors:n.errors,name:J};n={...n,...Te},d.state.next(Te)}},T=async J=>{v(J,!0);const fe=await e.resolver(i,e.context,lAe(J||o.mount,r,e.criteriaMode,e.shouldUseNativeValidation));return v(J),fe},D=async J=>{const{errors:fe}=await T(J);if(J)for(const ge of J){const Pe=Ie(fe,ge);Pe?Qt(n.errors,ge,Pe):Sr(n.errors,ge)}else n.errors=fe;return fe},O=async(J,fe,ge={valid:!0})=>{for(const Pe in J){const Oe=J[Pe];if(Oe){const{_f:xe,...Te}=Oe;if(xe){const Ye=o.array.has(xe.name),Rt=Oe._f&&cAe(Oe._f);Rt&&f.validatingFields&&v([Pe],!0);const bt=await nN(Oe,o.disabled,i,h,e.shouldUseNativeValidation&&!fe,Ye);if(Rt&&f.validatingFields&&v([Pe]),bt[xe.name]&&(ge.valid=!1,fe))break;!fe&&(Ie(bt,xe.name)?Ye?RK(n.errors,bt,xe.name):Qt(n.errors,xe.name,bt[xe.name]):Sr(n.errors,xe.name))}!As(Te)&&await O(Te,fe,ge)}}return ge.valid},L=()=>{for(const J of o.unMount){const fe=Ie(r,J);fe&&(fe._f.refs?fe._f.refs.every(ge=>!DT(ge)):!DT(fe._f.ref))&&Ae(J)}o.unMount=new Set},I=(J,fe)=>!e.disabled&&(J&&fe&&Qt(i,J,fe),!Tu(q(),s)),F=(J,fe,ge)=>bK(J,o,{...a.mount?i:zn(fe)?s:fl(J)?{[J]:fe}:fe},ge,fe),U=J=>P_(Ie(a.mount?i:s,J,e.shouldUnregister?Ie(s,J,[]):[])),Y=(J,fe,ge={})=>{const Pe=Ie(r,J);let Oe=fe;if(Pe){const xe=Pe._f;xe&&(!xe.disabled&&Qt(i,J,CK(fe,xe)),Oe=fC(xe.ref)&&Ws(fe)?"":fe,_K(xe.ref)?[...xe.ref.options].forEach(Te=>Te.selected=Oe.includes(Te.value)):xe.refs?R_(xe.ref)?xe.refs.length>1?xe.refs.forEach(Te=>(!Te.defaultChecked||!Te.disabled)&&(Te.checked=Array.isArray(Oe)?!!Oe.find(Ye=>Ye===Te.value):Oe===Te.value)):xe.refs[0]&&(xe.refs[0].checked=!!Oe):xe.refs.forEach(Te=>Te.checked=Te.value===Oe):VI(xe.ref)?xe.ref.value="":(xe.ref.value=Oe,xe.ref.type||d.state.next({name:J,values:Zn(i)})))}(ge.shouldDirty||ge.shouldTouch)&&R(J,Oe,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&X(J)},V=(J,fe,ge)=>{for(const Pe in fe){const Oe=fe[Pe],xe=`${J}.${Pe}`,Te=Ie(r,xe);(o.array.has(J)||br(Oe)||Te&&!Te._f)&&!xf(Oe)?V(xe,Oe,ge):Y(xe,Oe,ge)}},H=(J,fe,ge={})=>{const Pe=Ie(r,J),Oe=o.array.has(J),xe=Zn(fe);Qt(i,J,xe),Oe?(d.array.next({name:J,values:Zn(i)}),(f.isDirty||f.dirtyFields||l.isDirty||l.dirtyFields)&&ge.shouldDirty&&d.state.next({name:J,dirtyFields:wy(s,i),isDirty:I(J,xe)})):Pe&&!Pe._f&&!Ws(xe)?V(J,xe,ge):Y(J,xe,ge),tN(J,o)&&d.state.next({...n}),d.state.next({name:a.mount?J:void 0,values:Zn(i)})},ee=async J=>{a.mount=!0;const fe=J.target;let ge=fe.name,Pe=!0;const Oe=Ie(r,ge),xe=Te=>{Pe=Number.isNaN(Te)||xf(Te)&&isNaN(Te.getTime())||Tu(Te,Ie(i,ge,Te))};if(Oe){let Te,Ye;const Rt=fe.type?yB(Oe._f):pK(J),bt=J.type===dC.BLUR||J.type===dC.FOCUS_OUT,Os=!uAe(Oe._f)&&!e.resolver&&!Ie(n.errors,ge)&&!Oe._f.deps||hAe(bt,Ie(n.touchedFields,ge),n.isSubmitted,p,m),Kn=tN(ge,o,bt);Qt(i,ge,Rt),bt?(Oe._f.onBlur&&Oe._f.onBlur(J),c&&c(0)):Oe._f.onChange&&Oe._f.onChange(J);const ps=R(ge,Rt,bt),Ut=!As(ps)||Kn;if(!bt&&d.state.next({name:ge,type:J.type,values:Zn(i)}),Os)return(f.isValid||l.isValid)&&(e.mode==="onBlur"?bt&&g():bt||g()),Ut&&d.state.next({name:ge,...Kn?{}:ps});if(!bt&&Kn&&d.state.next({...n}),e.resolver){const{errors:on}=await T([ge]);if(xe(Rt),Pe){const gn=wB(n.errors,r,ge),Be=wB(on,r,gn.name||ge);Te=Be.error,ge=Be.name,Ye=As(on)}}else v([ge],!0),Te=(await nN(Oe,o.disabled,i,h,e.shouldUseNativeValidation))[ge],v([ge]),xe(Rt),Pe&&(Te?Ye=!1:(f.isValid||l.isValid)&&(Ye=await O(r,!0)));Pe&&(Oe._f.deps&&X(Oe._f.deps),E(ge,Ye,Te,ps))}},re=(J,fe)=>{if(Ie(n.errors,fe)&&J.focus)return J.focus(),1},X=async(J,fe={})=>{let ge,Pe;const Oe=vi(J);if(e.resolver){const xe=await D(zn(J)?J:Oe);ge=As(xe),Pe=J?!Oe.some(Te=>Ie(xe,Te)):ge}else J?(Pe=(await Promise.all(Oe.map(async xe=>{const Te=Ie(r,xe);return await O(Te&&Te._f?{[xe]:Te}:Te)}))).every(Boolean),!(!Pe&&!n.isValid)&&g()):Pe=ge=await O(r);return d.state.next({...!fl(J)||(f.isValid||l.isValid)&&ge!==n.isValid?{}:{name:J},...e.resolver||!J?{isValid:ge}:{},errors:n.errors}),fe.shouldFocus&&!Pe&&$m(r,re,J?Oe:o.mount),Pe},q=J=>{const fe={...a.mount?i:s};return zn(J)?fe:fl(J)?Ie(fe,J):J.map(ge=>Ie(fe,ge))},K=(J,fe)=>({invalid:!!Ie((fe||n).errors,J),isDirty:!!Ie((fe||n).dirtyFields,J),error:Ie((fe||n).errors,J),isValidating:!!Ie(n.validatingFields,J),isTouched:!!Ie((fe||n).touchedFields,J)}),Z=J=>{J&&vi(J).forEach(fe=>Sr(n.errors,fe)),d.state.next({errors:J?n.errors:{}})},ue=(J,fe,ge)=>{const Pe=(Ie(r,J,{_f:{}})._f||{}).ref,Oe=Ie(n.errors,J)||{},{ref:xe,message:Te,type:Ye,...Rt}=Oe;Qt(n.errors,J,{...Rt,...fe,ref:Pe}),d.state.next({name:J,errors:n.errors,isValid:!1}),ge&&ge.shouldFocus&&Pe&&Pe.focus&&Pe.focus()},de=(J,fe)=>ya(J)?d.state.subscribe({next:ge=>J(F(void 0,fe),ge)}):F(J,fe,!0),ie=J=>d.state.subscribe({next:fe=>{fAe(J.name,fe.name,J.exact)&&dAe(fe,J.formState||f,Yt,J.reRenderRoot)&&J.callback({values:{...i},...n,...fe})}}).unsubscribe,be=J=>(a.mount=!0,l={...l,...J.formState},ie({...J,formState:l})),Ae=(J,fe={})=>{for(const ge of J?vi(J):o.mount)o.mount.delete(ge),o.array.delete(ge),fe.keepValue||(Sr(r,ge),Sr(i,ge)),!fe.keepError&&Sr(n.errors,ge),!fe.keepDirty&&Sr(n.dirtyFields,ge),!fe.keepTouched&&Sr(n.touchedFields,ge),!fe.keepIsValidating&&Sr(n.validatingFields,ge),!e.shouldUnregister&&!fe.keepDefaultValue&&Sr(s,ge);d.state.next({values:Zn(i)}),d.state.next({...n,...fe.keepDirty?{isDirty:I()}:{}}),!fe.keepIsValid&&g()},_e=({disabled:J,name:fe})=>{(Xi(J)&&a.mount||J||o.disabled.has(fe))&&(J?o.disabled.add(fe):o.disabled.delete(fe))},Me=(J,fe={})=>{let ge=Ie(r,J);const Pe=Xi(fe.disabled)||Xi(e.disabled);return Qt(r,J,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:J}},name:J,mount:!0,...fe}}),o.mount.add(J),ge?_e({disabled:Xi(fe.disabled)?fe.disabled:e.disabled,name:J}):k(J,!0,fe.value),{...Pe?{disabled:fe.disabled||e.disabled}:{},...e.progressive?{required:!!fe.required,min:_y(fe.min),max:_y(fe.max),minLength:_y(fe.minLength),maxLength:_y(fe.maxLength),pattern:_y(fe.pattern)}:{},name:J,onChange:ee,onBlur:ee,ref:Oe=>{if(Oe){Me(J,fe),ge=Ie(r,J);const xe=zn(Oe.value)&&Oe.querySelectorAll&&Oe.querySelectorAll("input,select,textarea")[0]||Oe,Te=iAe(xe),Ye=ge._f.refs||[];if(Te?Ye.find(Rt=>Rt===xe):xe===ge._f.ref)return;Qt(r,J,{_f:{...ge._f,...Te?{refs:[...Ye.filter(DT),xe,...Array.isArray(Ie(s,J))?[{}]:[]],ref:{type:xe.type,name:J}}:{ref:xe}}}),k(J,!1,void 0,xe)}else ge=Ie(r,J,{}),ge._f&&(ge._f.mount=!1),(e.shouldUnregister||fe.shouldUnregister)&&!(mK(o.array,J)&&a.action)&&o.unMount.add(J)}}},Ne=()=>e.shouldFocusError&&$m(r,re,o.mount),ye=J=>{Xi(J)&&(d.state.next({disabled:J}),$m(r,(fe,ge)=>{const Pe=Ie(r,ge);Pe&&(fe.disabled=Pe._f.disabled||J,Array.isArray(Pe._f.refs)&&Pe._f.refs.forEach(Oe=>{Oe.disabled=Pe._f.disabled||J}))},0,!1))},$e=(J,fe)=>async ge=>{let Pe;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Oe=Zn(i);if(d.state.next({isSubmitting:!0}),e.resolver){const{errors:xe,values:Te}=await T();n.errors=xe,Oe=Te}else await O(r);if(o.disabled.size)for(const xe of o.disabled)Qt(Oe,xe,void 0);if(Sr(n.errors,"root"),As(n.errors)){d.state.next({errors:{}});try{await J(Oe,ge)}catch(xe){Pe=xe}}else fe&&await fe({...n.errors},ge),Ne(),setTimeout(Ne);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:As(n.errors)&&!Pe,submitCount:n.submitCount+1,errors:n.errors}),Pe)throw Pe},ut=(J,fe={})=>{Ie(r,J)&&(zn(fe.defaultValue)?H(J,Zn(Ie(s,J))):(H(J,fe.defaultValue),Qt(s,J,Zn(fe.defaultValue))),fe.keepTouched||Sr(n.touchedFields,J),fe.keepDirty||(Sr(n.dirtyFields,J),n.isDirty=fe.defaultValue?I(J,Zn(Ie(s,J))):I()),fe.keepError||(Sr(n.errors,J),f.isValid&&g()),d.state.next({...n}))},Qe=(J,fe={})=>{const ge=J?Zn(J):s,Pe=Zn(ge),Oe=As(J),xe=Oe?s:Pe;if(fe.keepDefaultValues||(s=ge),!fe.keepValues){if(fe.keepDirtyValues){const Te=new Set([...o.mount,...Object.keys(wy(s,i))]);for(const Ye of Array.from(Te))Ie(n.dirtyFields,Ye)?Qt(xe,Ye,Ie(i,Ye)):H(Ye,Ie(xe,Ye))}else{if(UI&&zn(J))for(const Te of o.mount){const Ye=Ie(r,Te);if(Ye&&Ye._f){const Rt=Array.isArray(Ye._f.refs)?Ye._f.refs[0]:Ye._f.ref;if(fC(Rt)){const bt=Rt.closest("form");if(bt){bt.reset();break}}}}for(const Te of o.mount)H(Te,Ie(xe,Te))}i=Zn(xe),d.array.next({values:{...xe}}),d.state.next({values:{...xe}})}o={mount:fe.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!fe.keepIsValid||!!fe.keepDirtyValues,a.watch=!!e.shouldUnregister,d.state.next({submitCount:fe.keepSubmitCount?n.submitCount:0,isDirty:Oe?!1:fe.keepDirty?n.isDirty:!!(fe.keepDefaultValues&&!Tu(J,s)),isSubmitted:fe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe?{}:fe.keepDirtyValues?fe.keepDefaultValues&&i?wy(s,i):n.dirtyFields:fe.keepDefaultValues&&J?wy(s,J):fe.keepDirty?n.dirtyFields:{},touchedFields:fe.keepTouched?n.touchedFields:{},errors:fe.keepErrors?n.errors:{},isSubmitSuccessful:fe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},vt=(J,fe)=>Qe(ya(J)?J(i):J,fe),Sn=(J,fe={})=>{const ge=Ie(r,J),Pe=ge&&ge._f;if(Pe){const Oe=Pe.refs?Pe.refs[0]:Pe.ref;Oe.focus&&(Oe.focus(),fe.shouldSelect&&ya(Oe.select)&&Oe.select())}},Yt=J=>{n={...n,...J}},Xt={control:{register:Me,unregister:Ae,getFieldState:K,handleSubmit:$e,setError:ue,_subscribe:ie,_runSchema:T,_getWatch:F,_getDirty:I,_setValid:g,_setFieldArray:w,_setDisabledField:_e,_setErrors:A,_getFieldArray:U,_reset:Qe,_resetDefaultValues:()=>ya(e.defaultValues)&&e.defaultValues().then(J=>{vt(J,e.resetOptions),d.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:ye,_subjects:d,_proxyFormState:f,get _fields(){return r},get _formValues(){return i},get _state(){return a},set _state(J){a=J},get _defaultValues(){return s},get _names(){return o},set _names(J){o=J},get _formState(){return n},get _options(){return e},set _options(J){e={...e,...J}}},subscribe:be,trigger:X,register:Me,handleSubmit:$e,watch:de,setValue:H,getValues:q,reset:vt,resetField:ut,clearErrors:Z,unregister:Ae,setError:ue,setFocus:Sn,getFieldState:K};return{...Xt,formControl:Xt}}var pu=()=>{const t=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(Math.random()*16+t)%16|0;return(e=="x"?n:n&3|8).toString(16)})},NT=(t,e,n={})=>n.shouldFocus||zn(n.shouldFocus)?n.focusName||`${t}.${zn(n.focusIndex)?e:n.focusIndex}.`:"",OT=(t,e)=>[...t,...vi(e)],MT=t=>Array.isArray(t)?t.map(()=>{}):void 0;function LT(t,e,n){return[...t.slice(0,e),...vi(n),...t.slice(e)]}var IT=(t,e,n)=>Array.isArray(t)?(zn(t[n])&&(t[n]=void 0),t.splice(n,0,t.splice(e,1)[0]),t):[],$T=(t,e)=>[...vi(e),...vi(t)];function vAe(t,e){let n=0;const r=[...t];for(const s of e)r.splice(s-n,1),n++;return P_(r).length?r:[]}var FT=(t,e)=>zn(e)?[]:vAe(t,vi(e).sort((n,r)=>n-r)),jT=(t,e,n)=>{[t[e],t[n]]=[t[n],t[e]]},xB=(t,e,n)=>(t[e]=n,t);function tUe(t){const e=Id(),{control:n=e.control,name:r,keyName:s="id",shouldUnregister:i,rules:a}=t,[o,c]=se.useState(n._getFieldArray(r)),u=se.useRef(n._getFieldArray(r).map(pu)),f=se.useRef(o),l=se.useRef(r),d=se.useRef(!1);l.current=r,f.current=o,n._names.array.add(r),a&&n.register(r,a),se.useEffect(()=>n._subjects.array.subscribe({next:({values:k,name:R})=>{if(R===l.current||!R){const E=Ie(k,l.current);Array.isArray(E)&&(c(E),u.current=E.map(pu))}}}).unsubscribe,[n]);const m=se.useCallback(k=>{d.current=!0,n._setFieldArray(r,k)},[n,r]),p=(k,R)=>{const E=vi(Zn(k)),T=OT(n._getFieldArray(r),E);n._names.focus=NT(r,T.length-1,R),u.current=OT(u.current,E.map(pu)),m(T),c(T),n._setFieldArray(r,T,OT,{argA:MT(k)})},h=(k,R)=>{const E=vi(Zn(k)),T=$T(n._getFieldArray(r),E);n._names.focus=NT(r,0,R),u.current=$T(u.current,E.map(pu)),m(T),c(T),n._setFieldArray(r,T,$T,{argA:MT(k)})},y=k=>{const R=FT(n._getFieldArray(r),k);u.current=FT(u.current,k),m(R),c(R),!Array.isArray(Ie(n._fields,r))&&Qt(n._fields,r,void 0),n._setFieldArray(r,R,FT,{argA:k})},g=(k,R,E)=>{const T=vi(Zn(R)),D=LT(n._getFieldArray(r),k,T);n._names.focus=NT(r,k,E),u.current=LT(u.current,k,T.map(pu)),m(D),c(D),n._setFieldArray(r,D,LT,{argA:k,argB:MT(R)})},v=(k,R)=>{const E=n._getFieldArray(r);jT(E,k,R),jT(u.current,k,R),m(E),c(E),n._setFieldArray(r,E,jT,{argA:k,argB:R},!1)},w=(k,R)=>{const E=n._getFieldArray(r);IT(E,k,R),IT(u.current,k,R),m(E),c(E),n._setFieldArray(r,E,IT,{argA:k,argB:R},!1)},x=(k,R)=>{const E=Zn(R),T=xB(n._getFieldArray(r),k,E);u.current=[...T].map((D,O)=>!D||O===k?pu():u.current[O]),m(T),c([...T]),n._setFieldArray(r,T,xB,{argA:k,argB:E},!0,!1)},A=k=>{const R=vi(Zn(k));u.current=R.map(pu),m([...R]),c([...R]),n._setFieldArray(r,[...R],E=>E,{},!0,!1)};return se.useEffect(()=>{if(n._state.action=!1,tN(r,n._names)&&n._subjects.state.next({...n._formState}),d.current&&(!wm(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!wm(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(k=>{const R=Ie(k.errors,r),E=Ie(n._formState.errors,r);(E?!R&&E.type||R&&(E.type!==R.type||E.message!==R.message):R&&R.type)&&(R?Qt(n._formState.errors,r,R):Sr(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const k=Ie(n._fields,r);k&&k._f&&!(wm(n._options.reValidateMode).isOnSubmit&&wm(n._options.mode).isOnSubmit)&&nN(k,n._names.disabled,n._formValues,n._options.criteriaMode===ko.all,n._options.shouldUseNativeValidation,!0).then(R=>!As(R)&&n._subjects.state.next({errors:RK(n._formState.errors,R,r)}))}n._subjects.state.next({name:r,values:Zn(n._formValues)}),n._names.focus&&$m(n._fields,(k,R)=>{if(n._names.focus&&R.startsWith(n._names.focus)&&k.focus)return k.focus(),1}),n._names.focus="",n._setValid(),d.current=!1},[o,r,n]),se.useEffect(()=>(!Ie(n._formValues,r)&&n._setFieldArray(r),()=>{const k=(R,E)=>{const T=Ie(n._fields,R);T&&T._f&&(T._f.mount=E)};n._options.shouldUnregister||i?n.unregister(r):k(r,!1)}),[r,n,s,i]),{swap:se.useCallback(v,[m,r,n]),move:se.useCallback(w,[m,r,n]),prepend:se.useCallback(h,[m,r,n]),append:se.useCallback(p,[m,r,n]),remove:se.useCallback(y,[m,r,n]),insert:se.useCallback(g,[m,r,n]),update:se.useCallback(x,[m,r,n]),replace:se.useCallback(A,[m,r,n]),fields:se.useMemo(()=>o.map((k,R)=>({...k,[s]:u.current[R]||pu()})),[o,s])}}function yAe(t={}){const e=se.useRef(void 0),n=se.useRef(void 0),[r,s]=se.useState({isDirty:!1,isValidating:!1,isLoading:ya(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,defaultValues:ya(t.defaultValues)?void 0:t.defaultValues});e.current||(e.current={...t.formControl?t.formControl:gAe(t),formState:r},t.formControl&&t.defaultValues&&!ya(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions));const i=e.current.control;return i._options=t,se.useLayoutEffect(()=>i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0}),[i]),se.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),se.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),se.useEffect(()=>{t.values&&!Tu(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values,s(a=>({...a}))):i._resetDefaultValues()},[t.values,i]),se.useEffect(()=>{t.errors&&!As(t.errors)&&i._setErrors(t.errors)},[t.errors,i]),se.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),se.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[t.shouldUnregister,i]),e.current.formState=yK(r,i),e.current}var bAe="Label",PK=_.forwardRef((t,e)=>P.jsx(De.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));PK.displayName=bAe;var TK=PK;const wAe=zo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),kK=_.forwardRef(({className:t,...e},n)=>P.jsx(TK,{ref:n,className:ce(wAe(),t),...e}));kK.displayName=TK.displayName;const _Ae=eAe,DK=_.createContext({}),GI=({...t})=>P.jsx(DK.Provider,{value:{name:t.name},children:P.jsx(sAe,{...t},t.name)}),Tv=()=>{const t=_.useContext(DK),e=_.useContext(NK),{getFieldState:n,formState:r}=Id(),s=n(t.name,r);if(!t)throw new Error("useFormField should be used within ");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...s}},NK=_.createContext({}),hA=_.forwardRef(({className:t,...e},n)=>{const r=_.useId();return P.jsx(NK.Provider,{value:{id:r},children:P.jsx("div",{ref:n,className:ce("space-y-2",t),...e})})});hA.displayName="FormItem";const OK=_.forwardRef(({className:t,...e},n)=>{const{error:r,formItemId:s}=Tv();return P.jsx(kK,{ref:n,className:ce(r&&"text-destructive",t),htmlFor:s,...e})});OK.displayName="FormLabel";const pA=_.forwardRef(({...t},e)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:i}=Tv();return P.jsx(Ea,{ref:e,id:r,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});pA.displayName="FormControl";const mA=_.forwardRef(({className:t,...e},n)=>{const{formDescriptionId:r}=Tv();return P.jsx("p",{ref:n,id:r,className:ce("text-[0.8rem] text-muted-foreground",t),...e})});mA.displayName="FormDescription";const MK=_.forwardRef(({className:t,children:e,...n},r)=>{const{error:s,formMessageId:i}=Tv(),a=s?String((s==null?void 0:s.message)??""):e;return a?P.jsx("p",{ref:r,id:i,className:ce("text-[0.8rem] font-medium text-destructive",t),...n,children:a}):null});MK.displayName="FormMessage";var zT,LK="HoverCard",[IK,nUe]=Pn(LK,[El]),qI=El(),[rUe,KI]=IK(LK),$K="HoverCardTrigger",xAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=KI($K,n),i=qI(n);return P.jsx(Pv,{asChild:!0,...i,children:P.jsx(De.a,{"data-state":s.open?"open":"closed",...r,ref:e,onPointerEnter:me(t.onPointerEnter,gC(s.onOpen)),onPointerLeave:me(t.onPointerLeave,gC(s.onClose)),onFocus:me(t.onFocus,s.onOpen),onBlur:me(t.onBlur,s.onClose),onTouchStart:me(t.onTouchStart,a=>a.preventDefault())})})});xAe.displayName=$K;var SAe="HoverCardPortal",[sUe,EAe]=IK(SAe,{forceMount:void 0}),mC="HoverCardContent",FK=_.forwardRef((t,e)=>{const n=EAe(mC,t.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=t,i=KI(mC,t.__scopeHoverCard);return P.jsx(Un,{present:r||i.open,children:P.jsx(CAe,{"data-state":i.open?"open":"closed",...s,onPointerEnter:me(t.onPointerEnter,gC(i.onOpen)),onPointerLeave:me(t.onPointerLeave,gC(i.onClose)),ref:e})})});FK.displayName=mC;var CAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,...o}=t,c=KI(mC,n),u=qI(n),f=_.useRef(null),l=tt(e,f),[d,m]=_.useState(!1);return _.useEffect(()=>{if(d){const p=document.body;return zT=p.style.userSelect||p.style.webkitUserSelect,p.style.userSelect="none",p.style.webkitUserSelect="none",()=>{p.style.userSelect=zT,p.style.webkitUserSelect=zT}}},[d]),_.useEffect(()=>{if(f.current){const p=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())==null?void 0:y.toString())!==""&&(c.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",p),()=>{document.removeEventListener("pointerup",p),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),_.useEffect(()=>{f.current&&PAe(f.current).forEach(h=>h.setAttribute("tabindex","-1"))}),P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:a,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:me(i,p=>{p.preventDefault()}),onDismiss:c.onDismiss,children:P.jsx(b_,{...u,...o,onPointerDown:me(o.onPointerDown,p=>{p.currentTarget.contains(p.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:l,style:{...o.style,userSelect:d?"text":void 0,WebkitUserSelect:d?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),AAe="HoverCardArrow",RAe=_.forwardRef((t,e)=>{const{__scopeHoverCard:n,...r}=t,s=qI(n);return P.jsx(w_,{...s,...r,ref:e})});RAe.displayName=AAe;function gC(t){return e=>e.pointerType==="touch"?void 0:t()}function PAe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)e.push(n.currentNode);return e}var jK=FK;const TAe=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(jK,{ref:s,align:e,sideOffset:n,className:ce("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));TAe.displayName=jK.displayName;const kAe=_.forwardRef(({className:t,type:e,...n},r)=>P.jsx("input",{type:e,className:ce("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...n}));kAe.displayName="Input";var gA="Menubar",[rN,DAe,NAe]=qc(gA),[zK,iUe]=Pn(gA,[NAe,Cl]),Pi=E_(),BK=Cl(),[OAe,UK]=zK(gA),HK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,value:r,onValueChange:s,defaultValue:i,loop:a=!0,dir:o,...c}=t,u=ka(o),f=BK(n),[l="",d]=sr({prop:r,onChange:s,defaultProp:i}),[m,p]=_.useState(null);return P.jsx(OAe,{scope:n,value:l,onMenuOpen:_.useCallback(h=>{d(h),p(h)},[d]),onMenuClose:_.useCallback(()=>d(""),[d]),onMenuToggle:_.useCallback(h=>{d(y=>y?"":h),p(h)},[d]),dir:u,loop:a,children:P.jsx(rN.Provider,{scope:n,children:P.jsx(rN.Slot,{scope:n,children:P.jsx(__,{asChild:!0,...f,orientation:"horizontal",loop:a,dir:u,currentTabStopId:m,onCurrentTabStopIdChange:p,children:P.jsx(De.div,{role:"menubar",...c,ref:e})})})})})});HK.displayName=gA;var MAe="MenubarMenu",[oUe,VK]=zK(MAe),sN="MenubarTrigger",WK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,disabled:r=!1,...s}=t,i=BK(n),a=Pi(n),o=UK(sN,n),c=VK(sN,n),u=_.useRef(null),f=tt(e,u,c.triggerRef),[l,d]=_.useState(!1),m=o.value===c.value;return P.jsx(rN.ItemSlot,{scope:n,value:c.value,disabled:r,children:P.jsx(x_,{asChild:!0,...i,focusable:!r,tabStopId:c.value,children:P.jsx(_I,{asChild:!0,...a,children:P.jsx(De.button,{type:"button",role:"menuitem",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?c.contentId:void 0,"data-highlighted":l?"":void 0,"data-state":m?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:f,onPointerDown:me(t.onPointerDown,p=>{!r&&p.button===0&&p.ctrlKey===!1&&(o.onMenuOpen(c.value),m||p.preventDefault())}),onPointerEnter:me(t.onPointerEnter,()=>{var h;!!o.value&&!m&&(o.onMenuOpen(c.value),(h=u.current)==null||h.focus())}),onKeyDown:me(t.onKeyDown,p=>{r||(["Enter"," "].includes(p.key)&&o.onMenuToggle(c.value),p.key==="ArrowDown"&&o.onMenuOpen(c.value),["Enter"," ","ArrowDown"].includes(p.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,p.preventDefault()))}),onFocus:me(t.onFocus,()=>d(!0)),onBlur:me(t.onBlur,()=>d(!1))})})})})});WK.displayName=sN;var LAe="MenubarPortal",GK=t=>{const{__scopeMenubar:e,...n}=t,r=Pi(e);return P.jsx(xI,{...r,...n})};GK.displayName=LAe;var iN="MenubarContent",qK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,align:r="start",...s}=t,i=Pi(n),a=UK(iN,n),o=VK(iN,n),c=DAe(n),u=_.useRef(!1);return P.jsx(SI,{id:o.contentId,"aria-labelledby":o.triggerId,"data-radix-menubar-content":"",...i,...s,ref:e,align:r,onCloseAutoFocus:me(t.onCloseAutoFocus,f=>{var d;!!!a.value&&!u.current&&((d=o.triggerRef.current)==null||d.focus()),u.current=!1,f.preventDefault()}),onFocusOutside:me(t.onFocusOutside,f=>{const l=f.target;c().some(m=>{var p;return(p=m.ref.current)==null?void 0:p.contains(l)})&&f.preventDefault()}),onInteractOutside:me(t.onInteractOutside,()=>{u.current=!0}),onEntryFocus:f=>{o.wasKeyboardTriggerOpenRef.current||f.preventDefault()},onKeyDown:me(t.onKeyDown,f=>{if(["ArrowRight","ArrowLeft"].includes(f.key)){const l=f.target,d=l.hasAttribute("data-radix-menubar-subtrigger"),m=l.closest("[data-radix-menubar-content]")!==f.currentTarget,h=(a.dir==="rtl"?"ArrowRight":"ArrowLeft")===f.key;if(!h&&d||m&&h)return;let v=c().filter(A=>!A.disabled).map(A=>A.value);h&&v.reverse();const w=v.indexOf(o.value);v=a.loop?XAe(v,w+1):v.slice(w+1);const[x]=v;x&&a.onMenuOpen(x)}},{checkForDefaultPrevented:!1}),style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});qK.displayName=iN;var IAe="MenubarGroup",$Ae=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(EI,{...s,...r,ref:e})});$Ae.displayName=IAe;var FAe="MenubarLabel",KK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(CI,{...s,...r,ref:e})});KK.displayName=FAe;var jAe="MenubarItem",YK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(AI,{...s,...r,ref:e})});YK.displayName=jAe;var zAe="MenubarCheckboxItem",XK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(RI,{...s,...r,ref:e})});XK.displayName=zAe;var BAe="MenubarRadioGroup",UAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(PI,{...s,...r,ref:e})});UAe.displayName=BAe;var HAe="MenubarRadioItem",QK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(TI,{...s,...r,ref:e})});QK.displayName=HAe;var VAe="MenubarItemIndicator",ZK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(kI,{...s,...r,ref:e})});ZK.displayName=VAe;var WAe="MenubarSeparator",JK=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(DI,{...s,...r,ref:e})});JK.displayName=WAe;var GAe="MenubarArrow",qAe=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(NI,{...s,...r,ref:e})});qAe.displayName=GAe;var KAe="MenubarSubTrigger",e7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(OI,{"data-radix-menubar-subtrigger":"",...s,...r,ref:e})});e7.displayName=KAe;var YAe="MenubarSubContent",t7=_.forwardRef((t,e)=>{const{__scopeMenubar:n,...r}=t,s=Pi(n);return P.jsx(MI,{...s,"data-radix-menubar-content":"",...r,ref:e,style:{...t.style,"--radix-menubar-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-menubar-content-available-width":"var(--radix-popper-available-width)","--radix-menubar-content-available-height":"var(--radix-popper-available-height)","--radix-menubar-trigger-width":"var(--radix-popper-anchor-width)","--radix-menubar-trigger-height":"var(--radix-popper-anchor-height)"}})});t7.displayName=YAe;function XAe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var n7=HK,r7=WK,QAe=GK,s7=qK,i7=KK,o7=YK,a7=XK,l7=QK,c7=ZK,u7=JK,d7=e7,f7=t7;const ZAe=_.forwardRef(({className:t,...e},n)=>P.jsx(n7,{ref:n,className:ce("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...e}));ZAe.displayName=n7.displayName;const JAe=_.forwardRef(({className:t,...e},n)=>P.jsx(r7,{ref:n,className:ce("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...e}));JAe.displayName=r7.displayName;const eRe=_.forwardRef(({className:t,inset:e,children:n,...r},s)=>P.jsxs(d7,{ref:s,className:ce("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...r,children:[n,P.jsx(r_,{className:"ml-auto h-4 w-4"})]}));eRe.displayName=d7.displayName;const tRe=_.forwardRef(({className:t,...e},n)=>P.jsx(f7,{ref:n,className:ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));tRe.displayName=f7.displayName;const nRe=_.forwardRef(({className:t,align:e="start",alignOffset:n=-4,sideOffset:r=8,...s},i)=>P.jsx(QAe,{children:P.jsx(s7,{ref:i,align:e,alignOffset:n,sideOffset:r,className:ce("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));nRe.displayName=s7.displayName;const rRe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(o7,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));rRe.displayName=o7.displayName;const sRe=_.forwardRef(({className:t,children:e,checked:n,...r},s)=>P.jsxs(a7,{ref:s,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...r,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(c7,{children:P.jsx(n_,{className:"h-4 w-4"})})}),e]}));sRe.displayName=a7.displayName;const iRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(l7,{ref:r,className:ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(c7,{children:P.jsx(I1,{className:"h-2 w-2 fill-current"})})}),e]}));iRe.displayName=l7.displayName;const oRe=_.forwardRef(({className:t,inset:e,...n},r)=>P.jsx(i7,{ref:r,className:ce("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));oRe.displayName=i7.displayName;const aRe=_.forwardRef(({className:t,...e},n)=>P.jsx(u7,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));aRe.displayName=u7.displayName;var lRe="VisuallyHidden",T_=_.forwardRef((t,e)=>P.jsx(De.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));T_.displayName=lRe;var h7=T_,kv="NavigationMenu",[YI,p7,cRe]=qc(kv),[oN,uRe,dRe]=qc(kv),[XI,aUe]=Pn(kv,[cRe,dRe]),[fRe,Uo]=XI(kv),[hRe,pRe]=XI(kv),m7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,delayDuration:a=200,skipDelayDuration:o=300,orientation:c="horizontal",dir:u,...f}=t,[l,d]=_.useState(null),m=tt(e,T=>d(T)),p=ka(u),h=_.useRef(0),y=_.useRef(0),g=_.useRef(0),[v,w]=_.useState(!0),[x="",A]=sr({prop:r,onChange:T=>{const D=T!=="",O=o>0;D?(window.clearTimeout(g.current),O&&w(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>w(!0),o)),s==null||s(T)},defaultProp:i}),k=_.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>A(""),150)},[A]),R=_.useCallback(T=>{window.clearTimeout(y.current),A(T)},[A]),E=_.useCallback(T=>{x===T?window.clearTimeout(y.current):h.current=window.setTimeout(()=>{window.clearTimeout(y.current),A(T)},a)},[x,A,a]);return _.useEffect(()=>()=>{window.clearTimeout(h.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),P.jsx(v7,{scope:n,isRootMenu:!0,value:x,dir:p,orientation:c,rootNavigationMenu:l,onTriggerEnter:T=>{window.clearTimeout(h.current),v?E(T):R(T)},onTriggerLeave:()=>{window.clearTimeout(h.current),k()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:k,onItemSelect:T=>{A(D=>D===T?"":T)},onItemDismiss:()=>A(""),children:P.jsx(De.nav,{"aria-label":"Main","data-orientation":c,dir:p,...f,ref:m})})});m7.displayName=kv;var g7="NavigationMenuSub",mRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",...o}=t,c=Uo(g7,n),[u="",f]=sr({prop:r,onChange:s,defaultProp:i});return P.jsx(v7,{scope:n,isRootMenu:!1,value:u,dir:c.dir,orientation:a,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:l=>f(l),onItemSelect:l=>f(l),onItemDismiss:()=>f(""),children:P.jsx(De.div,{"data-orientation":a,...o,ref:e})})});mRe.displayName=g7;var v7=t=>{const{scope:e,isRootMenu:n,rootNavigationMenu:r,dir:s,orientation:i,children:a,value:o,onItemSelect:c,onItemDismiss:u,onTriggerEnter:f,onTriggerLeave:l,onContentEnter:d,onContentLeave:m}=t,[p,h]=_.useState(null),[y,g]=_.useState(new Map),[v,w]=_.useState(null);return P.jsx(fRe,{scope:e,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:Cv(o),baseId:Hr(),dir:s,orientation:i,viewport:p,onViewportChange:h,indicatorTrack:v,onIndicatorTrackChange:w,onTriggerEnter:Bt(f),onTriggerLeave:Bt(l),onContentEnter:Bt(d),onContentLeave:Bt(m),onItemSelect:Bt(c),onItemDismiss:Bt(u),onViewportContentChange:_.useCallback((x,A)=>{g(k=>(k.set(x,A),new Map(k)))},[]),onViewportContentRemove:_.useCallback(x=>{g(A=>A.has(x)?(A.delete(x),new Map(A)):A)},[]),children:P.jsx(YI.Provider,{scope:e,children:P.jsx(hRe,{scope:e,items:y,children:a})})})},y7="NavigationMenuList",b7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Uo(y7,n),i=P.jsx(De.ul,{"data-orientation":s.orientation,...r,ref:e});return P.jsx(De.div,{style:{position:"relative"},ref:s.onIndicatorTrackChange,children:P.jsx(YI.Slot,{scope:n,children:s.isRootMenu?P.jsx(R7,{asChild:!0,children:i}):i})})});b7.displayName=y7;var w7="NavigationMenuItem",[gRe,_7]=XI(w7),vRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,...s}=t,i=Hr(),a=r||i||"LEGACY_REACT_AUTO_VALUE",o=_.useRef(null),c=_.useRef(null),u=_.useRef(null),f=_.useRef(()=>{}),l=_.useRef(!1),d=_.useCallback((p="start")=>{if(o.current){f.current();const h=lN(o.current);h.length&&JI(p==="start"?h:h.reverse())}},[]),m=_.useCallback(()=>{if(o.current){const p=lN(o.current);p.length&&(f.current=CRe(p))}},[]);return P.jsx(gRe,{scope:n,value:a,triggerRef:c,contentRef:o,focusProxyRef:u,wasEscapeCloseRef:l,onEntryKeyDown:d,onFocusProxyEnter:d,onRootContentClose:m,onContentFocusOutside:m,children:P.jsx(De.li,{...s,ref:e})})});vRe.displayName=w7;var aN="NavigationMenuTrigger",x7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,disabled:r,...s}=t,i=Uo(aN,t.__scopeNavigationMenu),a=_7(aN,t.__scopeNavigationMenu),o=_.useRef(null),c=tt(o,a.triggerRef,e),u=T7(i.baseId,a.value),f=k7(i.baseId,a.value),l=_.useRef(!1),d=_.useRef(!1),m=a.value===i.value;return P.jsxs(P.Fragment,{children:[P.jsx(YI.ItemSlot,{scope:n,value:a.value,children:P.jsx(P7,{asChild:!0,children:P.jsx(De.button,{id:u,disabled:r,"data-disabled":r?"":void 0,"data-state":e$(m),"aria-expanded":m,"aria-controls":f,...s,ref:c,onPointerEnter:me(t.onPointerEnter,()=>{d.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:me(t.onPointerMove,vC(()=>{r||d.current||a.wasEscapeCloseRef.current||l.current||(i.onTriggerEnter(a.value),l.current=!0)})),onPointerLeave:me(t.onPointerLeave,vC(()=>{r||(i.onTriggerLeave(),l.current=!1)})),onClick:me(t.onClick,()=>{i.onItemSelect(a.value),d.current=m}),onKeyDown:me(t.onKeyDown,p=>{const y={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];m&&p.key===y&&(a.onEntryKeyDown(),p.preventDefault())})})})}),m&&P.jsxs(P.Fragment,{children:[P.jsx(h7,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:p=>{const h=a.contentRef.current,y=p.relatedTarget,g=y===o.current,v=h==null?void 0:h.contains(y);(g||!v)&&a.onFocusProxyEnter(g?"start":"end")}}),i.viewport&&P.jsx("span",{"aria-owns":f})]})]})});x7.displayName=aN;var yRe="NavigationMenuLink",SB="navigationMenu.linkSelect",bRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,active:r,onSelect:s,...i}=t;return P.jsx(P7,{asChild:!0,children:P.jsx(De.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...i,ref:e,onClick:me(t.onClick,a=>{const o=a.target,c=new CustomEvent(SB,{bubbles:!0,cancelable:!0});if(o.addEventListener(SB,u=>s==null?void 0:s(u),{once:!0}),Hb(o,c),!c.defaultPrevented&&!a.metaKey){const u=new CustomEvent(VS,{bubbles:!0,cancelable:!0});Hb(o,u)}},{checkForDefaultPrevented:!1})})})});bRe.displayName=yRe;var QI="NavigationMenuIndicator",S7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Uo(QI,t.__scopeNavigationMenu),i=!!s.value;return s.indicatorTrack?e_.createPortal(P.jsx(Un,{present:n||i,children:P.jsx(wRe,{...r,ref:e})}),s.indicatorTrack):null});S7.displayName=QI;var wRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Uo(QI,n),i=p7(n),[a,o]=_.useState(null),[c,u]=_.useState(null),f=s.orientation==="horizontal",l=!!s.value;_.useEffect(()=>{var h;const p=(h=i().find(y=>y.value===s.value))==null?void 0:h.ref.current;p&&o(p)},[i,s.value]);const d=()=>{a&&u({size:f?a.offsetWidth:a.offsetHeight,offset:f?a.offsetLeft:a.offsetTop})};return cN(a,d),cN(s.indicatorTrack,d),c?P.jsx(De.div,{"aria-hidden":!0,"data-state":l?"visible":"hidden","data-orientation":s.orientation,...r,ref:e,style:{position:"absolute",...f?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...r.style}}):null}),av="NavigationMenuContent",E7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Uo(av,t.__scopeNavigationMenu),i=_7(av,t.__scopeNavigationMenu),a=tt(i.contentRef,e),o=i.value===s.value,c={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...r};return s.viewport?P.jsx(_Re,{forceMount:n,...c,ref:a}):P.jsx(Un,{present:n||o,children:P.jsx(C7,{"data-state":e$(o),...c,ref:a,onPointerEnter:me(t.onPointerEnter,s.onContentEnter),onPointerLeave:me(t.onPointerLeave,vC(s.onContentLeave)),style:{pointerEvents:!o&&s.isRootMenu?"none":void 0,...c.style}})})});E7.displayName=av;var _Re=_.forwardRef((t,e)=>{const n=Uo(av,t.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:s}=n;return Mn(()=>{r(t.value,{ref:e,...t})},[t,e,r]),Mn(()=>()=>s(t.value),[t.value,s]),null}),VS="navigationMenu.rootContentDismiss",C7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:s,focusProxyRef:i,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:c,...u}=t,f=Uo(av,n),l=_.useRef(null),d=tt(l,e),m=T7(f.baseId,r),p=k7(f.baseId,r),h=p7(n),y=_.useRef(null),{onItemDismiss:g}=f;_.useEffect(()=>{const w=l.current;if(f.isRootMenu&&w){const x=()=>{var A;g(),o(),w.contains(document.activeElement)&&((A=s.current)==null||A.focus())};return w.addEventListener(VS,x),()=>w.removeEventListener(VS,x)}},[f.isRootMenu,t.value,s,g,o]);const v=_.useMemo(()=>{const x=h().map(D=>D.value);f.dir==="rtl"&&x.reverse();const A=x.indexOf(f.value),k=x.indexOf(f.previousValue),R=r===f.value,E=k===x.indexOf(r);if(!R&&!E)return y.current;const T=(()=>{if(A!==k){if(R&&k!==-1)return A>k?"from-end":"from-start";if(E&&A!==-1)return A>k?"to-start":"to-end"}return null})();return y.current=T,T},[f.previousValue,f.value,f.dir,h,r]);return P.jsx(R7,{asChild:!0,children:P.jsx(Yc,{id:p,"aria-labelledby":m,"data-motion":v,"data-orientation":f.orientation,...u,ref:d,disableOutsidePointerEvents:!1,onDismiss:()=>{var x;const w=new Event(VS,{bubbles:!0,cancelable:!0});(x=l.current)==null||x.dispatchEvent(w)},onFocusOutside:me(t.onFocusOutside,w=>{var A;c();const x=w.target;(A=f.rootNavigationMenu)!=null&&A.contains(x)&&w.preventDefault()}),onPointerDownOutside:me(t.onPointerDownOutside,w=>{var R;const x=w.target,A=h().some(E=>{var T;return(T=E.ref.current)==null?void 0:T.contains(x)}),k=f.isRootMenu&&((R=f.viewport)==null?void 0:R.contains(x));(A||k||!f.isRootMenu)&&w.preventDefault()}),onKeyDown:me(t.onKeyDown,w=>{var k;const x=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!x){const R=lN(w.currentTarget),E=document.activeElement,T=R.findIndex(L=>L===E),O=w.shiftKey?R.slice(0,T).reverse():R.slice(T+1,R.length);JI(O)?w.preventDefault():(k=i.current)==null||k.focus()}}),onEscapeKeyDown:me(t.onEscapeKeyDown,w=>{a.current=!0})})})}),ZI="NavigationMenuViewport",A7=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,i=!!Uo(ZI,t.__scopeNavigationMenu).value;return P.jsx(Un,{present:n||i,children:P.jsx(xRe,{...r,ref:e})})});A7.displayName=ZI;var xRe=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,children:r,...s}=t,i=Uo(ZI,n),a=tt(e,i.onViewportChange),o=pRe(av,t.__scopeNavigationMenu),[c,u]=_.useState(null),[f,l]=_.useState(null),d=c?(c==null?void 0:c.width)+"px":void 0,m=c?(c==null?void 0:c.height)+"px":void 0,p=!!i.value,h=p?i.value:i.previousValue;return cN(f,()=>{f&&u({width:f.offsetWidth,height:f.offsetHeight})}),P.jsx(De.div,{"data-state":e$(p),"data-orientation":i.orientation,...s,ref:a,style:{pointerEvents:!p&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":d,"--radix-navigation-menu-viewport-height":m,...s.style},onPointerEnter:me(t.onPointerEnter,i.onContentEnter),onPointerLeave:me(t.onPointerLeave,vC(i.onContentLeave)),children:Array.from(o.items).map(([g,{ref:v,forceMount:w,...x}])=>{const A=h===g;return P.jsx(Un,{present:w||A,children:P.jsx(C7,{...x,ref:t_(v,k=>{A&&k&&l(k)})})},g)})})}),SRe="FocusGroup",R7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=Uo(SRe,n);return P.jsx(oN.Provider,{scope:n,children:P.jsx(oN.Slot,{scope:n,children:P.jsx(De.div,{dir:s.dir,...r,ref:e})})})}),EB=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],ERe="FocusGroupItem",P7=_.forwardRef((t,e)=>{const{__scopeNavigationMenu:n,...r}=t,s=uRe(n),i=Uo(ERe,n);return P.jsx(oN.ItemSlot,{scope:n,children:P.jsx(De.button,{...r,ref:e,onKeyDown:me(t.onKeyDown,a=>{if(["Home","End",...EB].includes(a.key)){let c=s().map(l=>l.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&c.reverse(),EB.includes(a.key)){const l=c.indexOf(a.currentTarget);c=c.slice(l+1)}setTimeout(()=>JI(c)),a.preventDefault()}})})})});function lN(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function JI(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}function CRe(t){return t.forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}),()=>{t.forEach(e=>{const n=e.dataset.tabindex;e.setAttribute("tabindex",n)})}}function cN(t,e){const n=Bt(e);Mn(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}function e$(t){return t?"open":"closed"}function T7(t,e){return`${t}-trigger-${e}`}function k7(t,e){return`${t}-content-${e}`}function vC(t){return e=>e.pointerType==="mouse"?t(e):void 0}var D7=m7,N7=b7,O7=x7,M7=S7,L7=E7,I7=A7;const ARe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(D7,{ref:r,className:ce("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...n,children:[e,P.jsx($7,{})]}));ARe.displayName=D7.displayName;const RRe=_.forwardRef(({className:t,...e},n)=>P.jsx(N7,{ref:n,className:ce("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));RRe.displayName=N7.displayName;const PRe=zo("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),TRe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(O7,{ref:r,className:ce(PRe(),"group",t),...n,children:[e," ",P.jsx(L1,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));TRe.displayName=O7.displayName;const kRe=_.forwardRef(({className:t,...e},n)=>P.jsx(L7,{ref:n,className:ce("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...e}));kRe.displayName=L7.displayName;const $7=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:ce("absolute left-0 top-full flex justify-center"),children:P.jsx(I7,{className:ce("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:n,...e})}));$7.displayName=I7.displayName;const DRe=_.forwardRef(({className:t,...e},n)=>P.jsx(M7,{ref:n,className:ce("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...e,children:P.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));DRe.displayName=M7.displayName;var NRe=typeof window>"u",uN=NRe?se.useEffect:se.useLayoutEffect,ORe=0,CB=()=>++ORe,AB=!1;function MRe(){let[t,e]=se.useState(AB?CB:void 0);return uN(()=>{t===void 0&&e(CB()),AB=!0},[]),t===void 0?t:`rwb-${t.toString(32)}`}function LRe(){return se.useMemo(()=>"useId"in se?se.useId:MRe,[])()}var dN="__wrap_b",pb="__wrap_n",RB="__wrap_o",F7=(t,e,n)=>{n=n||document.querySelector(`[data-br="${t}"]`);let r=n==null?void 0:n.parentElement;if(!r)return;let s=f=>n.style.maxWidth=f+"px";n.style.maxWidth="";let i=r.clientWidth,a=r.clientHeight,o=i/2-.25,c=i+.5,u;if(i){for(s(o),o=Math.max(n.scrollWidth,o);o+1{self.__wrap_b(0,+n.dataset.brr,n)})).observe(r)},IRe=F7.toString(),$Re='(self.CSS&&CSS.supports("text-wrap","balance")?1:2)',FRe=(t,e,n="")=>(n&&(n=`self.${pb}!=1&&${n}`),se.createElement("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:(t?"":`self.${pb}=self.${pb}||${$Re};self.${dN}=${IRe};`)+n},nonce:e})),jRe=se.createContext({preferNative:!0,hasProvider:!1});se.forwardRef(({ratio:t=1,preferNative:e,nonce:n,children:r,as:s,...i},a)=>{let o=LRe(),c=se.useRef(),u=se.useContext(jRe),f=e??u.preferNative,l=s||"span";return se.useImperativeHandle(a,()=>c.current,[]),uN(()=>{f&&self[pb]===1||c.current&&(self[dN]=F7)(0,t,c.current)},[r,f,t]),uN(()=>{if(!(f&&self[pb]===1))return()=>{if(!c.current)return;let d=c.current[RB];d&&(d.disconnect(),delete c.current[RB])}},[f]),se.createElement(se.Fragment,null,se.createElement(l,{...i,"data-br":o,"data-brr":t,ref:c,style:{display:"inline-block",verticalAlign:"top",textDecoration:"inherit",textWrap:f?"balance":"initial"},suppressHydrationWarning:!0},r),FRe(u.hasProvider,n,`self.${dN}("${o}",${t})`))});var zRe="Separator",PB="horizontal",BRe=["horizontal","vertical"],j7=_.forwardRef((t,e)=>{const{decorative:n,orientation:r=PB,...s}=t,i=URe(r)?r:PB,o=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return P.jsx(De.div,{"data-orientation":i,...o,...s,ref:e})});j7.displayName=zRe;function URe(t){return BRe.includes(t)}var z7=j7;const HRe=_.forwardRef(({className:t,orientation:e="horizontal",decorative:n=!0,...r},s)=>P.jsx(z7,{ref:s,decorative:n,orientation:e,className:ce("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));HRe.displayName=z7.displayName;const VRe=_.forwardRef(({className:t,...e},n)=>P.jsx("ul",{ref:n,className:ce("flex flex-row items-center gap-1",t),...e}));VRe.displayName="PaginationContent";const WRe=_.forwardRef(({className:t,...e},n)=>P.jsx("li",{ref:n,className:ce("",t),...e}));WRe.displayName="PaginationItem";var t$="Popover",[B7,lUe]=Pn(t$,[El]),k_=El(),[GRe,$d]=B7(t$),U7=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:a=!1}=t,o=k_(e),c=_.useRef(null),[u,f]=_.useState(!1),[l=!1,d]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(aA,{...o,children:P.jsx(GRe,{scope:e,contentId:Hr(),triggerRef:c,open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(m=>!m),[d]),hasCustomAnchor:u,onCustomAnchorAdd:_.useCallback(()=>f(!0),[]),onCustomAnchorRemove:_.useCallback(()=>f(!1),[]),modal:a,children:n})})};U7.displayName=t$;var H7="PopoverAnchor",qRe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$d(H7,n),i=k_(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:o}=s;return _.useEffect(()=>(a(),()=>o()),[a,o]),P.jsx(Pv,{...i,...r,ref:e})});qRe.displayName=H7;var V7="PopoverTrigger",W7=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$d(V7,n),i=k_(n),a=tt(e,s.triggerRef),o=P.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":X7(s.open),...r,ref:a,onClick:me(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?o:P.jsx(Pv,{asChild:!0,...i,children:o})});W7.displayName=V7;var n$="PopoverPortal",[KRe,YRe]=B7(n$,{forceMount:void 0}),G7=t=>{const{__scopePopover:e,forceMount:n,children:r,container:s}=t,i=$d(n$,e);return P.jsx(KRe,{scope:e,forceMount:n,children:P.jsx(Un,{present:n||i.open,children:P.jsx(wv,{asChild:!0,container:s,children:r})})})};G7.displayName=n$;var lv="PopoverContent",q7=_.forwardRef((t,e)=>{const n=YRe(lv,t.__scopePopover),{forceMount:r=n.forceMount,...s}=t,i=$d(lv,t.__scopePopover);return P.jsx(Un,{present:r||i.open,children:i.modal?P.jsx(XRe,{...s,ref:e}):P.jsx(QRe,{...s,ref:e})})});q7.displayName=lv;var XRe=_.forwardRef((t,e)=>{const n=$d(lv,t.__scopePopover),r=_.useRef(null),s=tt(e,r),i=_.useRef(!1);return _.useEffect(()=>{const a=r.current;if(a)return _v(a)},[]),P.jsx(i_,{as:Ea,allowPinchZoom:!0,children:P.jsx(K7,{...t,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(t.onCloseAutoFocus,a=>{var o;a.preventDefault(),i.current||(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:me(t.onPointerDownOutside,a=>{const o=a.detail.originalEvent,c=o.button===0&&o.ctrlKey===!0,u=o.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:me(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),QRe=_.forwardRef((t,e)=>{const n=$d(lv,t.__scopePopover),r=_.useRef(!1),s=_.useRef(!1);return P.jsx(K7,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,o;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),K7=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:f,...l}=t,d=$d(lv,n),m=k_(n);return $1(),P.jsx(s_,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:f,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>d.onOpenChange(!1),children:P.jsx(b_,{"data-state":X7(d.open),role:"dialog",id:d.contentId,...m,...l,ref:e,style:{...l.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Y7="PopoverClose",ZRe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=$d(Y7,n);return P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,()=>s.onOpenChange(!1))})});ZRe.displayName=Y7;var JRe="PopoverArrow",ePe=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,s=k_(n);return P.jsx(w_,{...s,...r,ref:e})});ePe.displayName=JRe;function X7(t){return t?"open":"closed"}var tPe=U7,nPe=W7,rPe=G7,Q7=q7;const sPe=tPe,iPe=nPe,Z7=_.forwardRef(({className:t,align:e="center",sideOffset:n=4,...r},s)=>P.jsx(rPe,{children:P.jsx(Q7,{ref:s,align:e,sideOffset:n,className:ce("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Z7.displayName=Q7.displayName;var r$="Progress",s$=100,[oPe,cUe]=Pn(r$),[aPe,lPe]=oPe(r$),J7=_.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=cPe,...a}=t;(s||s===0)&&!TB(s)&&console.error(uPe(`${s}`,"Progress"));const o=TB(s)?s:s$;r!==null&&!kB(r,o)&&console.error(dPe(`${r}`,"Progress"));const c=kB(r,o)?r:null,u=yC(c)?i(c,o):void 0;return P.jsx(aPe,{scope:n,value:c,max:o,children:P.jsx(De.div,{"aria-valuemax":o,"aria-valuemin":0,"aria-valuenow":yC(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":n9(c,o),"data-value":c??void 0,"data-max":o,...a,ref:e})})});J7.displayName=r$;var e9="ProgressIndicator",t9=_.forwardRef((t,e)=>{const{__scopeProgress:n,...r}=t,s=lPe(e9,n);return P.jsx(De.div,{"data-state":n9(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:e})});t9.displayName=e9;function cPe(t,e){return`${Math.round(t/e*100)}%`}function n9(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function yC(t){return typeof t=="number"}function TB(t){return yC(t)&&!isNaN(t)&&t>0}function kB(t,e){return yC(t)&&!isNaN(t)&&t<=e&&t>=0}function uPe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${s$}\`.`}function dPe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - a positive number - - less than the value passed to \`max\` (or ${n$} if no \`max\` prop is set) + - less than the value passed to \`max\` (or ${s$} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. -Defaulting to \`null\`.`}var J7=Y7,lPe=Q7;const cPe=_.forwardRef(({className:t,value:e,...n},r)=>P.jsx(J7,{ref:r,className:ce("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:P.jsx(lPe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));cPe.displayName=J7.displayName;var r$="Radio",[uPe,e9]=Pn(r$),[dPe,fPe]=uPe(r$),t9=_.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:a,value:o="on",onCheck:c,...u}=t,[f,l]=_.useState(null),d=tt(e,h=>l(h)),m=_.useRef(!1),p=f?!!f.closest("form"):!0;return P.jsxs(dPe,{scope:n,checked:s,disabled:a,children:[P.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":s9(s),"data-disabled":a?"":void 0,disabled:a,value:o,...u,ref:d,onClick:me(t.onClick,h=>{s||c==null||c(),p&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),p&&P.jsx(hPe,{control:f,bubbles:!m.current,name:r,value:o,checked:s,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});t9.displayName=r$;var n9="RadioIndicator",r9=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=fPe(n9,n);return P.jsx(Un,{present:r||i.checked,children:P.jsx(De.span,{"data-state":s9(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});r9.displayName=n9;var hPe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Cv(n),o=m_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function s9(t){return t?"checked":"unchecked"}var pPe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],s$="RadioGroup",[mPe,rUe]=Pn(s$,[El,e9]),i9=El(),o9=e9(),[gPe,vPe]=mPe(s$),a9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:f=!0,onValueChange:l,...d}=t,m=i9(n),p=Ta(u),[h,y]=sr({prop:i,defaultProp:s,onChange:l});return P.jsx(gPe,{scope:n,name:r,required:a,disabled:o,value:h,onValueChange:y,children:P.jsx(w_,{asChild:!0,...m,orientation:c,dir:p,loop:f,children:P.jsx(De.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...d,ref:e})})})});a9.displayName=s$;var l9="RadioGroupItem",c9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=vPe(l9,n),a=i.disabled||r,o=i9(n),c=o9(n),u=_.useRef(null),f=tt(e,u),l=i.value===s.value,d=_.useRef(!1);return _.useEffect(()=>{const m=h=>{pPe.includes(h.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",p)}},[]),P.jsx(__,{asChild:!0,...o,focusable:!a,active:l,children:P.jsx(t9,{disabled:a,required:i.required,checked:l,...c,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:me(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:me(s.onFocus,()=>{var m;d.current&&((m=u.current)==null||m.click())})})})});c9.displayName=l9;var yPe="RadioGroupIndicator",u9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=o9(n);return P.jsx(r9,{...s,...r,ref:e})});u9.displayName=yPe;var d9=a9,f9=c9,bPe=u9;const wPe=_.forwardRef(({className:t,...e},n)=>P.jsx(d9,{className:ce("grid gap-2",t),...e,ref:n}));wPe.displayName=d9.displayName;const _Pe=_.forwardRef(({className:t,...e},n)=>P.jsx(f9,{ref:n,className:ce("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:P.jsx(bPe,{className:"flex items-center justify-center",children:P.jsx(L1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));_Pe.displayName=f9.displayName;const{createElement:cv,createContext:xPe,forwardRef:h9,useCallback:oi,useContext:p9,useEffect:Nh,useImperativeHandle:m9,useLayoutEffect:SPe,useMemo:EPe,useRef:hi,useState:Fm}=Kw,PB=Kw[`useId${Math.random()}`.slice(0,5)],CPe=SPe,gA=xPe(null);gA.displayName="PanelGroupContext";const Oh=CPe,APe=typeof PB=="function"?PB:()=>null;let RPe=0;function i$(t=null){const e=APe(),n=hi(t||e||null);return n.current===null&&(n.current=""+RPe++),t??n.current}function g9({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:a,maxSize:o,minSize:c,onCollapse:u,onExpand:f,onResize:l,order:d,style:m,tagName:p="div",...h}){const y=p9(gA);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:v,getPanelSize:w,getPanelStyle:x,groupId:A,isPanelCollapsed:k,reevaluatePanelConstraints:R,registerPanel:E,resizePanel:T,unregisterPanel:D}=y,O=i$(a),L=hi({callbacks:{onCollapse:u,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:o,minSize:c},id:O,idIsFromProps:a!==void 0,order:d});hi({didLogMissingDefaultSizeWarning:!1}),Oh(()=>{const{callbacks:F,constraints:U}=L.current,Y={...U};L.current.id=O,L.current.idIsFromProps=a!==void 0,L.current.order=d,F.onCollapse=u,F.onExpand=f,F.onResize=l,U.collapsedSize=n,U.collapsible=r,U.defaultSize=s,U.maxSize=o,U.minSize=c,(Y.collapsedSize!==U.collapsedSize||Y.collapsible!==U.collapsible||Y.maxSize!==U.maxSize||Y.minSize!==U.minSize)&&R(L.current,Y)}),Oh(()=>{const F=L.current;return E(F),()=>{D(F)}},[d,O,E,D]),m9(i,()=>({collapse:()=>{g(L.current)},expand:F=>{v(L.current,F)},getId(){return O},getSize(){return w(L.current)},isCollapsed(){return k(L.current)},isExpanded(){return!k(L.current)},resize:F=>{T(L.current,F)}}),[g,v,w,k,O,T]);const I=x(L.current,s);return cv(p,{...h,children:t,className:e,id:a,style:{...I,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":A,"data-panel-id":O,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}const PPe=h9((t,e)=>cv(g9,{...t,forwardedRef:e}));g9.displayName="Panel";PPe.displayName="forwardRef(Panel)";let dN=null,Sf=null;function TPe(t,e){if(e){const n=(e&_9)!==0,r=(e&x9)!==0,s=(e&S9)!==0,i=(e&E9)!==0;if(n)return s?"se-resize":i?"ne-resize":"e-resize";if(r)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function kPe(){Sf!==null&&(document.head.removeChild(Sf),dN=null,Sf=null)}function zT(t,e){const n=TPe(t,e);dN!==n&&(dN=n,Sf===null&&(Sf=document.createElement("style"),document.head.appendChild(Sf)),Sf.innerHTML=`*{cursor: ${n}!important;}`)}function v9(t){return t.type==="keydown"}function y9(t){return t.type.startsWith("pointer")}function b9(t){return t.type.startsWith("mouse")}function vA(t){if(y9(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(b9(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function DPe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function NPe(t,e,n){return t.xe.x&&t.ye.y}function OPe(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:DB(t),b:DB(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Pt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:kB(TB(n.a)),b:kB(TB(n.b))};if(s.a===s.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=i.length;for(;o--;){const c=i[o];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(s.a-s.b)}const MPe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function LPe(t){var e;const n=getComputedStyle((e=w9(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function IPe(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||LPe(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||MPe.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function TB(t){let e=t.length;for(;e--;){const n=t[e];if(Pt(n,"Missing node"),IPe(n))return n}return null}function kB(t){return t&&Number(getComputedStyle(t).zIndex)||0}function DB(t){const e=[];for(;t;)e.push(t),t=w9(t);return e}function w9(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const _9=1,x9=2,S9=4,E9=8,$Pe=DPe()==="coarse";let wa=[],Qb=!1,ku=new Map,yA=new Map;const Zb=new Set;function FPe(t,e,n,r,s){var i;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(i=ku.get(a))!==null&&i!==void 0?i:0;return ku.set(a,c+1),Zb.add(o),yC(),function(){var f;yA.delete(t),Zb.delete(o);const l=(f=ku.get(a))!==null&&f!==void 0?f:1;if(ku.set(a,l-1),yC(),l===1&&ku.delete(a),wa.includes(o)){const d=wa.indexOf(o);d>=0&&wa.splice(d,1),a$()}}}function NB(t){const{target:e}=t,{x:n,y:r}=vA(t);Qb=!0,o$({target:e,x:n,y:r}),yC(),wa.length>0&&(bC("down",t),t.preventDefault(),t.stopPropagation())}function xy(t){const{x:e,y:n}=vA(t);if(t.buttons===0&&(Qb=!1,bC("up",t)),!Qb){const{target:r}=t;o$({target:r,x:e,y:n})}bC("move",t),a$(),wa.length>0&&t.preventDefault()}function Up(t){const{target:e}=t,{x:n,y:r}=vA(t);yA.clear(),Qb=!1,wa.length>0&&t.preventDefault(),bC("up",t),o$({target:e,x:n,y:r}),a$(),yC()}function o$({target:t,x:e,y:n}){wa.splice(0);let r=null;t instanceof HTMLElement&&(r=t),Zb.forEach(s=>{const{element:i,hitAreaMargins:a}=s,o=i.getBoundingClientRect(),{bottom:c,left:u,right:f,top:l}=o,d=$Pe?a.coarse:a.fine;if(e>=u-d&&e<=f+d&&n>=l-d&&n<=c+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&OPe(r,i)>0){let p=r,h=!1;for(;p&&!p.contains(i);){if(NPe(p.getBoundingClientRect(),o)){h=!0;break}p=p.parentElement}if(h)return}wa.push(s)}})}function BT(t,e){yA.set(t,e)}function a$(){let t=!1,e=!1;wa.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;yA.forEach(r=>{n|=r}),t&&e?zT("intersection",n):t?zT("horizontal",n):e?zT("vertical",n):kPe()}function yC(){ku.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Up),n.removeEventListener("pointerdown",NB),n.removeEventListener("pointerleave",xy),n.removeEventListener("pointermove",xy)}),window.removeEventListener("pointerup",Up),window.removeEventListener("pointercancel",Up),Zb.size>0&&(Qb?(wa.length>0&&ku.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Up),n.addEventListener("pointerleave",xy),n.addEventListener("pointermove",xy))}),window.addEventListener("pointerup",Up),window.addEventListener("pointercancel",Up)):ku.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",NB,{capture:!0}),n.addEventListener("pointermove",xy))}))}function bC(t,e){Zb.forEach(n=>{const{setResizeHandlerState:r}=n,s=wa.includes(n);r(t,s,e)})}function jPe(){const[t,e]=Fm(0);return oi(()=>e(n=>n+1),[])}function Pt(t,e){if(!t)throw console.error(e),Error(e)}const l$=10;function Xh(t,e,n=l$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Ac(t,e,n=l$){return Xh(t,e,n)===0}function Yi(t,e,n){return Xh(t,e,n)===0}function zPe(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r0&&(t=t<0?0-g:g)}}}{const l=t<0?o:c,d=n[l];Pt(d,`No panel constraints found for index ${l}`);const{collapsedSize:m=0,collapsible:p,minSize:h=0}=d;if(p){const y=e[l];if(Pt(y!=null,`Previous layout not found for panel index ${l}`),Yi(y,h)){const g=y-m;Xh(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const l=t<0?1:-1;let d=t<0?c:o,m=0;for(;;){const h=e[d];Pt(h!=null,`Previous layout not found for panel index ${d}`);const g=wm({panelConstraints:n,panelIndex:d,size:100})-h;if(m+=g,d+=l,d<0||d>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(m));t=t<0?0-p:p}{let d=t<0?o:c;for(;d>=0&&d=0))break;t<0?d--:d++}}if(zPe(s,a))return s;{const l=t<0?c:o,d=e[l];Pt(d!=null,`Previous layout not found for panel index ${l}`);const m=d+u,p=wm({panelConstraints:n,panelIndex:l,size:m});if(a[l]=p,!Yi(p,m)){let h=m-p,g=t<0?c:o;for(;g>=0&&g0?g--:g++}}}const f=a.reduce((l,d)=>d+l,0);return Yi(f,100)?a:s}function BPe({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,a=0;const o=n[0];Pt(o!=null,"No pivot index found"),e.forEach((l,d)=>{const{constraints:m}=l,{maxSize:p=100,minSize:h=0}=m;d===o?(r=h,s=p):(i+=h,a+=p)});const c=Math.min(s,100-i),u=Math.max(r,100-a),f=t[o];return{valueMax:c,valueMin:u,valueNow:f}}function Jb(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function C9(t,e,n=document){const s=Jb(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function A9(t,e,n){const r=C9(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function R9(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function bA(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function UPe(t,e,n,r=document){var s,i,a,o;const c=bA(e,r),u=Jb(t,r),f=c?u.indexOf(c):-1,l=(s=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,d=(a=(o=n[f+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[l,d]}function HPe({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:a}){hi({didWarnAboutMissingResizeHandle:!1}),Oh(()=>{if(!i)return;const o=Jb(n,i);for(let c=0;c{o.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Nh(()=>{if(!i)return;const o=e.current;Pt(o,"Eager values not found");const{panelDataArray:c}=o,u=R9(n,i);Pt(u!=null,`No group found for id "${n}"`);const f=Jb(n,i);Pt(f,`No resize handles found for group id "${n}"`);const l=f.map(d=>{const m=d.getAttribute("data-panel-resize-handle-id");Pt(m,"Resize handle element has no handle id attribute");const[p,h]=UPe(n,m,c,i);if(p==null||h==null)return()=>{};const y=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const v=c.findIndex(w=>w.id===p);if(v>=0){const w=c[v];Pt(w,`No panel data found for index ${v}`);const x=r[v],{collapsedSize:A=0,collapsible:k,minSize:R=0}=w.constraints;if(x!=null&&k){const E=Fy({delta:Yi(x,A)?R-A:A-x,initialLayout:r,panelConstraints:c.map(T=>T.constraints),pivotIndices:A9(n,m,i),prevLayout:r,trigger:"keyboard"});r!==E&&a(E)}}break}}};return d.addEventListener("keydown",y),()=>{d.removeEventListener("keydown",y)}});return()=>{l.forEach(d=>d())}},[i,t,e,n,r,s,a])}function OB(t,e){if(t.length!==e.length)return!1;for(let n=0;ni.constraints);let r=0,s=100;for(let i=0;i{const i=t[s];Pt(i,`Panel data not found for index ${s}`);const{callbacks:a,constraints:o,id:c}=i,{collapsedSize:u=0,collapsible:f}=o,l=n[c];if(l==null||r!==l){n[c]=r;const{onCollapse:d,onExpand:m,onResize:p}=a;p&&p(r,l),f&&(d||m)&&(m&&(l==null||Ac(l,u))&&!Ac(r,u)&&m(),d&&(l==null||!Ac(l,u))&&Ac(r,u)&&d())}})}function hS(t,e){if(t.length!==e.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function MB(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function T9(t){return`react-resizable-panels:${t}`}function k9(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=e;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function D9(t,e){try{const n=T9(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function YPe(t,e,n){var r,s;const i=(r=D9(t,n))!==null&&r!==void 0?r:{},a=k9(e);return(s=i[a])!==null&&s!==void 0?s:null}function XPe(t,e,n,r,s){var i;const a=T9(t),o=k9(e),c=(i=D9(t,s))!==null&&i!==void 0?i:{};c[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(c))}catch(u){console.error(u)}}function LB({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,a)=>i+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Yi(r,100))for(let i=0;i(MB(jy),jy.getItem(t)),setItem:(t,e)=>{MB(jy),jy.setItem(t,e)}},IB={};function N9({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=jy,style:u,tagName:f="div",...l}){const d=i$(i),m=hi(null),[p,h]=Fm(null),[y,g]=Fm([]),v=jPe(),w=hi({}),x=hi(new Map),A=hi(0),k=hi({autoSaveId:t,direction:r,dragState:p,id:d,keyboardResizeBy:o,onLayout:a,storage:c}),R=hi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});hi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),m9(s,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:K}=R.current;return K},setLayout:K=>{const{onLayout:Z}=k.current,{layout:ue,panelDataArray:de}=R.current,ie=LB({layout:K,panelConstraints:de.map(be=>be.constraints)});OB(ue,ie)||(g(ie),R.current.layout=ie,Z&&Z(ie),Hp(de,ie,w.current))}}),[]),Oh(()=>{k.current.autoSaveId=t,k.current.direction=r,k.current.dragState=p,k.current.id=d,k.current.onLayout=a,k.current.storage=c}),HPe({committedValuesRef:k,eagerValuesRef:R,groupId:d,layout:y,panelDataArray:R.current.panelDataArray,setLayout:g,panelGroupElement:m.current}),Nh(()=>{const{panelDataArray:K}=R.current;if(t){if(y.length===0||y.length!==K.length)return;let Z=IB[t];Z==null&&(Z=KPe(XPe,QPe),IB[t]=Z);const ue=[...K],de=new Map(x.current);Z(t,ue,de,y,c)}},[t,y,c]),Nh(()=>{});const E=oi(K=>{const{onLayout:Z}=k.current,{layout:ue,panelDataArray:de}=R.current;if(K.constraints.collapsible){const ie=de.map(Me=>Me.constraints),{collapsedSize:be=0,panelSize:Ae,pivotIndices:_e}=sf(de,K,ue);if(Pt(Ae!=null,`Panel size not found for panel "${K.id}"`),!Ac(Ae,be)){x.current.set(K.id,Ae);const Ne=Jp(de,K)===de.length-1?Ae-be:be-Ae,ye=Fy({delta:Ne,initialLayout:ue,panelConstraints:ie,pivotIndices:_e,prevLayout:ue,trigger:"imperative-api"});hS(ue,ye)||(g(ye),R.current.layout=ye,Z&&Z(ye),Hp(de,ye,w.current))}}},[]),T=oi((K,Z)=>{const{onLayout:ue}=k.current,{layout:de,panelDataArray:ie}=R.current;if(K.constraints.collapsible){const be=ie.map($e=>$e.constraints),{collapsedSize:Ae=0,panelSize:_e=0,minSize:Me=0,pivotIndices:Ne}=sf(ie,K,de),ye=Z??Me;if(Ac(_e,Ae)){const $e=x.current.get(K.id),ut=$e!=null&&$e>=ye?$e:ye,vt=Jp(ie,K)===ie.length-1?_e-ut:ut-_e,Sn=Fy({delta:vt,initialLayout:de,panelConstraints:be,pivotIndices:Ne,prevLayout:de,trigger:"imperative-api"});hS(de,Sn)||(g(Sn),R.current.layout=Sn,ue&&ue(Sn),Hp(ie,Sn,w.current))}}},[]),D=oi(K=>{const{layout:Z,panelDataArray:ue}=R.current,{panelSize:de}=sf(ue,K,Z);return Pt(de!=null,`Panel size not found for panel "${K.id}"`),de},[]),O=oi((K,Z)=>{const{panelDataArray:ue}=R.current,de=Jp(ue,K);return qPe({defaultSize:Z,dragState:p,layout:y,panelData:ue,panelIndex:de})},[p,y]),L=oi(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=sf(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),ie===!0&&Ac(be,de)},[]),I=oi(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=sf(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),!ie||Xh(be,de)>0},[]),F=oi(K=>{const{panelDataArray:Z}=R.current;Z.push(K),Z.sort((ue,de)=>{const ie=ue.order,be=de.order;return ie==null&&be==null?0:ie==null?-1:be==null?1:ie-be}),R.current.panelDataArrayChanged=!0,v()},[v]);Oh(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:Z,storage:ue}=k.current,{layout:de,panelDataArray:ie}=R.current;let be=null;if(K){const _e=YPe(K,ie,ue);_e&&(x.current=new Map(Object.entries(_e.expandToSizes)),be=_e.layout)}be==null&&(be=GPe({panelDataArray:ie}));const Ae=LB({layout:be,panelConstraints:ie.map(_e=>_e.constraints)});OB(de,Ae)||(g(Ae),R.current.layout=Ae,Z&&Z(Ae),Hp(ie,Ae,w.current))}}),Oh(()=>{const K=R.current;return()=>{K.layout=[]}},[]);const U=oi(K=>function(ue){ue.preventDefault();const de=m.current;if(!de)return()=>null;const{direction:ie,dragState:be,id:Ae,keyboardResizeBy:_e,onLayout:Me}=k.current,{layout:Ne,panelDataArray:ye}=R.current,{initialLayout:$e}=be??{},ut=A9(Ae,K,de);let Qe=WPe(ue,K,ie,be,_e,de);const vt=ie==="horizontal";document.dir==="rtl"&&vt&&(Qe=-Qe);const Sn=ye.map(Xt=>Xt.constraints),Yt=Fy({delta:Qe,initialLayout:$e??Ne,panelConstraints:Sn,pivotIndices:ut,prevLayout:Ne,trigger:v9(ue)?"keyboard":"mouse-or-touch"}),mn=!hS(Ne,Yt);(y9(ue)||b9(ue))&&A.current!=Qe&&(A.current=Qe,mn?BT(K,0):vt?BT(K,Qe<0?_9:x9):BT(K,Qe<0?S9:E9)),mn&&(g(Yt),R.current.layout=Yt,Me&&Me(Yt),Hp(ye,Yt,w.current))},[]),Y=oi((K,Z)=>{const{onLayout:ue}=k.current,{layout:de,panelDataArray:ie}=R.current,be=ie.map($e=>$e.constraints),{panelSize:Ae,pivotIndices:_e}=sf(ie,K,de);Pt(Ae!=null,`Panel size not found for panel "${K.id}"`);const Ne=Jp(ie,K)===ie.length-1?Ae-Z:Z-Ae,ye=Fy({delta:Ne,initialLayout:de,panelConstraints:be,pivotIndices:_e,prevLayout:de,trigger:"imperative-api"});hS(de,ye)||(g(ye),R.current.layout=ye,ue&&ue(ye),Hp(ie,ye,w.current))},[]),V=oi((K,Z)=>{const{layout:ue,panelDataArray:de}=R.current,{collapsedSize:ie=0,collapsible:be}=Z,{collapsedSize:Ae=0,collapsible:_e,maxSize:Me=100,minSize:Ne=0}=K.constraints,{panelSize:ye}=sf(de,K,ue);ye!=null&&(be&&_e&&Ac(ye,ie)?Ac(ie,Ae)||Y(K,Ae):yeMe&&Y(K,Me))},[Y]),H=oi((K,Z)=>{const{direction:ue}=k.current,{layout:de}=R.current;if(!m.current)return;const ie=bA(K,m.current);Pt(ie,`Drag handle element not found for id "${K}"`);const be=P9(ue,Z);h({dragHandleId:K,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:be,initialLayout:de})},[]),ee=oi(()=>{h(null)},[]),re=oi(K=>{const{panelDataArray:Z}=R.current,ue=Jp(Z,K);ue>=0&&(Z.splice(ue,1),delete w.current[K.id],R.current.panelDataArrayChanged=!0,v())},[v]),X=EPe(()=>({collapsePanel:E,direction:r,dragState:p,expandPanel:T,getPanelSize:D,getPanelStyle:O,groupId:d,isPanelCollapsed:L,isPanelExpanded:I,reevaluatePanelConstraints:V,registerPanel:F,registerResizeHandle:U,resizePanel:Y,startDragging:H,stopDragging:ee,unregisterPanel:re,panelGroupElement:m.current}),[E,p,r,T,D,O,d,L,I,V,F,U,Y,H,ee,re]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return cv(gA.Provider,{value:X},cv(f,{...l,children:e,className:n,id:i,ref:m,style:{...q,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const ZPe=h9((t,e)=>cv(N9,{...t,forwardedRef:e}));N9.displayName="PanelGroup";ZPe.displayName="forwardRef(PanelGroup)";function Jp(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function sf(t,e,n){const r=Jp(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:i}}function JPe({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Nh(()=>{if(t||n==null||r==null)return;const s=bA(e,r);if(s==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=s.getAttribute("data-panel-group-id");Pt(o,`No group element found for id "${o}"`);const c=Jb(o,r),u=C9(o,e,r);Pt(u!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?u>0?u-1:c.length-1:u+1{s.removeEventListener("keydown",i)}},[r,t,e,n])}function eTe({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:a,onFocus:o,style:c={},tabIndex:u=0,tagName:f="div",...l}){var d,m;const p=hi(null),h=hi({onDragging:a});Nh(()=>{h.current.onDragging=a});const y=p9(gA);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,groupId:v,registerResizeHandle:w,startDragging:x,stopDragging:A,panelGroupElement:k}=y,R=i$(s),[E,T]=Fm("inactive"),[D,O]=Fm(!1),[L,I]=Fm(null),F=hi({state:E});Oh(()=>{F.current.state=E}),Nh(()=>{if(n)I(null);else{const H=w(R);I(()=>H)}},[n,R,w]);const U=(d=r==null?void 0:r.coarse)!==null&&d!==void 0?d:15,Y=(m=r==null?void 0:r.fine)!==null&&m!==void 0?m:5;return Nh(()=>{if(n||L==null)return;const H=p.current;return Pt(H,"Element ref not attached"),FPe(R,H,g,{coarse:U,fine:Y},(re,X,q)=>{if(X)switch(re){case"down":{T("drag"),x(R,q);const{onDragging:K}=h.current;K&&K(!0);break}case"move":{const{state:K}=F.current;K!=="drag"&&T("hover"),L(q);break}case"up":{T("hover"),A();const{onDragging:K}=h.current;K&&K(!1);break}}else T("inactive")})},[U,g,n,Y,w,R,L,x,A]),JPe({disabled:n,handleId:R,resizeHandler:L,panelGroupElement:k}),cv(f,{...l,children:t,className:e,id:s,onBlur:()=>{O(!1),i==null||i()},onFocus:()=>{O(!0),o==null||o()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:u,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":D?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}eTe.displayName="PanelResizeHandle";function e0(t,[e,n]){return Math.min(n,Math.max(e,t))}function tTe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var c$="ScrollArea",[O9,sUe]=Pn(c$),[nTe,Uo]=O9(c$),M9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[o,c]=_.useState(null),[u,f]=_.useState(null),[l,d]=_.useState(null),[m,p]=_.useState(null),[h,y]=_.useState(null),[g,v]=_.useState(0),[w,x]=_.useState(0),[A,k]=_.useState(!1),[R,E]=_.useState(!1),T=tt(e,O=>c(O)),D=Ta(s);return P.jsx(nTe,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:o,viewport:u,onViewportChange:f,content:l,onContentChange:d,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:R,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:x,children:P.jsx(De.div,{dir:D,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});M9.displayName=c$;var L9="ScrollAreaViewport",I9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Uo(L9,n),o=_.useRef(null),c=tt(e,o,a.onViewportChange);return P.jsxs(P.Fragment,{children:[P.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),P.jsx(De.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:P.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});I9.displayName=L9;var Al="ScrollAreaScrollbar",u$=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Uo(Al,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,o=t.orientation==="horizontal";return _.useEffect(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),s.type==="hover"?P.jsx(rTe,{...r,ref:e,forceMount:n}):s.type==="scroll"?P.jsx(sTe,{...r,ref:e,forceMount:n}):s.type==="auto"?P.jsx($9,{...r,ref:e,forceMount:n}):s.type==="always"?P.jsx(d$,{...r,ref:e}):null});u$.displayName=Al;var rTe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Uo(Al,t.__scopeScrollArea),[i,a]=_.useState(!1);return _.useEffect(()=>{const o=s.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),P.jsx(Un,{present:n||i,children:P.jsx($9,{"data-state":i?"visible":"hidden",...r,ref:e})})}),sTe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Uo(Al,t.__scopeScrollArea),i=t.orientation==="horizontal",a=_A(()=>c("SCROLL_END"),100),[o,c]=tTe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,s.scrollHideDelay,c]),_.useEffect(()=>{const u=s.viewport,f=i?"scrollLeft":"scrollTop";if(u){let l=u[f];const d=()=>{const m=u[f];l!==m&&(c("SCROLL"),a()),l=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,i,c,a]),P.jsx(Un,{present:n||o!=="hidden",children:P.jsx(d$,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:me(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:me(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),$9=_.forwardRef((t,e)=>{const n=Uo(Al,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=_.useState(!1),o=t.orientation==="horizontal",c=_A(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Uo(Al,t.__scopeScrollArea),i=_.useRef(null),a=_.useRef(0),[o,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=U9(o.viewport,o.content),f={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>i.current=d,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:d=>a.current=d};function l(d,m){return uTe(d,a.current,o,m)}return n==="horizontal"?P.jsx(iTe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollLeft,m=$B(d,o,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=l(d,s.dir))}}):n==="vertical"?P.jsx(oTe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollTop,m=$B(d,o);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=l(d))}}):null}),iTe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Uo(Al,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarXChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(j9,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":wA(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollLeft+f.deltaX;t.onWheelScroll(d),V9(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:_C(a.paddingLeft),paddingEnd:_C(a.paddingRight)}})}})}),oTe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Uo(Al,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarYChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(j9,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":wA(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollTop+f.deltaY;t.onWheelScroll(d),V9(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:_C(a.paddingTop),paddingEnd:_C(a.paddingBottom)}})}})}),[aTe,F9]=O9(Al),j9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:l,...d}=t,m=Uo(Al,n),[p,h]=_.useState(null),y=tt(e,T=>h(T)),g=_.useRef(null),v=_.useRef(""),w=m.viewport,x=r.content-r.viewport,A=Bt(f),k=Bt(c),R=_A(l,10);function E(T){if(g.current){const D=T.clientX-g.current.left,O=T.clientY-g.current.top;u({x:D,y:O})}}return _.useEffect(()=>{const T=D=>{const O=D.target;(p==null?void 0:p.contains(O))&&A(D,x)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,p,x,A]),_.useEffect(k,[r,k]),uv(p,R),uv(m.content,R),P.jsx(aTe,{scope:n,scrollbar:p,hasThumb:s,onThumbChange:Bt(i),onThumbPointerUp:Bt(a),onThumbPositionChange:k,onThumbPointerDown:Bt(o),children:P.jsx(De.div,{...d,ref:y,style:{position:"absolute",...d.style},onPointerDown:me(t.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),g.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(T))}),onPointerMove:me(t.onPointerMove,E),onPointerUp:me(t.onPointerUp,T=>{const D=T.target;D.hasPointerCapture(T.pointerId)&&D.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),wC="ScrollAreaThumb",z9=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=F9(wC,t.__scopeScrollArea);return P.jsx(Un,{present:n||s.hasThumb,children:P.jsx(lTe,{ref:e,...r})})}),lTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Uo(wC,n),a=F9(wC,n),{onThumbPositionChange:o}=a,c=tt(e,l=>a.onThumbChange(l)),u=_.useRef(),f=_A(()=>{u.current&&(u.current(),u.current=void 0)},100);return _.useEffect(()=>{const l=i.viewport;if(l){const d=()=>{if(f(),!u.current){const m=dTe(l,o);u.current=m,o()}};return o(),l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,f,o]),P.jsx(De.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:me(t.onPointerDownCapture,l=>{const m=l.target.getBoundingClientRect(),p=l.clientX-m.left,h=l.clientY-m.top;a.onThumbPointerDown({x:p,y:h})}),onPointerUp:me(t.onPointerUp,a.onThumbPointerUp)})});z9.displayName=wC;var f$="ScrollAreaCorner",B9=_.forwardRef((t,e)=>{const n=Uo(f$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?P.jsx(cTe,{...t,ref:e}):null});B9.displayName=f$;var cTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Uo(f$,n),[i,a]=_.useState(0),[o,c]=_.useState(0),u=!!(i&&o);return uv(s.scrollbarX,()=>{var l;const f=((l=s.scrollbarX)==null?void 0:l.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),uv(s.scrollbarY,()=>{var l;const f=((l=s.scrollbarY)==null?void 0:l.offsetWidth)||0;s.onCornerWidthChange(f),a(f)}),u?P.jsx(De.div,{...r,ref:e,style:{width:i,height:o,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function _C(t){return t?parseInt(t,10):0}function U9(t,e){const n=t/e;return isNaN(n)?0:n}function wA(t){const e=U9(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function uTe(t,e,n,r="ltr"){const s=wA(n),i=s/2,a=e||i,o=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,f=n.content-n.viewport,l=r==="ltr"?[0,f]:[f*-1,0];return H9([c,u],l)(t)}function $B(t,e,n="ltr"){const r=wA(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,o=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=e0(t,c);return H9([0,a],[0,o])(u)}function H9(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function V9(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function s(){const i={left:t.scrollLeft,top:t.scrollTop},a=n.left!==i.left,o=n.top!==i.top;(a||o)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function _A(t,e){const n=Bt(t),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function uv(t,e){const n=Bt(e);Mn(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var W9=M9,fTe=I9,hTe=B9;const pTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(W9,{ref:r,className:ce("relative overflow-hidden",t),...n,children:[P.jsx(fTe,{className:"h-full w-full rounded-[inherit]",children:e}),P.jsx(G9,{}),P.jsx(hTe,{})]}));pTe.displayName=W9.displayName;const G9=_.forwardRef(({className:t,orientation:e="vertical",...n},r)=>P.jsx(u$,{ref:r,orientation:e,className:ce("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:P.jsx(z9,{className:"relative flex-1 rounded-full bg-border"})}));G9.displayName=u$.displayName;var mTe=[" ","Enter","ArrowUp","ArrowDown"],gTe=[" ","Enter"],k_="Select",[xA,SA,vTe]=qc(k_),[Dv,iUe]=Pn(k_,[vTe,Sl]),EA=Sl(),[yTe,Fd]=Dv(k_),[bTe,wTe]=Dv(k_),q9=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:o,onValueChange:c,dir:u,name:f,autoComplete:l,disabled:d,required:m}=t,p=EA(e),[h,y]=_.useState(null),[g,v]=_.useState(null),[w,x]=_.useState(!1),A=Ta(u),[k=!1,R]=sr({prop:r,defaultProp:s,onChange:i}),[E,T]=sr({prop:a,defaultProp:o,onChange:c}),D=_.useRef(null),O=h?!!h.closest("form"):!0,[L,I]=_.useState(new Set),F=Array.from(L).map(U=>U.props.value).join(";");return P.jsx(oA,{...p,children:P.jsxs(yTe,{required:m,scope:e,trigger:h,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:Hr(),value:E,onValueChange:T,open:k,onOpenChange:R,dir:A,triggerPointerDownPosRef:D,disabled:d,children:[P.jsx(xA.Provider,{scope:e,children:P.jsx(bTe,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(U=>{I(Y=>new Set(Y).add(U))},[]),onNativeOptionRemove:_.useCallback(U=>{I(Y=>{const V=new Set(Y);return V.delete(U),V})},[]),children:n})}),O?P.jsxs(yY,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:U=>T(U.target.value),disabled:d,children:[E===void 0?P.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};q9.displayName=k_;var K9="SelectTrigger",Y9=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=EA(n),a=Fd(K9,n),o=a.disabled||r,c=tt(e,a.onTriggerChange),u=SA(n),[f,l,d]=bY(p=>{const h=u().filter(v=>!v.disabled),y=h.find(v=>v.value===a.value),g=wY(h,p,y);g!==void 0&&a.onValueChange(g.value)}),m=()=>{o||(a.onOpenChange(!0),d())};return P.jsx(Pv,{asChild:!0,...i,children:P.jsx(De.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":vY(a.value)?"":void 0,...s,ref:c,onClick:me(s.onClick,p=>{p.currentTarget.focus()}),onPointerDown:me(s.onPointerDown,p=>{const h=p.target;h.hasPointerCapture(p.pointerId)&&h.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(m(),a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:me(s.onKeyDown,p=>{const h=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&l(p.key),!(h&&p.key===" ")&&mTe.includes(p.key)&&(m(),p.preventDefault())})})})});Y9.displayName=K9;var X9="SelectValue",Q9=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=t,c=Fd(X9,n),{onValueNodeHasChildrenChange:u}=c,f=i!==void 0,l=tt(e,c.onValueNodeChange);return Mn(()=>{u(f)},[u,f]),P.jsx(De.span,{...o,ref:l,style:{pointerEvents:"none"},children:vY(c.value)?P.jsx(P.Fragment,{children:a}):i})});Q9.displayName=X9;var _Te="SelectIcon",Z9=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return P.jsx(De.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});Z9.displayName=_Te;var xTe="SelectPortal",J9=t=>P.jsx(wv,{asChild:!0,...t});J9.displayName=xTe;var Qh="SelectContent",eY=_.forwardRef((t,e)=>{const n=Fd(Qh,t.__scopeSelect),[r,s]=_.useState();if(Mn(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?ks.createPortal(P.jsx(tY,{scope:t.__scopeSelect,children:P.jsx(xA.Slot,{scope:t.__scopeSelect,children:P.jsx("div",{children:t.children})})}),i):null}return P.jsx(nY,{...t,ref:e})});eY.displayName=Qh;var ql=10,[tY,jd]=Dv(Qh),STe="SelectContentImpl",nY=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y,...g}=t,v=Fd(Qh,n),[w,x]=_.useState(null),[A,k]=_.useState(null),R=tt(e,ie=>x(ie)),[E,T]=_.useState(null),[D,O]=_.useState(null),L=SA(n),[I,F]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(w)return _v(w)},[w]),I1();const Y=_.useCallback(ie=>{const[be,...Ae]=L().map(Ne=>Ne.ref.current),[_e]=Ae.slice(-1),Me=document.activeElement;for(const Ne of ie)if(Ne===Me||(Ne==null||Ne.scrollIntoView({block:"nearest"}),Ne===be&&A&&(A.scrollTop=0),Ne===_e&&A&&(A.scrollTop=A.scrollHeight),Ne==null||Ne.focus(),document.activeElement!==Me))return},[L,A]),V=_.useCallback(()=>Y([E,w]),[Y,E,w]);_.useEffect(()=>{I&&V()},[I,V]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=v;_.useEffect(()=>{if(w){let ie={x:0,y:0};const be=_e=>{var Me,Ne;ie={x:Math.abs(Math.round(_e.pageX)-(((Me=ee.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((Ne=ee.current)==null?void 0:Ne.y)??0))}},Ae=_e=>{ie.x<=10&&ie.y<=10?_e.preventDefault():w.contains(_e.target)||H(!1),document.removeEventListener("pointermove",be),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,H,ee]),_.useEffect(()=>{const ie=()=>H(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[H]);const[re,X]=bY(ie=>{const be=L().filter(Me=>!Me.disabled),Ae=be.find(Me=>Me.ref.current===document.activeElement),_e=wY(be,ie,Ae);_e&&setTimeout(()=>_e.ref.current.focus())}),q=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&(T(ie),_e&&(U.current=!0))},[v.value]),K=_.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&O(ie)},[v.value]),ue=r==="popper"?fN:rY,de=ue===fN?{side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y}:{};return P.jsx(tY,{scope:n,content:w,viewport:A,onViewportChange:k,itemRefCallback:q,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:D,position:r,isPositioned:I,searchRef:re,children:P.jsx(s_,{as:Sa,allowPinchZoom:!0,children:P.jsx(r_,{asChild:!0,trapped:v.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:me(s,ie=>{var be;(be=v.trigger)==null||be.focus({preventScroll:!0}),ie.preventDefault()}),children:P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:P.jsx(ue,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ie=>ie.preventDefault(),...g,...de,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:me(g.onKeyDown,ie=>{const be=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!be&&ie.key.length===1&&X(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let _e=L().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Me=ie.target,Ne=_e.indexOf(Me);_e=_e.slice(Ne+1)}setTimeout(()=>Y(_e)),ie.preventDefault()}})})})})})})});nY.displayName=STe;var ETe="SelectItemAlignedPosition",rY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Fd(Qh,n),a=jd(Qh,n),[o,c]=_.useState(null),[u,f]=_.useState(null),l=tt(e,R=>f(R)),d=SA(n),m=_.useRef(!1),p=_.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=a,w=_.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&h&&y&&g){const R=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(i.dir!=="rtl"){const Me=D.left-E.left,Ne=T.left-Me,ye=R.left-Ne,$e=R.width+ye,ut=Math.max($e,E.width),Qe=window.innerWidth-ql,vt=e0(Ne,[ql,Qe-ut]);o.style.minWidth=$e+"px",o.style.left=vt+"px"}else{const Me=E.right-D.right,Ne=window.innerWidth-T.right-Me,ye=window.innerWidth-R.right-Ne,$e=R.width+ye,ut=Math.max($e,E.width),Qe=window.innerWidth-ql,vt=e0(Ne,[ql,Qe-ut]);o.style.minWidth=$e+"px",o.style.right=vt+"px"}const O=d(),L=window.innerHeight-ql*2,I=h.scrollHeight,F=window.getComputedStyle(u),U=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),V=parseInt(F.borderBottomWidth,10),H=parseInt(F.paddingBottom,10),ee=U+Y+I+H+V,re=Math.min(y.offsetHeight*5,ee),X=window.getComputedStyle(h),q=parseInt(X.paddingTop,10),K=parseInt(X.paddingBottom,10),Z=R.top+R.height/2-ql,ue=L-Z,de=y.offsetHeight/2,ie=y.offsetTop+de,be=U+Y+ie,Ae=ee-be;if(be<=Z){const Me=y===O[O.length-1].ref.current;o.style.bottom="0px";const Ne=u.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(ue,de+(Me?K:0)+Ne+V),$e=be+ye;o.style.height=$e+"px"}else{const Me=y===O[0].ref.current;o.style.top="0px";const ye=Math.max(Z,U+h.offsetTop+(Me?q:0)+de)+Ae;o.style.height=ye+"px",h.scrollTop=be-Z+h.offsetTop}o.style.margin=`${ql}px 0`,o.style.minHeight=re+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[d,i.trigger,i.valueNode,o,u,h,y,g,i.dir,r]);Mn(()=>w(),[w]);const[x,A]=_.useState();Mn(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const k=_.useCallback(R=>{R&&p.current===!0&&(w(),v==null||v(),p.current=!1)},[w,v]);return P.jsx(ATe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:P.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:P.jsx(De.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});rY.displayName=ETe;var CTe="SelectPopperPosition",fN=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ql,...i}=t,a=EA(n);return P.jsx(y_,{...a,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fN.displayName=CTe;var[ATe,h$]=Dv(Qh,{}),hN="SelectViewport",sY=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=jd(hN,n),a=h$(hN,n),o=tt(e,i.onViewportChange),c=_.useRef(0);return P.jsxs(P.Fragment,{children:[P.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),P.jsx(xA.Slot,{scope:n,children:P.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:me(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:l,shouldExpandOnScrollRef:d}=a;if(d!=null&&d.current&&l){const m=Math.abs(c.current-f.scrollTop);if(m>0){const p=window.innerHeight-ql*2,h=parseFloat(l.style.minHeight),y=parseFloat(l.style.height),g=Math.max(h,y);if(g0?x:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});sY.displayName=hN;var iY="SelectGroup",[RTe,PTe]=Dv(iY),TTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Hr();return P.jsx(RTe,{scope:n,id:s,children:P.jsx(De.div,{role:"group","aria-labelledby":s,...r,ref:e})})});TTe.displayName=iY;var oY="SelectLabel",aY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=PTe(oY,n);return P.jsx(De.div,{id:s.id,...r,ref:e})});aY.displayName=oY;var xC="SelectItem",[kTe,lY]=Dv(xC),cY=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=t,o=Fd(xC,n),c=jd(xC,n),u=o.value===r,[f,l]=_.useState(i??""),[d,m]=_.useState(!1),p=tt(e,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),h=Hr(),y=()=>{s||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return P.jsx(kTe,{scope:n,value:r,disabled:s,textId:h,isSelected:u,onItemTextChange:_.useCallback(g=>{l(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:P.jsx(xA.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:P.jsx(De.div,{role:"option","aria-labelledby":h,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:p,onFocus:me(a.onFocus,()=>m(!0)),onBlur:me(a.onBlur,()=>m(!1)),onPointerUp:me(a.onPointerUp,y),onPointerMove:me(a.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(a.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:me(a.onKeyDown,g=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&g.key===" "||(gTe.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});cY.displayName=xC;var zy="SelectItemText",uY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,a=Fd(zy,n),o=jd(zy,n),c=lY(zy,n),u=wTe(zy,n),[f,l]=_.useState(null),d=tt(e,g=>l(g),c.onItemTextChange,g=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,g,c.value,c.disabled)}),m=f==null?void 0:f.textContent,p=_.useMemo(()=>P.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=u;return Mn(()=>(h(p),()=>y(p)),[h,y,p]),P.jsxs(P.Fragment,{children:[P.jsx(De.span,{id:c.textId,...i,ref:d}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ks.createPortal(i.children,a.valueNode):null]})});uY.displayName=zy;var dY="SelectItemIndicator",fY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return lY(dY,n).isSelected?P.jsx(De.span,{"aria-hidden":!0,...r,ref:e}):null});fY.displayName=dY;var pN="SelectScrollUpButton",hY=_.forwardRef((t,e)=>{const n=jd(pN,t.__scopeSelect),r=h$(pN,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return Mn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(mY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});hY.displayName=pN;var mN="SelectScrollDownButton",pY=_.forwardRef((t,e)=>{const n=jd(mN,t.__scopeSelect),r=h$(mN,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return Mn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(mY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});pY.displayName=mN;var mY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=jd("SelectScrollButton",n),a=_.useRef(null),o=SA(n),c=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),Mn(()=>{var f;const u=o().find(l=>l.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),P.jsx(De.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:me(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:me(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:me(s.onPointerLeave,()=>{c()})})}),DTe="SelectSeparator",gY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return P.jsx(De.div,{"aria-hidden":!0,...r,ref:e})});gY.displayName=DTe;var gN="SelectArrow",NTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=EA(n),i=Fd(gN,n),a=jd(gN,n);return i.open&&a.position==="popper"?P.jsx(b_,{...s,...r,ref:e}):null});NTe.displayName=gN;function vY(t){return t===""||t===void 0}var yY=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=_.useRef(null),i=tt(e,s),a=Cv(n);return _.useEffect(()=>{const o=s.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==n&&f){const l=new Event("change",{bubbles:!0});f.call(o,n),o.dispatchEvent(l)}},[a,n]),P.jsx(P_,{asChild:!0,children:P.jsx("select",{...r,ref:i,defaultValue:n})})});yY.displayName="BubbleSelect";function bY(t){const e=Bt(t),n=_.useRef(""),r=_.useRef(0),s=_.useCallback(a=>{const o=n.current+a;e(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[e]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function wY(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=OTe(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function OTe(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var MTe=q9,_Y=Y9,LTe=Q9,ITe=Z9,$Te=J9,xY=eY,FTe=sY,SY=aY,EY=cY,jTe=uY,zTe=fY,CY=hY,AY=pY,RY=gY;const oUe=MTe,aUe=LTe,BTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(_Y,{ref:r,className:ce("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,P.jsx(ITe,{asChild:!0,children:P.jsx(M1,{className:"h-4 w-4 opacity-50"})})]}));BTe.displayName=_Y.displayName;const PY=_.forwardRef(({className:t,...e},n)=>P.jsx(CY,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(wfe,{className:"h-4 w-4"})}));PY.displayName=CY.displayName;const TY=_.forwardRef(({className:t,...e},n)=>P.jsx(AY,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(M1,{className:"h-4 w-4"})}));TY.displayName=AY.displayName;const UTe=_.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>P.jsx($Te,{children:P.jsxs(xY,{ref:s,className:ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[P.jsx(PY,{}),P.jsx(FTe,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),P.jsx(TY,{})]})}));UTe.displayName=xY.displayName;const HTe=_.forwardRef(({className:t,...e},n)=>P.jsx(SY,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));HTe.displayName=SY.displayName;const VTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(EY,{ref:r,className:ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(zTe,{children:P.jsx(t_,{className:"h-4 w-4"})})}),P.jsx(jTe,{children:e})]}));VTe.displayName=EY.displayName;const WTe=_.forwardRef(({className:t,...e},n)=>P.jsx(RY,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));WTe.displayName=RY.displayName;const GTe=SL,qTe=EL,KTe=CL,kY=_.forwardRef(({className:t,...e},n)=>P.jsx(i_,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));kY.displayName=i_.displayName;const YTe=jo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),DY=_.forwardRef(({side:t="right",className:e,children:n,...r},s)=>P.jsxs(KTe,{children:[P.jsx(kY,{}),P.jsxs(o_,{ref:s,className:ce(YTe({side:t}),e),...r,children:[n,P.jsxs(c_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[P.jsx(fL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));DY.displayName=o_.displayName;const XTe=_.forwardRef(({className:t,...e},n)=>P.jsx(a_,{ref:n,className:ce("text-lg font-semibold text-foreground",t),...e}));XTe.displayName=a_.displayName;const QTe=_.forwardRef(({className:t,...e},n)=>P.jsx(l_,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));QTe.displayName=l_.displayName;var NY=["PageUp","PageDown"],OY=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],MY={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Nv="Slider",[vN,ZTe,JTe]=qc(Nv),[LY,lUe]=Pn(Nv,[JTe]),[eke,CA]=LY(Nv),IY=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:f,onValueChange:l=()=>{},onValueCommit:d=()=>{},inverted:m=!1,...p}=t,h=_.useRef(new Set),y=_.useRef(0),v=a==="horizontal"?tke:nke,[w=[],x]=sr({prop:f,defaultProp:u,onChange:D=>{var L;(L=[...h.current][y.current])==null||L.focus(),l(D)}}),A=_.useRef(w);function k(D){const O=ake(w,D);T(D,O)}function R(D){T(D,y.current)}function E(){const D=A.current[y.current];w[y.current]!==D&&d(w)}function T(D,O,{commit:L}={commit:!1}){const I=dke(i),F=fke(Math.round((D-r)/i)*i+r,I),U=e0(F,[r,s]);x((Y=[])=>{const V=ike(Y,U,O);if(uke(V,c*i)){y.current=V.indexOf(U);const H=String(V)!==String(Y);return H&&L&&d(V),H?V:Y}else return Y})}return P.jsx(eke,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:s,valueIndexToChangeRef:y,thumbs:h.current,values:w,orientation:a,children:P.jsx(vN.Provider,{scope:t.__scopeSlider,children:P.jsx(vN.Slot,{scope:t.__scopeSlider,children:P.jsx(v,{"aria-disabled":o,"data-disabled":o?"":void 0,...p,ref:e,onPointerDown:me(p.onPointerDown,()=>{o||(A.current=w)}),min:r,max:s,inverted:m,onSlideStart:o?void 0:k,onSlideMove:o?void 0:R,onSlideEnd:o?void 0:E,onHomeKeyDown:()=>!o&&T(r,0,{commit:!0}),onEndKeyDown:()=>!o&&T(s,w.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:O})=>{if(!o){const F=NY.includes(D.key)||D.shiftKey&&OY.includes(D.key)?10:1,U=y.current,Y=w[U],V=i*F*O;T(Y+V,U,{commit:!0})}}})})})})});IY.displayName=Nv;var[$Y,FY]=LY(Nv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),tke=_.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(),h=Ta(s),y=h==="ltr",g=y&&!i||!y&&i;function v(w){const x=p.current||l.getBoundingClientRect(),A=[0,x.width],R=p$(A,g?[n,r]:[r,n]);return p.current=x,R(w-x.left)}return P.jsx($Y,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:P.jsx(jY,{dir:h,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const x=v(w.clientX);a==null||a(x)},onSlideMove:w=>{const x=v(w.clientX);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,c==null||c()},onStepKeyDown:w=>{const A=MY[g?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:A?-1:1})}})})}),nke=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onStepKeyDown:c,...u}=t,f=_.useRef(null),l=tt(e,f),d=_.useRef(),m=!s;function p(h){const y=d.current||f.current.getBoundingClientRect(),g=[0,y.height],w=p$(g,m?[r,n]:[n,r]);return d.current=y,w(h-y.top)}return P.jsx($Y,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:P.jsx(jY,{"data-orientation":"vertical",...u,ref:l,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const y=p(h.clientY);i==null||i(y)},onSlideMove:h=>{const y=p(h.clientY);a==null||a(y)},onSlideEnd:()=>{d.current=void 0,o==null||o()},onStepKeyDown:h=>{const g=MY[m?"from-bottom":"from-top"].includes(h.key);c==null||c({event:h,direction:g?-1:1})}})})}),jY=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...u}=t,f=CA(Nv,n);return P.jsx(De.span,{...u,ref:e,onKeyDown:me(t.onKeyDown,l=>{l.key==="Home"?(a(l),l.preventDefault()):l.key==="End"?(o(l),l.preventDefault()):NY.concat(OY).includes(l.key)&&(c(l),l.preventDefault())}),onPointerDown:me(t.onPointerDown,l=>{const d=l.target;d.setPointerCapture(l.pointerId),l.preventDefault(),f.thumbs.has(d)?d.focus():r(l)}),onPointerMove:me(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&s(l)}),onPointerUp:me(t.onPointerUp,l=>{const d=l.target;d.hasPointerCapture(l.pointerId)&&(d.releasePointerCapture(l.pointerId),i(l))})})}),zY="SliderTrack",BY=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=CA(zY,n);return P.jsx(De.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});BY.displayName=zY;var yN="SliderRange",UY=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=CA(yN,n),i=FY(yN,n),a=_.useRef(null),o=tt(e,a),c=s.values.length,u=s.values.map(d=>VY(d,s.min,s.max)),f=c>1?Math.min(...u):0,l=100-Math.max(...u);return P.jsx(De.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:o,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});UY.displayName=yN;var bN="SliderThumb",HY=_.forwardRef((t,e)=>{const n=ZTe(t.__scopeSlider),[r,s]=_.useState(null),i=tt(e,o=>s(o)),a=_.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return P.jsx(rke,{...t,ref:i,index:a})}),rke=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=CA(bN,n),o=FY(bN,n),[c,u]=_.useState(null),f=tt(e,v=>u(v)),l=c?!!c.closest("form"):!0,d=m_(c),m=a.values[r],p=m===void 0?0:VY(m,a.min,a.max),h=oke(r,a.values.length),y=d==null?void 0:d[o.size],g=y?lke(y,p,o.direction):0;return _.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),P.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${g}px)`},children:[P.jsx(vN.ItemSlot,{scope:t.__scopeSlider,children:P.jsx(De.span,{role:"slider","aria-label":t["aria-label"]||h,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:me(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),l&&P.jsx(ske,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),value:m},r)]})});HY.displayName=bN;var ske=t=>{const{value:e,...n}=t,r=_.useRef(null),s=Cv(e);return _.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&c){const u=new Event("input",{bubbles:!0});c.call(i,e),i.dispatchEvent(u)}},[s,e]),P.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function ike(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function VY(t,e,n){const i=100/(n-e)*(t-e);return e0(i,[0,100])}function oke(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function ake(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function lke(t,e,n){const r=t/2,i=p$([0,50],[0,r]);return(r-i(e)*n)*n}function cke(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function uke(t,e){if(e>0){const n=cke(t);return Math.min(...n)>=e}return!0}function p$(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function dke(t){return(String(t).split(".")[1]||"").length}function fke(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var WY=IY,hke=BY,pke=UY,mke=HY;const gke=_.forwardRef(({className:t,...e},n)=>P.jsxs(WY,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",t),...e,children:[P.jsx(hke,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:P.jsx(pke,{className:"absolute h-full bg-primary"})}),P.jsx(mke,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));gke.displayName=WY.displayName;var m$="Switch",[vke,cUe]=Pn(m$),[yke,bke]=vke(m$),GY=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,v=>d(v)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=sr({prop:s,defaultProp:i,onChange:u});return P.jsxs(yke,{scope:n,checked:y,disabled:o,children:[P.jsx(De.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":YY(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onClick:me(t.onClick,v=>{g(w=>!w),h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),h&&P.jsx(wke,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});GY.displayName=m$;var qY="SwitchThumb",KY=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=bke(qY,n);return P.jsx(De.span,{"data-state":YY(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});KY.displayName=qY;var wke=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Cv(n),o=m_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function YY(t){return t?"checked":"unchecked"}var XY=GY,_ke=KY;const xke=_.forwardRef(({className:t,...e},n)=>P.jsx(XY,{className:ce("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:P.jsx(_ke,{className:ce("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));xke.displayName=XY.displayName;const Ske=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:"relative w-full overflow-auto",children:P.jsx("table",{ref:n,className:ce("w-full caption-bottom text-sm",t),...e})}));Ske.displayName="Table";const Eke=_.forwardRef(({className:t,...e},n)=>P.jsx("thead",{ref:n,className:ce("[&_tr]:border-b",t),...e}));Eke.displayName="TableHeader";const Cke=_.forwardRef(({className:t,...e},n)=>P.jsx("tbody",{ref:n,className:ce("[&_tr:last-child]:border-0",t),...e}));Cke.displayName="TableBody";const Ake=_.forwardRef(({className:t,...e},n)=>P.jsx("tfoot",{ref:n,className:ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Ake.displayName="TableFooter";const Rke=_.forwardRef(({className:t,...e},n)=>P.jsx("tr",{ref:n,className:ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Rke.displayName="TableRow";const Pke=_.forwardRef(({className:t,...e},n)=>P.jsx("th",{ref:n,className:ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));Pke.displayName="TableHead";const Tke=_.forwardRef(({className:t,...e},n)=>P.jsx("td",{ref:n,className:ce("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Tke.displayName="TableCell";const kke=_.forwardRef(({className:t,...e},n)=>P.jsx("caption",{ref:n,className:ce("mt-4 text-sm text-muted-foreground",t),...e}));kke.displayName="TableCaption";var g$="Tabs",[Dke,uUe]=Pn(g$,[El]),QY=El(),[Nke,v$]=Dke(g$),ZY=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=t,f=Ta(o),[l,d]=sr({prop:r,onChange:s,defaultProp:i});return P.jsx(Nke,{scope:n,baseId:Hr(),value:l,onValueChange:d,orientation:a,dir:f,activationMode:c,children:P.jsx(De.div,{dir:f,"data-orientation":a,...u,ref:e})})});ZY.displayName=g$;var JY="TabsList",eX=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=v$(JY,n),a=QY(n);return P.jsx(w_,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:P.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});eX.displayName=JY;var tX="TabsTrigger",nX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=v$(tX,n),o=QY(n),c=iX(a.baseId,r),u=oX(a.baseId,r),f=r===a.value;return P.jsx(__,{asChild:!0,...o,focusable:!s,active:f,children:P.jsx(De.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:me(t.onMouseDown,l=>{!s&&l.button===0&&l.ctrlKey===!1?a.onValueChange(r):l.preventDefault()}),onKeyDown:me(t.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&a.onValueChange(r)}),onFocus:me(t.onFocus,()=>{const l=a.activationMode!=="manual";!f&&!s&&l&&a.onValueChange(r)})})})});nX.displayName=tX;var rX="TabsContent",sX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=v$(rX,n),c=iX(o.baseId,r),u=oX(o.baseId,r),f=r===o.value,l=_.useRef(f);return _.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),P.jsx(Un,{present:s||f,children:({present:d})=>P.jsx(De.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:u,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:l.current?"0s":void 0},children:d&&i})})});sX.displayName=rX;function iX(t,e){return`${t}-trigger-${e}`}function oX(t,e){return`${t}-content-${e}`}var Oke=ZY,aX=eX,lX=nX,cX=sX;const dUe=Oke,Mke=_.forwardRef(({className:t,...e},n)=>P.jsx(aX,{ref:n,className:ce("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));Mke.displayName=aX.displayName;const Lke=_.forwardRef(({className:t,...e},n)=>P.jsx(lX,{ref:n,className:ce("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...e}));Lke.displayName=lX.displayName;const Ike=_.forwardRef(({className:t,...e},n)=>P.jsx(cX,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Ike.displayName=cX.displayName;const uX=_.forwardRef(({className:t,...e},n)=>P.jsx("textarea",{className:ce("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));uX.displayName="Textarea";var y$="ToastProvider",[b$,$ke,Fke]=qc("Toast"),[dX,fUe]=Pn("Toast",[Fke]),[jke,AA]=dX(y$),fX=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[o,c]=_.useState(null),[u,f]=_.useState(0),l=_.useRef(!1),d=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${y$}\`. Expected non-empty \`string\`.`),P.jsx(b$.Provider,{scope:e,children:P.jsx(jke,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:_.useCallback(()=>f(m=>m+1),[]),onToastRemove:_.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:d,children:a})})};fX.displayName=y$;var hX="ToastViewport",zke=["F8"],wN="toast.viewportPause",_N="toast.viewportResume",pX=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=zke,label:s="Notifications ({hotkey})",...i}=t,a=AA(hX,n),o=$ke(n),c=_.useRef(null),u=_.useRef(null),f=_.useRef(null),l=_.useRef(null),d=tt(e,l,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;_.useEffect(()=>{const y=g=>{var w;r.every(x=>g[x]||g.code===x)&&((w=l.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),_.useEffect(()=>{const y=c.current,g=l.current;if(p&&y&&g){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(wN);g.dispatchEvent(k),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(_N);g.dispatchEvent(k),a.isClosePausedRef.current=!1}},x=k=>{!y.contains(k.relatedTarget)&&w()},A=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",v),y.addEventListener("focusout",x),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",A),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",x),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[p,a.isClosePausedRef]);const h=_.useCallback(({tabbingDirection:y})=>{const v=o().map(w=>{const x=w.ref.current,A=[x,...Jke(x)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?v.reverse():v).flat()},[o]);return _.useEffect(()=>{const y=l.current;if(y){const g=v=>{var A,k,R;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const E=document.activeElement,T=v.shiftKey;if(v.target===y&&T){(A=u.current)==null||A.focus();return}const L=h({tabbingDirection:T?"backwards":"forwards"}),I=L.findIndex(F=>F===E);UT(L.slice(I+1))?v.preventDefault():T?(k=u.current)==null||k.focus():(R=f.current)==null||R.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[o,h]),P.jsxs(She,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&P.jsx(xN,{ref:u,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});UT(y)}}),P.jsx(b$.Slot,{scope:n,children:P.jsx(De.ol,{tabIndex:-1,...i,ref:d})}),p&&P.jsx(xN,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});UT(y)}})]})});pX.displayName=hX;var mX="ToastFocusProxy",xN=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=AA(mX,n);return P.jsx(P_,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});xN.displayName=mX;var RA="Toast",Bke="toast.swipeStart",Uke="toast.swipeMove",Hke="toast.swipeCancel",Vke="toast.swipeEnd",gX=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o=!0,c]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(Un,{present:n||o,children:P.jsx(qke,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:Bt(t.onPause),onResume:Bt(t.onResume),onSwipeStart:me(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(t.onSwipeMove,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${l}px`)}),onSwipeCancel:me(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(t.onSwipeEnd,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${l}px`),c(!1)})})})});gX.displayName=RA;var[Wke,Gke]=dX(RA,{onClose(){}}),qke=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:l,onSwipeCancel:d,onSwipeEnd:m,...p}=t,h=AA(RA,n),[y,g]=_.useState(null),v=tt(e,F=>g(F)),w=_.useRef(null),x=_.useRef(null),A=s||h.duration,k=_.useRef(0),R=_.useRef(A),E=_.useRef(0),{onToastAdd:T,onToastRemove:D}=h,O=Bt(()=>{var U;(y==null?void 0:y.contains(document.activeElement))&&((U=h.viewport)==null||U.focus()),a()}),L=_.useCallback(F=>{!F||F===1/0||(window.clearTimeout(E.current),k.current=new Date().getTime(),E.current=window.setTimeout(O,F))},[O]);_.useEffect(()=>{const F=h.viewport;if(F){const U=()=>{L(R.current),u==null||u()},Y=()=>{const V=new Date().getTime()-k.current;R.current=R.current-V,window.clearTimeout(E.current),c==null||c()};return F.addEventListener(wN,Y),F.addEventListener(_N,U),()=>{F.removeEventListener(wN,Y),F.removeEventListener(_N,U)}}},[h.viewport,A,c,u,L]),_.useEffect(()=>{i&&!h.isClosePausedRef.current&&L(A)},[i,A,h.isClosePausedRef,L]),_.useEffect(()=>(T(),()=>D()),[T,D]);const I=_.useMemo(()=>y?SX(y):null,[y]);return h.viewport?P.jsxs(P.Fragment,{children:[I&&P.jsx(Kke,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),P.jsx(Wke,{scope:n,onClose:O,children:ks.createPortal(P.jsx(b$.ItemSlot,{scope:n,children:P.jsx(xhe,{asChild:!0,onEscapeKeyDown:me(o,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:P.jsx(De.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":h.swipeDirection,...p,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:me(t.onKeyDown,F=>{F.key==="Escape"&&(o==null||o(F.nativeEvent),F.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:me(t.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:me(t.onPointerMove,F=>{if(!w.current)return;const U=F.clientX-w.current.x,Y=F.clientY-w.current.y,V=!!x.current,H=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,re=H?ee(0,U):0,X=H?0:ee(0,Y),q=F.pointerType==="touch"?10:2,K={x:re,y:X},Z={originalEvent:F,delta:K};V?(x.current=K,pS(Uke,l,Z,{discrete:!1})):FB(K,h.swipeDirection,q)?(x.current=K,pS(Bke,f,Z,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(U)>q||Math.abs(Y)>q)&&(w.current=null)}),onPointerUp:me(t.onPointerUp,F=>{const U=x.current,Y=F.target;if(Y.hasPointerCapture(F.pointerId)&&Y.releasePointerCapture(F.pointerId),x.current=null,w.current=null,U){const V=F.currentTarget,H={originalEvent:F,delta:U};FB(U,h.swipeDirection,h.swipeThreshold)?pS(Vke,m,H,{discrete:!0}):pS(Hke,d,H,{discrete:!0}),V.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Kke=t=>{const{__scopeToast:e,children:n,...r}=t,s=AA(RA,e),[i,a]=_.useState(!1),[o,c]=_.useState(!1);return Qke(()=>a(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:P.jsx(wv,{asChild:!0,children:P.jsx(P_,{...r,children:i&&P.jsxs(P.Fragment,{children:[s.label," ",n]})})})},Yke="ToastTitle",vX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});vX.displayName=Yke;var Xke="ToastDescription",yX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});yX.displayName=Xke;var bX="ToastAction",wX=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?P.jsx(xX,{altText:n,asChild:!0,children:P.jsx(w$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${bX}\`. Expected non-empty \`string\`.`),null)});wX.displayName=bX;var _X="ToastClose",w$=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=Gke(_X,n);return P.jsx(xX,{asChild:!0,children:P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,s.onClose)})})});w$.displayName=_X;var xX=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return P.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function SX(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),Zke(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...SX(r))}}),e}function pS(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Hb(s,i):s.dispatchEvent(i)}var FB=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function Qke(t=()=>{}){const e=Bt(t);Mn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function Zke(t){return t.nodeType===t.ELEMENT_NODE}function Jke(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function UT(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var eDe=fX,EX=pX,CX=gX,AX=vX,RX=yX,PX=wX,TX=w$;const tDe=eDe,kX=_.forwardRef(({className:t,...e},n)=>P.jsx(EX,{ref:n,className:ce("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));kX.displayName=EX.displayName;const nDe=jo("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success bg-green-300 text-success-foreground border-green-400 group"},position:{center:"bottom-0 mx-auto w-auto sm:bottom-0"}},defaultVariants:{variant:"default"}}),DX=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx(CX,{ref:r,className:ce(nDe({variant:e}),t),...n}));DX.displayName=CX.displayName;const rDe=_.forwardRef(({className:t,...e},n)=>P.jsx(PX,{ref:n,className:ce("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));rDe.displayName=PX.displayName;const NX=_.forwardRef(({className:t,...e},n)=>P.jsx(TX,{ref:n,className:ce("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:P.jsx(fL,{className:"w-4 h-4"})}));NX.displayName=TX.displayName;const OX=_.forwardRef(({className:t,...e},n)=>P.jsx(AX,{ref:n,className:ce("text-sm font-semibold",t),...e}));OX.displayName=AX.displayName;const MX=_.forwardRef(({className:t,...e},n)=>P.jsx(RX,{ref:n,className:ce("text-sm opacity-90",t),...e}));MX.displayName=RX.displayName;const sDe=3,iDe=1e6;let HT=0;function oDe(){return HT=(HT+1)%Number.MAX_SAFE_INTEGER,HT.toString()}const VT=new Map,jB=t=>{if(VT.has(t))return;const e=setTimeout(()=>{VT.delete(t),mb({type:"REMOVE_TOAST",toastId:t})},iDe);VT.set(t,e)},aDe=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,sDe)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?jB(n):t.toasts.forEach(r=>{jB(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},VS=[];let WS={toasts:[]};function mb(t){WS=aDe(WS,t),VS.forEach(e=>{e(WS)})}function lDe({...t}){const e=oDe(),n=s=>mb({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>mb({type:"DISMISS_TOAST",toastId:e});return mb({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function LX(){const[t,e]=_.useState(WS);return _.useEffect(()=>(VS.push(e),()=>{const n=VS.indexOf(e);n>-1&&VS.splice(n,1)}),[t]),{...t,toast:lDe,dismiss:n=>mb({type:"DISMISS_TOAST",toastId:n})}}function IX(){const{toasts:t}=LX();return P.jsxs(tDe,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return P.jsxs(DX,{...i,children:[P.jsxs("div",{className:"grid gap-1",children:[n&&P.jsx(OX,{children:n}),r&&P.jsx(MX,{children:r})]}),s,P.jsx(NX,{})]},e)}),P.jsx(kX,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var cDe="Toggle",_$=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[a=!1,o]=sr({prop:n,onChange:s,defaultProp:r});return P.jsx(De.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:me(t.onClick,()=>{t.disabled||o(!a)})})});_$.displayName=cDe;var $X=_$;const FX=jo("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),uDe=_.forwardRef(({className:t,variant:e,size:n,...r},s)=>P.jsx($X,{ref:s,className:ce(FX({variant:e,size:n,className:t})),...r}));uDe.displayName=$X.displayName;var Ov="ToggleGroup",[jX,hUe]=Pn(Ov,[El]),zX=El(),x$=se.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return P.jsx(dDe,{...s,ref:e})}if(n==="multiple"){const s=r;return P.jsx(fDe,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Ov}\``)});x$.displayName=Ov;var[BX,UX]=jX(Ov),dDe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,o]=sr({prop:n,defaultProp:r,onChange:s});return P.jsx(BX,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:se.useCallback(()=>o(""),[o]),children:P.jsx(HX,{...i,ref:e})})}),fDe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=sr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(BX,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:P.jsx(HX,{...i,ref:e})})});x$.displayName=Ov;var[hDe,pDe]=jX(Ov),HX=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:o=!0,...c}=t,u=zX(n),f=Ta(a),l={role:"group",dir:f,...c};return P.jsx(hDe,{scope:n,rovingFocus:s,disabled:r,children:s?P.jsx(w_,{asChild:!0,...u,orientation:i,dir:f,loop:o,children:P.jsx(De.div,{...l,ref:e})}):P.jsx(De.div,{...l,ref:e})})}),SC="ToggleGroupItem",VX=se.forwardRef((t,e)=>{const n=UX(SC,t.__scopeToggleGroup),r=pDe(SC,t.__scopeToggleGroup),s=zX(t.__scopeToggleGroup),i=n.value.includes(t.value),a=r.disabled||t.disabled,o={...t,pressed:i,disabled:a},c=se.useRef(null);return r.rovingFocus?P.jsx(__,{asChild:!0,...s,focusable:!a,active:i,ref:c,children:P.jsx(zB,{...o,ref:e})}):P.jsx(zB,{...o,ref:e})});VX.displayName=SC;var zB=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=UX(SC,n),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?a:void 0;return P.jsx(_$,{...o,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),WX=x$,GX=VX;const qX=_.createContext({size:"default",variant:"default"}),mDe=_.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>P.jsx(WX,{ref:i,className:ce("flex items-center justify-center gap-1",t),...s,children:P.jsx(qX.Provider,{value:{variant:e,size:n},children:r})}));mDe.displayName=WX.displayName;const gDe=_.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const a=_.useContext(qX);return P.jsx(GX,{ref:i,className:ce(FX({variant:a.variant||n,size:a.size||r}),t),...s,children:e})});gDe.displayName=GX.displayName;var[PA,pUe]=Pn("Tooltip",[Sl]),TA=Sl(),KX="TooltipProvider",vDe=700,SN="tooltip.open",[yDe,S$]=PA(KX),YX=t=>{const{__scopeTooltip:e,delayDuration:n=vDe,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[a,o]=_.useState(!0),c=_.useRef(!1),u=_.useRef(0);return _.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),P.jsx(yDe,{scope:e,isOpenDelayed:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(u.current),o(!1)},[]),onClose:_.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};YX.displayName=KX;var kA="Tooltip",[bDe,DA]=PA(kA),XX=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:o}=t,c=S$(kA,t.__scopeTooltip),u=TA(e),[f,l]=_.useState(null),d=Hr(),m=_.useRef(0),p=a??c.disableHoverableContent,h=o??c.delayDuration,y=_.useRef(!1),[g=!1,v]=sr({prop:r,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(SN))):c.onClose(),i==null||i(R)}}),w=_.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),x=_.useCallback(()=>{window.clearTimeout(m.current),y.current=!1,v(!0)},[v]),A=_.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),k=_.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,v(!0)},h)},[h,v]);return _.useEffect(()=>()=>window.clearTimeout(m.current),[]),P.jsx(oA,{...u,children:P.jsx(bDe,{scope:e,contentId:d,open:g,stateAttribute:w,trigger:f,onTriggerChange:l,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayed?k():x()},[c.isOpenDelayed,k,x]),onTriggerLeave:_.useCallback(()=>{p?A():window.clearTimeout(m.current)},[A,p]),onOpen:x,onClose:A,disableHoverableContent:p,children:n})})};XX.displayName=kA;var EN="TooltipTrigger",QX=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=DA(EN,n),i=S$(EN,n),a=TA(n),o=_.useRef(null),c=tt(e,o,s.onTriggerChange),u=_.useRef(!1),f=_.useRef(!1),l=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),P.jsx(Pv,{asChild:!0,...a,children:P.jsx(De.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:me(t.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:me(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:me(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:me(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:me(t.onBlur,s.onClose),onClick:me(t.onClick,s.onClose)})})});QX.displayName=EN;var wDe="TooltipPortal",[mUe,_De]=PA(wDe,{forceMount:void 0}),dv="TooltipContent",ZX=_.forwardRef((t,e)=>{const n=_De(dv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=DA(dv,t.__scopeTooltip);return P.jsx(Un,{present:r||a.open,children:a.disableHoverableContent?P.jsx(JX,{side:s,...i,ref:e}):P.jsx(xDe,{side:s,...i,ref:e})})}),xDe=_.forwardRef((t,e)=>{const n=DA(dv,t.__scopeTooltip),r=S$(dv,t.__scopeTooltip),s=_.useRef(null),i=tt(e,s),[a,o]=_.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:l}=r,d=_.useCallback(()=>{o(null),l(!1)},[l]),m=_.useCallback((p,h)=>{const y=p.currentTarget,g={x:p.clientX,y:p.clientY},v=ADe(g,y.getBoundingClientRect()),w=RDe(g,v),x=PDe(h.getBoundingClientRect()),A=kDe([...w,...x]);o(A),l(!0)},[l]);return _.useEffect(()=>()=>d(),[d]),_.useEffect(()=>{if(c&&f){const p=y=>m(y,f),h=y=>m(y,c);return c.addEventListener("pointerleave",p),f.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",p),f.removeEventListener("pointerleave",h)}}},[c,f,m,d]),_.useEffect(()=>{if(a){const p=h=>{const y=h.target,g={x:h.clientX,y:h.clientY},v=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),w=!TDe(g,a);v?d():w&&(d(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,f,a,u,d]),P.jsx(JX,{...t,ref:i})}),[SDe,EDe]=PA(kA,{isInside:!1}),JX=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,c=DA(dv,n),u=TA(n),{onClose:f}=c;return _.useEffect(()=>(document.addEventListener(SN,f),()=>document.removeEventListener(SN,f)),[f]),_.useEffect(()=>{if(c.trigger){const l=d=>{const m=d.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,f]),P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:P.jsxs(y_,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(rL,{children:r}),P.jsx(SDe,{scope:n,isInside:!0,children:P.jsx(c7,{id:c.contentId,role:"tooltip",children:s||r})})]})})});ZX.displayName=dv;var eQ="TooltipArrow",CDe=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=TA(n);return EDe(eQ,n).isInside?null:P.jsx(b_,{...s,...r,ref:e})});CDe.displayName=eQ;function ADe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function RDe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function PDe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function TDe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function kDe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),DDe(e)}function DDe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var NDe=YX,ODe=XX,MDe=QX,tQ=ZX;const LDe=NDe,gUe=ODe,vUe=MDe,IDe=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(tQ,{ref:r,sideOffset:e,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));IDe.displayName=tQ.displayName;/** +Defaulting to \`null\`.`}var r9=J7,fPe=t9;const hPe=_.forwardRef(({className:t,value:e,...n},r)=>P.jsx(r9,{ref:r,className:ce("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...n,children:P.jsx(fPe,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));hPe.displayName=r9.displayName;var i$="Radio",[pPe,s9]=Pn(i$),[mPe,gPe]=pPe(i$),i9=_.forwardRef((t,e)=>{const{__scopeRadio:n,name:r,checked:s=!1,required:i,disabled:a,value:o="on",onCheck:c,...u}=t,[f,l]=_.useState(null),d=tt(e,h=>l(h)),m=_.useRef(!1),p=f?!!f.closest("form"):!0;return P.jsxs(mPe,{scope:n,checked:s,disabled:a,children:[P.jsx(De.button,{type:"button",role:"radio","aria-checked":s,"data-state":l9(s),"data-disabled":a?"":void 0,disabled:a,value:o,...u,ref:d,onClick:me(t.onClick,h=>{s||c==null||c(),p&&(m.current=h.isPropagationStopped(),m.current||h.stopPropagation())})}),p&&P.jsx(vPe,{control:f,bubbles:!m.current,name:r,value:o,checked:s,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});i9.displayName=i$;var o9="RadioIndicator",a9=_.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:r,...s}=t,i=gPe(o9,n);return P.jsx(Un,{present:r||i.checked,children:P.jsx(De.span,{"data-state":l9(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:e})})});a9.displayName=o9;var vPe=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Cv(n),o=g_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function l9(t){return t?"checked":"unchecked"}var yPe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],o$="RadioGroup",[bPe,uUe]=Pn(o$,[Cl,s9]),c9=Cl(),u9=s9(),[wPe,_Pe]=bPe(o$),d9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:r,defaultValue:s,value:i,required:a=!1,disabled:o=!1,orientation:c,dir:u,loop:f=!0,onValueChange:l,...d}=t,m=c9(n),p=ka(u),[h,y]=sr({prop:i,defaultProp:s,onChange:l});return P.jsx(wPe,{scope:n,name:r,required:a,disabled:o,value:h,onValueChange:y,children:P.jsx(__,{asChild:!0,...m,orientation:c,dir:p,loop:f,children:P.jsx(De.div,{role:"radiogroup","aria-required":a,"aria-orientation":c,"data-disabled":o?"":void 0,dir:p,...d,ref:e})})})});d9.displayName=o$;var f9="RadioGroupItem",h9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:r,...s}=t,i=_Pe(f9,n),a=i.disabled||r,o=c9(n),c=u9(n),u=_.useRef(null),f=tt(e,u),l=i.value===s.value,d=_.useRef(!1);return _.useEffect(()=>{const m=h=>{yPe.includes(h.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",p)}},[]),P.jsx(x_,{asChild:!0,...o,focusable:!a,active:l,children:P.jsx(i9,{disabled:a,required:i.required,checked:l,...c,...s,name:i.name,ref:f,onCheck:()=>i.onValueChange(s.value),onKeyDown:me(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:me(s.onFocus,()=>{var m;d.current&&((m=u.current)==null||m.click())})})})});h9.displayName=f9;var xPe="RadioGroupIndicator",p9=_.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...r}=t,s=u9(n);return P.jsx(a9,{...s,...r,ref:e})});p9.displayName=xPe;var m9=d9,g9=h9,SPe=p9;const EPe=_.forwardRef(({className:t,...e},n)=>P.jsx(m9,{className:ce("grid gap-2",t),...e,ref:n}));EPe.displayName=m9.displayName;const CPe=_.forwardRef(({className:t,...e},n)=>P.jsx(g9,{ref:n,className:ce("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:P.jsx(SPe,{className:"flex items-center justify-center",children:P.jsx(I1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));CPe.displayName=g9.displayName;const{createElement:cv,createContext:APe,forwardRef:v9,useCallback:oi,useContext:y9,useEffect:Oh,useImperativeHandle:b9,useLayoutEffect:RPe,useMemo:PPe,useRef:hi,useState:Fm}=Yw,DB=Yw[`useId${Math.random()}`.slice(0,5)],TPe=RPe,vA=APe(null);vA.displayName="PanelGroupContext";const Mh=TPe,kPe=typeof DB=="function"?DB:()=>null;let DPe=0;function a$(t=null){const e=kPe(),n=hi(t||e||null);return n.current===null&&(n.current=""+DPe++),t??n.current}function w9({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:s,forwardedRef:i,id:a,maxSize:o,minSize:c,onCollapse:u,onExpand:f,onResize:l,order:d,style:m,tagName:p="div",...h}){const y=y9(vA);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:g,expandPanel:v,getPanelSize:w,getPanelStyle:x,groupId:A,isPanelCollapsed:k,reevaluatePanelConstraints:R,registerPanel:E,resizePanel:T,unregisterPanel:D}=y,O=a$(a),L=hi({callbacks:{onCollapse:u,onExpand:f,onResize:l},constraints:{collapsedSize:n,collapsible:r,defaultSize:s,maxSize:o,minSize:c},id:O,idIsFromProps:a!==void 0,order:d});hi({didLogMissingDefaultSizeWarning:!1}),Mh(()=>{const{callbacks:F,constraints:U}=L.current,Y={...U};L.current.id=O,L.current.idIsFromProps=a!==void 0,L.current.order=d,F.onCollapse=u,F.onExpand=f,F.onResize=l,U.collapsedSize=n,U.collapsible=r,U.defaultSize=s,U.maxSize=o,U.minSize=c,(Y.collapsedSize!==U.collapsedSize||Y.collapsible!==U.collapsible||Y.maxSize!==U.maxSize||Y.minSize!==U.minSize)&&R(L.current,Y)}),Mh(()=>{const F=L.current;return E(F),()=>{D(F)}},[d,O,E,D]),b9(i,()=>({collapse:()=>{g(L.current)},expand:F=>{v(L.current,F)},getId(){return O},getSize(){return w(L.current)},isCollapsed(){return k(L.current)},isExpanded(){return!k(L.current)},resize:F=>{T(L.current,F)}}),[g,v,w,k,O,T]);const I=x(L.current,s);return cv(p,{...h,children:t,className:e,id:a,style:{...I,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":A,"data-panel-id":O,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}const NPe=v9((t,e)=>cv(w9,{...t,forwardedRef:e}));w9.displayName="Panel";NPe.displayName="forwardRef(Panel)";let fN=null,Sf=null;function OPe(t,e){if(e){const n=(e&C9)!==0,r=(e&A9)!==0,s=(e&R9)!==0,i=(e&P9)!==0;if(n)return s?"se-resize":i?"ne-resize":"e-resize";if(r)return s?"sw-resize":i?"nw-resize":"w-resize";if(s)return"s-resize";if(i)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function MPe(){Sf!==null&&(document.head.removeChild(Sf),fN=null,Sf=null)}function BT(t,e){const n=OPe(t,e);fN!==n&&(fN=n,Sf===null&&(Sf=document.createElement("style"),document.head.appendChild(Sf)),Sf.innerHTML=`*{cursor: ${n}!important;}`)}function _9(t){return t.type==="keydown"}function x9(t){return t.type.startsWith("pointer")}function S9(t){return t.type.startsWith("mouse")}function yA(t){if(x9(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(S9(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function LPe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function IPe(t,e,n){return t.xe.x&&t.ye.y}function $Pe(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:MB(t),b:MB(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Pt(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:OB(NB(n.a)),b:OB(NB(n.b))};if(s.a===s.b){const i=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let o=i.length;for(;o--;){const c=i[o];if(c===a.a)return 1;if(c===a.b)return-1}}return Math.sign(s.a-s.b)}const FPe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function jPe(t){var e;const n=getComputedStyle((e=E9(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function zPe(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||jPe(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||FPe.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function NB(t){let e=t.length;for(;e--;){const n=t[e];if(Pt(n,"Missing node"),zPe(n))return n}return null}function OB(t){return t&&Number(getComputedStyle(t).zIndex)||0}function MB(t){const e=[];for(;t;)e.push(t),t=E9(t);return e}function E9(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const C9=1,A9=2,R9=4,P9=8,BPe=LPe()==="coarse";let _a=[],Qb=!1,ku=new Map,bA=new Map;const Zb=new Set;function UPe(t,e,n,r,s){var i;const{ownerDocument:a}=e,o={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:s},c=(i=ku.get(a))!==null&&i!==void 0?i:0;return ku.set(a,c+1),Zb.add(o),bC(),function(){var f;bA.delete(t),Zb.delete(o);const l=(f=ku.get(a))!==null&&f!==void 0?f:1;if(ku.set(a,l-1),bC(),l===1&&ku.delete(a),_a.includes(o)){const d=_a.indexOf(o);d>=0&&_a.splice(d,1),c$()}}}function LB(t){const{target:e}=t,{x:n,y:r}=yA(t);Qb=!0,l$({target:e,x:n,y:r}),bC(),_a.length>0&&(wC("down",t),t.preventDefault(),t.stopPropagation())}function xy(t){const{x:e,y:n}=yA(t);if(t.buttons===0&&(Qb=!1,wC("up",t)),!Qb){const{target:r}=t;l$({target:r,x:e,y:n})}wC("move",t),c$(),_a.length>0&&t.preventDefault()}function Hp(t){const{target:e}=t,{x:n,y:r}=yA(t);bA.clear(),Qb=!1,_a.length>0&&t.preventDefault(),wC("up",t),l$({target:e,x:n,y:r}),c$(),bC()}function l$({target:t,x:e,y:n}){_a.splice(0);let r=null;t instanceof HTMLElement&&(r=t),Zb.forEach(s=>{const{element:i,hitAreaMargins:a}=s,o=i.getBoundingClientRect(),{bottom:c,left:u,right:f,top:l}=o,d=BPe?a.coarse:a.fine;if(e>=u-d&&e<=f+d&&n>=l-d&&n<=c+d){if(r!==null&&i!==r&&!i.contains(r)&&!r.contains(i)&&$Pe(r,i)>0){let p=r,h=!1;for(;p&&!p.contains(i);){if(IPe(p.getBoundingClientRect(),o)){h=!0;break}p=p.parentElement}if(h)return}_a.push(s)}})}function UT(t,e){bA.set(t,e)}function c$(){let t=!1,e=!1;_a.forEach(r=>{const{direction:s}=r;s==="horizontal"?t=!0:e=!0});let n=0;bA.forEach(r=>{n|=r}),t&&e?BT("intersection",n):t?BT("horizontal",n):e?BT("vertical",n):MPe()}function bC(){ku.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Hp),n.removeEventListener("pointerdown",LB),n.removeEventListener("pointerleave",xy),n.removeEventListener("pointermove",xy)}),window.removeEventListener("pointerup",Hp),window.removeEventListener("pointercancel",Hp),Zb.size>0&&(Qb?(_a.length>0&&ku.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Hp),n.addEventListener("pointerleave",xy),n.addEventListener("pointermove",xy))}),window.addEventListener("pointerup",Hp),window.addEventListener("pointercancel",Hp)):ku.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",LB,{capture:!0}),n.addEventListener("pointermove",xy))}))}function wC(t,e){Zb.forEach(n=>{const{setResizeHandlerState:r}=n,s=_a.includes(n);r(t,s,e)})}function HPe(){const[t,e]=Fm(0);return oi(()=>e(n=>n+1),[])}function Pt(t,e){if(!t)throw console.error(e),Error(e)}const u$=10;function Qh(t,e,n=u$){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function Rc(t,e,n=u$){return Qh(t,e,n)===0}function Yi(t,e,n){return Qh(t,e,n)===0}function VPe(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r0&&(t=t<0?0-g:g)}}}{const l=t<0?o:c,d=n[l];Pt(d,`No panel constraints found for index ${l}`);const{collapsedSize:m=0,collapsible:p,minSize:h=0}=d;if(p){const y=e[l];if(Pt(y!=null,`Previous layout not found for panel index ${l}`),Yi(y,h)){const g=y-m;Qh(g,Math.abs(t))>0&&(t=t<0?0-g:g)}}}}{const l=t<0?1:-1;let d=t<0?c:o,m=0;for(;;){const h=e[d];Pt(h!=null,`Previous layout not found for panel index ${d}`);const g=_m({panelConstraints:n,panelIndex:d,size:100})-h;if(m+=g,d+=l,d<0||d>=n.length)break}const p=Math.min(Math.abs(t),Math.abs(m));t=t<0?0-p:p}{let d=t<0?o:c;for(;d>=0&&d=0))break;t<0?d--:d++}}if(VPe(s,a))return s;{const l=t<0?c:o,d=e[l];Pt(d!=null,`Previous layout not found for panel index ${l}`);const m=d+u,p=_m({panelConstraints:n,panelIndex:l,size:m});if(a[l]=p,!Yi(p,m)){let h=m-p,g=t<0?c:o;for(;g>=0&&g0?g--:g++}}}const f=a.reduce((l,d)=>d+l,0);return Yi(f,100)?a:s}function WPe({layout:t,panelsArray:e,pivotIndices:n}){let r=0,s=100,i=0,a=0;const o=n[0];Pt(o!=null,"No pivot index found"),e.forEach((l,d)=>{const{constraints:m}=l,{maxSize:p=100,minSize:h=0}=m;d===o?(r=h,s=p):(i+=h,a+=p)});const c=Math.min(s,100-i),u=Math.max(r,100-a),f=t[o];return{valueMax:c,valueMin:u,valueNow:f}}function Jb(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function T9(t,e,n=document){const s=Jb(t,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===e);return s??null}function k9(t,e,n){const r=T9(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function D9(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function wA(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function GPe(t,e,n,r=document){var s,i,a,o;const c=wA(e,r),u=Jb(t,r),f=c?u.indexOf(c):-1,l=(s=(i=n[f])===null||i===void 0?void 0:i.id)!==null&&s!==void 0?s:null,d=(a=(o=n[f+1])===null||o===void 0?void 0:o.id)!==null&&a!==void 0?a:null;return[l,d]}function qPe({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:s,panelGroupElement:i,setLayout:a}){hi({didWarnAboutMissingResizeHandle:!1}),Mh(()=>{if(!i)return;const o=Jb(n,i);for(let c=0;c{o.forEach((c,u)=>{c.removeAttribute("aria-controls"),c.removeAttribute("aria-valuemax"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuenow")})}},[n,r,s,i]),Oh(()=>{if(!i)return;const o=e.current;Pt(o,"Eager values not found");const{panelDataArray:c}=o,u=D9(n,i);Pt(u!=null,`No group found for id "${n}"`);const f=Jb(n,i);Pt(f,`No resize handles found for group id "${n}"`);const l=f.map(d=>{const m=d.getAttribute("data-panel-resize-handle-id");Pt(m,"Resize handle element has no handle id attribute");const[p,h]=GPe(n,m,c,i);if(p==null||h==null)return()=>{};const y=g=>{if(!g.defaultPrevented)switch(g.key){case"Enter":{g.preventDefault();const v=c.findIndex(w=>w.id===p);if(v>=0){const w=c[v];Pt(w,`No panel data found for index ${v}`);const x=r[v],{collapsedSize:A=0,collapsible:k,minSize:R=0}=w.constraints;if(x!=null&&k){const E=Fy({delta:Yi(x,A)?R-A:A-x,initialLayout:r,panelConstraints:c.map(T=>T.constraints),pivotIndices:k9(n,m,i),prevLayout:r,trigger:"keyboard"});r!==E&&a(E)}}break}}};return d.addEventListener("keydown",y),()=>{d.removeEventListener("keydown",y)}});return()=>{l.forEach(d=>d())}},[i,t,e,n,r,s,a])}function IB(t,e){if(t.length!==e.length)return!1;for(let n=0;ni.constraints);let r=0,s=100;for(let i=0;i{const i=t[s];Pt(i,`Panel data not found for index ${s}`);const{callbacks:a,constraints:o,id:c}=i,{collapsedSize:u=0,collapsible:f}=o,l=n[c];if(l==null||r!==l){n[c]=r;const{onCollapse:d,onExpand:m,onResize:p}=a;p&&p(r,l),f&&(d||m)&&(m&&(l==null||Rc(l,u))&&!Rc(r,u)&&m(),d&&(l==null||!Rc(l,u))&&Rc(r,u)&&d())}})}function pS(t,e){if(t.length!==e.length)return!1;for(let n=0;n{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...s)},e)}}function $B(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function O9(t){return`react-resizable-panels:${t}`}function M9(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:s,order:i}=e;return s?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function L9(t,e){try{const n=O9(t),r=e.getItem(n);if(r){const s=JSON.parse(r);if(typeof s=="object"&&s!=null)return s}}catch{}return null}function JPe(t,e,n){var r,s;const i=(r=L9(t,n))!==null&&r!==void 0?r:{},a=M9(e);return(s=i[a])!==null&&s!==void 0?s:null}function eTe(t,e,n,r,s){var i;const a=O9(t),o=M9(e),c=(i=L9(t,s))!==null&&i!==void 0?i:{};c[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{s.setItem(a,JSON.stringify(c))}catch(u){console.error(u)}}function FB({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((i,a)=>i+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Yi(r,100))for(let i=0;i($B(jy),jy.getItem(t)),setItem:(t,e)=>{$B(jy),jy.setItem(t,e)}},jB={};function I9({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:s,id:i=null,onLayout:a=null,keyboardResizeBy:o=null,storage:c=jy,style:u,tagName:f="div",...l}){const d=a$(i),m=hi(null),[p,h]=Fm(null),[y,g]=Fm([]),v=HPe(),w=hi({}),x=hi(new Map),A=hi(0),k=hi({autoSaveId:t,direction:r,dragState:p,id:d,keyboardResizeBy:o,onLayout:a,storage:c}),R=hi({layout:y,panelDataArray:[],panelDataArrayChanged:!1});hi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),b9(s,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:K}=R.current;return K},setLayout:K=>{const{onLayout:Z}=k.current,{layout:ue,panelDataArray:de}=R.current,ie=FB({layout:K,panelConstraints:de.map(be=>be.constraints)});IB(ue,ie)||(g(ie),R.current.layout=ie,Z&&Z(ie),Vp(de,ie,w.current))}}),[]),Mh(()=>{k.current.autoSaveId=t,k.current.direction=r,k.current.dragState=p,k.current.id=d,k.current.onLayout=a,k.current.storage=c}),qPe({committedValuesRef:k,eagerValuesRef:R,groupId:d,layout:y,panelDataArray:R.current.panelDataArray,setLayout:g,panelGroupElement:m.current}),Oh(()=>{const{panelDataArray:K}=R.current;if(t){if(y.length===0||y.length!==K.length)return;let Z=jB[t];Z==null&&(Z=ZPe(eTe,tTe),jB[t]=Z);const ue=[...K],de=new Map(x.current);Z(t,ue,de,y,c)}},[t,y,c]),Oh(()=>{});const E=oi(K=>{const{onLayout:Z}=k.current,{layout:ue,panelDataArray:de}=R.current;if(K.constraints.collapsible){const ie=de.map(Me=>Me.constraints),{collapsedSize:be=0,panelSize:Ae,pivotIndices:_e}=sf(de,K,ue);if(Pt(Ae!=null,`Panel size not found for panel "${K.id}"`),!Rc(Ae,be)){x.current.set(K.id,Ae);const Ne=em(de,K)===de.length-1?Ae-be:be-Ae,ye=Fy({delta:Ne,initialLayout:ue,panelConstraints:ie,pivotIndices:_e,prevLayout:ue,trigger:"imperative-api"});pS(ue,ye)||(g(ye),R.current.layout=ye,Z&&Z(ye),Vp(de,ye,w.current))}}},[]),T=oi((K,Z)=>{const{onLayout:ue}=k.current,{layout:de,panelDataArray:ie}=R.current;if(K.constraints.collapsible){const be=ie.map($e=>$e.constraints),{collapsedSize:Ae=0,panelSize:_e=0,minSize:Me=0,pivotIndices:Ne}=sf(ie,K,de),ye=Z??Me;if(Rc(_e,Ae)){const $e=x.current.get(K.id),ut=$e!=null&&$e>=ye?$e:ye,vt=em(ie,K)===ie.length-1?_e-ut:ut-_e,Sn=Fy({delta:vt,initialLayout:de,panelConstraints:be,pivotIndices:Ne,prevLayout:de,trigger:"imperative-api"});pS(de,Sn)||(g(Sn),R.current.layout=Sn,ue&&ue(Sn),Vp(ie,Sn,w.current))}}},[]),D=oi(K=>{const{layout:Z,panelDataArray:ue}=R.current,{panelSize:de}=sf(ue,K,Z);return Pt(de!=null,`Panel size not found for panel "${K.id}"`),de},[]),O=oi((K,Z)=>{const{panelDataArray:ue}=R.current,de=em(ue,K);return QPe({defaultSize:Z,dragState:p,layout:y,panelData:ue,panelIndex:de})},[p,y]),L=oi(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=sf(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),ie===!0&&Rc(be,de)},[]),I=oi(K=>{const{layout:Z,panelDataArray:ue}=R.current,{collapsedSize:de=0,collapsible:ie,panelSize:be}=sf(ue,K,Z);return Pt(be!=null,`Panel size not found for panel "${K.id}"`),!ie||Qh(be,de)>0},[]),F=oi(K=>{const{panelDataArray:Z}=R.current;Z.push(K),Z.sort((ue,de)=>{const ie=ue.order,be=de.order;return ie==null&&be==null?0:ie==null?-1:be==null?1:ie-be}),R.current.panelDataArrayChanged=!0,v()},[v]);Mh(()=>{if(R.current.panelDataArrayChanged){R.current.panelDataArrayChanged=!1;const{autoSaveId:K,onLayout:Z,storage:ue}=k.current,{layout:de,panelDataArray:ie}=R.current;let be=null;if(K){const _e=JPe(K,ie,ue);_e&&(x.current=new Map(Object.entries(_e.expandToSizes)),be=_e.layout)}be==null&&(be=XPe({panelDataArray:ie}));const Ae=FB({layout:be,panelConstraints:ie.map(_e=>_e.constraints)});IB(de,Ae)||(g(Ae),R.current.layout=Ae,Z&&Z(Ae),Vp(ie,Ae,w.current))}}),Mh(()=>{const K=R.current;return()=>{K.layout=[]}},[]);const U=oi(K=>function(ue){ue.preventDefault();const de=m.current;if(!de)return()=>null;const{direction:ie,dragState:be,id:Ae,keyboardResizeBy:_e,onLayout:Me}=k.current,{layout:Ne,panelDataArray:ye}=R.current,{initialLayout:$e}=be??{},ut=k9(Ae,K,de);let Qe=YPe(ue,K,ie,be,_e,de);const vt=ie==="horizontal";document.dir==="rtl"&&vt&&(Qe=-Qe);const Sn=ye.map(Xt=>Xt.constraints),Yt=Fy({delta:Qe,initialLayout:$e??Ne,panelConstraints:Sn,pivotIndices:ut,prevLayout:Ne,trigger:_9(ue)?"keyboard":"mouse-or-touch"}),mn=!pS(Ne,Yt);(x9(ue)||S9(ue))&&A.current!=Qe&&(A.current=Qe,mn?UT(K,0):vt?UT(K,Qe<0?C9:A9):UT(K,Qe<0?R9:P9)),mn&&(g(Yt),R.current.layout=Yt,Me&&Me(Yt),Vp(ye,Yt,w.current))},[]),Y=oi((K,Z)=>{const{onLayout:ue}=k.current,{layout:de,panelDataArray:ie}=R.current,be=ie.map($e=>$e.constraints),{panelSize:Ae,pivotIndices:_e}=sf(ie,K,de);Pt(Ae!=null,`Panel size not found for panel "${K.id}"`);const Ne=em(ie,K)===ie.length-1?Ae-Z:Z-Ae,ye=Fy({delta:Ne,initialLayout:de,panelConstraints:be,pivotIndices:_e,prevLayout:de,trigger:"imperative-api"});pS(de,ye)||(g(ye),R.current.layout=ye,ue&&ue(ye),Vp(ie,ye,w.current))},[]),V=oi((K,Z)=>{const{layout:ue,panelDataArray:de}=R.current,{collapsedSize:ie=0,collapsible:be}=Z,{collapsedSize:Ae=0,collapsible:_e,maxSize:Me=100,minSize:Ne=0}=K.constraints,{panelSize:ye}=sf(de,K,ue);ye!=null&&(be&&_e&&Rc(ye,ie)?Rc(ie,Ae)||Y(K,Ae):yeMe&&Y(K,Me))},[Y]),H=oi((K,Z)=>{const{direction:ue}=k.current,{layout:de}=R.current;if(!m.current)return;const ie=wA(K,m.current);Pt(ie,`Drag handle element not found for id "${K}"`);const be=N9(ue,Z);h({dragHandleId:K,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:be,initialLayout:de})},[]),ee=oi(()=>{h(null)},[]),re=oi(K=>{const{panelDataArray:Z}=R.current,ue=em(Z,K);ue>=0&&(Z.splice(ue,1),delete w.current[K.id],R.current.panelDataArrayChanged=!0,v())},[v]),X=PPe(()=>({collapsePanel:E,direction:r,dragState:p,expandPanel:T,getPanelSize:D,getPanelStyle:O,groupId:d,isPanelCollapsed:L,isPanelExpanded:I,reevaluatePanelConstraints:V,registerPanel:F,registerResizeHandle:U,resizePanel:Y,startDragging:H,stopDragging:ee,unregisterPanel:re,panelGroupElement:m.current}),[E,p,r,T,D,O,d,L,I,V,F,U,Y,H,ee,re]),q={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return cv(vA.Provider,{value:X},cv(f,{...l,children:e,className:n,id:i,ref:m,style:{...q,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":d}))}const nTe=v9((t,e)=>cv(I9,{...t,forwardedRef:e}));I9.displayName="PanelGroup";nTe.displayName="forwardRef(PanelGroup)";function em(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function sf(t,e,n){const r=em(t,e),i=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:i}}function rTe({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Oh(()=>{if(t||n==null||r==null)return;const s=wA(e,r);if(s==null)return;const i=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const o=s.getAttribute("data-panel-group-id");Pt(o,`No group element found for id "${o}"`);const c=Jb(o,r),u=T9(o,e,r);Pt(u!==null,`No resize element found for id "${e}"`);const f=a.shiftKey?u>0?u-1:c.length-1:u+1{s.removeEventListener("keydown",i)}},[r,t,e,n])}function sTe({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:s,onBlur:i,onDragging:a,onFocus:o,style:c={},tabIndex:u=0,tagName:f="div",...l}){var d,m;const p=hi(null),h=hi({onDragging:a});Oh(()=>{h.current.onDragging=a});const y=y9(vA);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,groupId:v,registerResizeHandle:w,startDragging:x,stopDragging:A,panelGroupElement:k}=y,R=a$(s),[E,T]=Fm("inactive"),[D,O]=Fm(!1),[L,I]=Fm(null),F=hi({state:E});Mh(()=>{F.current.state=E}),Oh(()=>{if(n)I(null);else{const H=w(R);I(()=>H)}},[n,R,w]);const U=(d=r==null?void 0:r.coarse)!==null&&d!==void 0?d:15,Y=(m=r==null?void 0:r.fine)!==null&&m!==void 0?m:5;return Oh(()=>{if(n||L==null)return;const H=p.current;return Pt(H,"Element ref not attached"),UPe(R,H,g,{coarse:U,fine:Y},(re,X,q)=>{if(X)switch(re){case"down":{T("drag"),x(R,q);const{onDragging:K}=h.current;K&&K(!0);break}case"move":{const{state:K}=F.current;K!=="drag"&&T("hover"),L(q);break}case"up":{T("hover"),A();const{onDragging:K}=h.current;K&&K(!1);break}}else T("inactive")})},[U,g,n,Y,w,R,L,x,A]),rTe({disabled:n,handleId:R,resizeHandler:L,panelGroupElement:k}),cv(f,{...l,children:t,className:e,id:s,onBlur:()=>{O(!1),i==null||i()},onFocus:()=>{O(!0),o==null||o()},ref:p,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...c},tabIndex:u,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":E==="drag"?"pointer":D?"keyboard":void 0,"data-resize-handle-state":E,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":R})}sTe.displayName="PanelResizeHandle";function e0(t,[e,n]){return Math.min(n,Math.max(e,t))}function iTe(t,e){return _.useReducer((n,r)=>e[n][r]??n,t)}var d$="ScrollArea",[$9,dUe]=Pn(d$),[oTe,Ho]=$9(d$),F9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=t,[o,c]=_.useState(null),[u,f]=_.useState(null),[l,d]=_.useState(null),[m,p]=_.useState(null),[h,y]=_.useState(null),[g,v]=_.useState(0),[w,x]=_.useState(0),[A,k]=_.useState(!1),[R,E]=_.useState(!1),T=tt(e,O=>c(O)),D=ka(s);return P.jsx(oTe,{scope:n,type:r,dir:D,scrollHideDelay:i,scrollArea:o,viewport:u,onViewportChange:f,content:l,onContentChange:d,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:A,onScrollbarXEnabledChange:k,scrollbarY:h,onScrollbarYChange:y,scrollbarYEnabled:R,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:x,children:P.jsx(De.div,{dir:D,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});F9.displayName=d$;var j9="ScrollAreaViewport",z9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=t,a=Ho(j9,n),o=_.useRef(null),c=tt(e,o,a.onViewportChange);return P.jsxs(P.Fragment,{children:[P.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),P.jsx(De.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:P.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});z9.displayName=j9;var Rl="ScrollAreaScrollbar",f$=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ho(Rl,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,o=t.orientation==="horizontal";return _.useEffect(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),s.type==="hover"?P.jsx(aTe,{...r,ref:e,forceMount:n}):s.type==="scroll"?P.jsx(lTe,{...r,ref:e,forceMount:n}):s.type==="auto"?P.jsx(B9,{...r,ref:e,forceMount:n}):s.type==="always"?P.jsx(h$,{...r,ref:e}):null});f$.displayName=Rl;var aTe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ho(Rl,t.__scopeScrollArea),[i,a]=_.useState(!1);return _.useEffect(()=>{const o=s.scrollArea;let c=0;if(o){const u=()=>{window.clearTimeout(c),a(!0)},f=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return o.addEventListener("pointerenter",u),o.addEventListener("pointerleave",f),()=>{window.clearTimeout(c),o.removeEventListener("pointerenter",u),o.removeEventListener("pointerleave",f)}}},[s.scrollArea,s.scrollHideDelay]),P.jsx(Un,{present:n||i,children:P.jsx(B9,{"data-state":i?"visible":"hidden",...r,ref:e})})}),lTe=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=Ho(Rl,t.__scopeScrollArea),i=t.orientation==="horizontal",a=xA(()=>c("SCROLL_END"),100),[o,c]=iTe("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(o==="idle"){const u=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(u)}},[o,s.scrollHideDelay,c]),_.useEffect(()=>{const u=s.viewport,f=i?"scrollLeft":"scrollTop";if(u){let l=u[f];const d=()=>{const m=u[f];l!==m&&(c("SCROLL"),a()),l=m};return u.addEventListener("scroll",d),()=>u.removeEventListener("scroll",d)}},[s.viewport,i,c,a]),P.jsx(Un,{present:n||o!=="hidden",children:P.jsx(h$,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:me(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:me(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),B9=_.forwardRef((t,e)=>{const n=Ho(Rl,t.__scopeScrollArea),{forceMount:r,...s}=t,[i,a]=_.useState(!1),o=t.orientation==="horizontal",c=xA(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=t,s=Ho(Rl,t.__scopeScrollArea),i=_.useRef(null),a=_.useRef(0),[o,c]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=G9(o.viewport,o.content),f={...r,sizes:o,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:d=>i.current=d,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:d=>a.current=d};function l(d,m){return pTe(d,a.current,o,m)}return n==="horizontal"?P.jsx(cTe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollLeft,m=zB(d,o,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollLeft=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollLeft=l(d,s.dir))}}):n==="vertical"?P.jsx(uTe,{...f,ref:e,onThumbPositionChange:()=>{if(s.viewport&&i.current){const d=s.viewport.scrollTop,m=zB(d,o);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{s.viewport&&(s.viewport.scrollTop=d)},onDragScroll:d=>{s.viewport&&(s.viewport.scrollTop=l(d))}}):null}),cTe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Ho(Rl,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarXChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(H9,{"data-orientation":"horizontal",...s,ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_A(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.x),onDragScroll:f=>t.onDragScroll(f.x),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollLeft+f.deltaX;t.onWheelScroll(d),K9(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:xC(a.paddingLeft),paddingEnd:xC(a.paddingRight)}})}})}),uTe=_.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...s}=t,i=Ho(Rl,t.__scopeScrollArea),[a,o]=_.useState(),c=_.useRef(null),u=tt(e,c,i.onScrollbarYChange);return _.useEffect(()=>{c.current&&o(getComputedStyle(c.current))},[c]),P.jsx(H9,{"data-orientation":"vertical",...s,ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_A(n)+"px",...t.style},onThumbPointerDown:f=>t.onThumbPointerDown(f.y),onDragScroll:f=>t.onDragScroll(f.y),onWheelScroll:(f,l)=>{if(i.viewport){const d=i.viewport.scrollTop+f.deltaY;t.onWheelScroll(d),K9(d,l)&&f.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:xC(a.paddingTop),paddingEnd:xC(a.paddingBottom)}})}})}),[dTe,U9]=$9(Rl),H9=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:f,onResize:l,...d}=t,m=Ho(Rl,n),[p,h]=_.useState(null),y=tt(e,T=>h(T)),g=_.useRef(null),v=_.useRef(""),w=m.viewport,x=r.content-r.viewport,A=Bt(f),k=Bt(c),R=xA(l,10);function E(T){if(g.current){const D=T.clientX-g.current.left,O=T.clientY-g.current.top;u({x:D,y:O})}}return _.useEffect(()=>{const T=D=>{const O=D.target;(p==null?void 0:p.contains(O))&&A(D,x)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,p,x,A]),_.useEffect(k,[r,k]),uv(p,R),uv(m.content,R),P.jsx(dTe,{scope:n,scrollbar:p,hasThumb:s,onThumbChange:Bt(i),onThumbPointerUp:Bt(a),onThumbPositionChange:k,onThumbPointerDown:Bt(o),children:P.jsx(De.div,{...d,ref:y,style:{position:"absolute",...d.style},onPointerDown:me(t.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),g.current=p.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),E(T))}),onPointerMove:me(t.onPointerMove,E),onPointerUp:me(t.onPointerUp,T=>{const D=T.target;D.hasPointerCapture(T.pointerId)&&D.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),_C="ScrollAreaThumb",V9=_.forwardRef((t,e)=>{const{forceMount:n,...r}=t,s=U9(_C,t.__scopeScrollArea);return P.jsx(Un,{present:n||s.hasThumb,children:P.jsx(fTe,{ref:e,...r})})}),fTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...s}=t,i=Ho(_C,n),a=U9(_C,n),{onThumbPositionChange:o}=a,c=tt(e,l=>a.onThumbChange(l)),u=_.useRef(),f=xA(()=>{u.current&&(u.current(),u.current=void 0)},100);return _.useEffect(()=>{const l=i.viewport;if(l){const d=()=>{if(f(),!u.current){const m=mTe(l,o);u.current=m,o()}};return o(),l.addEventListener("scroll",d),()=>l.removeEventListener("scroll",d)}},[i.viewport,f,o]),P.jsx(De.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:me(t.onPointerDownCapture,l=>{const m=l.target.getBoundingClientRect(),p=l.clientX-m.left,h=l.clientY-m.top;a.onThumbPointerDown({x:p,y:h})}),onPointerUp:me(t.onPointerUp,a.onThumbPointerUp)})});V9.displayName=_C;var p$="ScrollAreaCorner",W9=_.forwardRef((t,e)=>{const n=Ho(p$,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?P.jsx(hTe,{...t,ref:e}):null});W9.displayName=p$;var hTe=_.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,s=Ho(p$,n),[i,a]=_.useState(0),[o,c]=_.useState(0),u=!!(i&&o);return uv(s.scrollbarX,()=>{var l;const f=((l=s.scrollbarX)==null?void 0:l.offsetHeight)||0;s.onCornerHeightChange(f),c(f)}),uv(s.scrollbarY,()=>{var l;const f=((l=s.scrollbarY)==null?void 0:l.offsetWidth)||0;s.onCornerWidthChange(f),a(f)}),u?P.jsx(De.div,{...r,ref:e,style:{width:i,height:o,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function xC(t){return t?parseInt(t,10):0}function G9(t,e){const n=t/e;return isNaN(n)?0:n}function _A(t){const e=G9(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function pTe(t,e,n,r="ltr"){const s=_A(n),i=s/2,a=e||i,o=s-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-o,f=n.content-n.viewport,l=r==="ltr"?[0,f]:[f*-1,0];return q9([c,u],l)(t)}function zB(t,e,n="ltr"){const r=_A(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-s,a=e.content-e.viewport,o=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=e0(t,c);return q9([0,a],[0,o])(u)}function q9(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function K9(t,e){return t>0&&t{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return function s(){const i={left:t.scrollLeft,top:t.scrollTop},a=n.left!==i.left,o=n.top!==i.top;(a||o)&&e(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function xA(t,e){const n=Bt(t),r=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),_.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function uv(t,e){const n=Bt(e);Mn(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,n])}var Y9=F9,gTe=z9,vTe=W9;const yTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(Y9,{ref:r,className:ce("relative overflow-hidden",t),...n,children:[P.jsx(gTe,{className:"h-full w-full rounded-[inherit]",children:e}),P.jsx(X9,{}),P.jsx(vTe,{})]}));yTe.displayName=Y9.displayName;const X9=_.forwardRef(({className:t,orientation:e="vertical",...n},r)=>P.jsx(f$,{ref:r,orientation:e,className:ce("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...n,children:P.jsx(V9,{className:"relative flex-1 rounded-full bg-border"})}));X9.displayName=f$.displayName;var bTe=[" ","Enter","ArrowUp","ArrowDown"],wTe=[" ","Enter"],D_="Select",[SA,EA,_Te]=qc(D_),[Dv,fUe]=Pn(D_,[_Te,El]),CA=El(),[xTe,Fd]=Dv(D_),[STe,ETe]=Dv(D_),Q9=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:o,onValueChange:c,dir:u,name:f,autoComplete:l,disabled:d,required:m}=t,p=CA(e),[h,y]=_.useState(null),[g,v]=_.useState(null),[w,x]=_.useState(!1),A=ka(u),[k=!1,R]=sr({prop:r,defaultProp:s,onChange:i}),[E,T]=sr({prop:a,defaultProp:o,onChange:c}),D=_.useRef(null),O=h?!!h.closest("form"):!0,[L,I]=_.useState(new Set),F=Array.from(L).map(U=>U.props.value).join(";");return P.jsx(aA,{...p,children:P.jsxs(xTe,{required:m,scope:e,trigger:h,onTriggerChange:y,valueNode:g,onValueNodeChange:v,valueNodeHasChildren:w,onValueNodeHasChildrenChange:x,contentId:Hr(),value:E,onValueChange:T,open:k,onOpenChange:R,dir:A,triggerPointerDownPosRef:D,disabled:d,children:[P.jsx(SA.Provider,{scope:e,children:P.jsx(STe,{scope:t.__scopeSelect,onNativeOptionAdd:_.useCallback(U=>{I(Y=>new Set(Y).add(U))},[]),onNativeOptionRemove:_.useCallback(U=>{I(Y=>{const V=new Set(Y);return V.delete(U),V})},[]),children:n})}),O?P.jsxs(xY,{"aria-hidden":!0,required:m,tabIndex:-1,name:f,autoComplete:l,value:E,onChange:U=>T(U.target.value),disabled:d,children:[E===void 0?P.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};Q9.displayName=D_;var Z9="SelectTrigger",J9=_.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...s}=t,i=CA(n),a=Fd(Z9,n),o=a.disabled||r,c=tt(e,a.onTriggerChange),u=EA(n),[f,l,d]=SY(p=>{const h=u().filter(v=>!v.disabled),y=h.find(v=>v.value===a.value),g=EY(h,p,y);g!==void 0&&a.onValueChange(g.value)}),m=()=>{o||(a.onOpenChange(!0),d())};return P.jsx(Pv,{asChild:!0,...i,children:P.jsx(De.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":_Y(a.value)?"":void 0,...s,ref:c,onClick:me(s.onClick,p=>{p.currentTarget.focus()}),onPointerDown:me(s.onPointerDown,p=>{const h=p.target;h.hasPointerCapture(p.pointerId)&&h.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(m(),a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:me(s.onKeyDown,p=>{const h=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&l(p.key),!(h&&p.key===" ")&&bTe.includes(p.key)&&(m(),p.preventDefault())})})})});J9.displayName=Z9;var eY="SelectValue",tY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...o}=t,c=Fd(eY,n),{onValueNodeHasChildrenChange:u}=c,f=i!==void 0,l=tt(e,c.onValueNodeChange);return Mn(()=>{u(f)},[u,f]),P.jsx(De.span,{...o,ref:l,style:{pointerEvents:"none"},children:_Y(c.value)?P.jsx(P.Fragment,{children:a}):i})});tY.displayName=eY;var CTe="SelectIcon",nY=_.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...s}=t;return P.jsx(De.span,{"aria-hidden":!0,...s,ref:e,children:r||"▼"})});nY.displayName=CTe;var ATe="SelectPortal",rY=t=>P.jsx(wv,{asChild:!0,...t});rY.displayName=ATe;var Zh="SelectContent",sY=_.forwardRef((t,e)=>{const n=Fd(Zh,t.__scopeSelect),[r,s]=_.useState();if(Mn(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?ks.createPortal(P.jsx(iY,{scope:t.__scopeSelect,children:P.jsx(SA.Slot,{scope:t.__scopeSelect,children:P.jsx("div",{children:t.children})})}),i):null}return P.jsx(oY,{...t,ref:e})});sY.displayName=Zh;var Kl=10,[iY,jd]=Dv(Zh),RTe="SelectContentImpl",oY=_.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y,...g}=t,v=Fd(Zh,n),[w,x]=_.useState(null),[A,k]=_.useState(null),R=tt(e,ie=>x(ie)),[E,T]=_.useState(null),[D,O]=_.useState(null),L=EA(n),[I,F]=_.useState(!1),U=_.useRef(!1);_.useEffect(()=>{if(w)return _v(w)},[w]),$1();const Y=_.useCallback(ie=>{const[be,...Ae]=L().map(Ne=>Ne.ref.current),[_e]=Ae.slice(-1),Me=document.activeElement;for(const Ne of ie)if(Ne===Me||(Ne==null||Ne.scrollIntoView({block:"nearest"}),Ne===be&&A&&(A.scrollTop=0),Ne===_e&&A&&(A.scrollTop=A.scrollHeight),Ne==null||Ne.focus(),document.activeElement!==Me))return},[L,A]),V=_.useCallback(()=>Y([E,w]),[Y,E,w]);_.useEffect(()=>{I&&V()},[I,V]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=v;_.useEffect(()=>{if(w){let ie={x:0,y:0};const be=_e=>{var Me,Ne;ie={x:Math.abs(Math.round(_e.pageX)-(((Me=ee.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((Ne=ee.current)==null?void 0:Ne.y)??0))}},Ae=_e=>{ie.x<=10&&ie.y<=10?_e.preventDefault():w.contains(_e.target)||H(!1),document.removeEventListener("pointermove",be),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[w,H,ee]),_.useEffect(()=>{const ie=()=>H(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[H]);const[re,X]=SY(ie=>{const be=L().filter(Me=>!Me.disabled),Ae=be.find(Me=>Me.ref.current===document.activeElement),_e=EY(be,ie,Ae);_e&&setTimeout(()=>_e.ref.current.focus())}),q=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&(T(ie),_e&&(U.current=!0))},[v.value]),K=_.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=_.useCallback((ie,be,Ae)=>{const _e=!U.current&&!Ae;(v.value!==void 0&&v.value===be||_e)&&O(ie)},[v.value]),ue=r==="popper"?hN:aY,de=ue===hN?{side:o,sideOffset:c,align:u,alignOffset:f,arrowPadding:l,collisionBoundary:d,collisionPadding:m,sticky:p,hideWhenDetached:h,avoidCollisions:y}:{};return P.jsx(iY,{scope:n,content:w,viewport:A,onViewportChange:k,itemRefCallback:q,selectedItem:E,onItemLeave:K,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:D,position:r,isPositioned:I,searchRef:re,children:P.jsx(i_,{as:Ea,allowPinchZoom:!0,children:P.jsx(s_,{asChild:!0,trapped:v.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:me(s,ie=>{var be;(be=v.trigger)==null||be.focus({preventScroll:!0}),ie.preventDefault()}),children:P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:P.jsx(ue,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ie=>ie.preventDefault(),...g,...de,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:me(g.onKeyDown,ie=>{const be=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!be&&ie.key.length===1&&X(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let _e=L().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Me=ie.target,Ne=_e.indexOf(Me);_e=_e.slice(Ne+1)}setTimeout(()=>Y(_e)),ie.preventDefault()}})})})})})})});oY.displayName=RTe;var PTe="SelectItemAlignedPosition",aY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...s}=t,i=Fd(Zh,n),a=jd(Zh,n),[o,c]=_.useState(null),[u,f]=_.useState(null),l=tt(e,R=>f(R)),d=EA(n),m=_.useRef(!1),p=_.useRef(!0),{viewport:h,selectedItem:y,selectedItemText:g,focusSelectedItem:v}=a,w=_.useCallback(()=>{if(i.trigger&&i.valueNode&&o&&u&&h&&y&&g){const R=i.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),T=i.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(i.dir!=="rtl"){const Me=D.left-E.left,Ne=T.left-Me,ye=R.left-Ne,$e=R.width+ye,ut=Math.max($e,E.width),Qe=window.innerWidth-Kl,vt=e0(Ne,[Kl,Qe-ut]);o.style.minWidth=$e+"px",o.style.left=vt+"px"}else{const Me=E.right-D.right,Ne=window.innerWidth-T.right-Me,ye=window.innerWidth-R.right-Ne,$e=R.width+ye,ut=Math.max($e,E.width),Qe=window.innerWidth-Kl,vt=e0(Ne,[Kl,Qe-ut]);o.style.minWidth=$e+"px",o.style.right=vt+"px"}const O=d(),L=window.innerHeight-Kl*2,I=h.scrollHeight,F=window.getComputedStyle(u),U=parseInt(F.borderTopWidth,10),Y=parseInt(F.paddingTop,10),V=parseInt(F.borderBottomWidth,10),H=parseInt(F.paddingBottom,10),ee=U+Y+I+H+V,re=Math.min(y.offsetHeight*5,ee),X=window.getComputedStyle(h),q=parseInt(X.paddingTop,10),K=parseInt(X.paddingBottom,10),Z=R.top+R.height/2-Kl,ue=L-Z,de=y.offsetHeight/2,ie=y.offsetTop+de,be=U+Y+ie,Ae=ee-be;if(be<=Z){const Me=y===O[O.length-1].ref.current;o.style.bottom="0px";const Ne=u.clientHeight-h.offsetTop-h.offsetHeight,ye=Math.max(ue,de+(Me?K:0)+Ne+V),$e=be+ye;o.style.height=$e+"px"}else{const Me=y===O[0].ref.current;o.style.top="0px";const ye=Math.max(Z,U+h.offsetTop+(Me?q:0)+de)+Ae;o.style.height=ye+"px",h.scrollTop=be-Z+h.offsetTop}o.style.margin=`${Kl}px 0`,o.style.minHeight=re+"px",o.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[d,i.trigger,i.valueNode,o,u,h,y,g,i.dir,r]);Mn(()=>w(),[w]);const[x,A]=_.useState();Mn(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const k=_.useCallback(R=>{R&&p.current===!0&&(w(),v==null||v(),p.current=!1)},[w,v]);return P.jsx(kTe,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:P.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:P.jsx(De.div,{...s,ref:l,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});aY.displayName=PTe;var TTe="SelectPopperPosition",hN=_.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Kl,...i}=t,a=CA(n);return P.jsx(b_,{...a,...i,ref:e,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});hN.displayName=TTe;var[kTe,m$]=Dv(Zh,{}),pN="SelectViewport",lY=_.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...s}=t,i=jd(pN,n),a=m$(pN,n),o=tt(e,i.onViewportChange),c=_.useRef(0);return P.jsxs(P.Fragment,{children:[P.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),P.jsx(SA.Slot,{scope:n,children:P.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:o,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:me(s.onScroll,u=>{const f=u.currentTarget,{contentWrapper:l,shouldExpandOnScrollRef:d}=a;if(d!=null&&d.current&&l){const m=Math.abs(c.current-f.scrollTop);if(m>0){const p=window.innerHeight-Kl*2,h=parseFloat(l.style.minHeight),y=parseFloat(l.style.height),g=Math.max(h,y);if(g0?x:0,l.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});lY.displayName=pN;var cY="SelectGroup",[DTe,NTe]=Dv(cY),OTe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=Hr();return P.jsx(DTe,{scope:n,id:s,children:P.jsx(De.div,{role:"group","aria-labelledby":s,...r,ref:e})})});OTe.displayName=cY;var uY="SelectLabel",dY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=NTe(uY,n);return P.jsx(De.div,{id:s.id,...r,ref:e})});dY.displayName=uY;var SC="SelectItem",[MTe,fY]=Dv(SC),hY=_.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=t,o=Fd(SC,n),c=jd(SC,n),u=o.value===r,[f,l]=_.useState(i??""),[d,m]=_.useState(!1),p=tt(e,g=>{var v;return(v=c.itemRefCallback)==null?void 0:v.call(c,g,r,s)}),h=Hr(),y=()=>{s||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return P.jsx(MTe,{scope:n,value:r,disabled:s,textId:h,isSelected:u,onItemTextChange:_.useCallback(g=>{l(v=>v||((g==null?void 0:g.textContent)??"").trim())},[]),children:P.jsx(SA.ItemSlot,{scope:n,value:r,disabled:s,textValue:f,children:P.jsx(De.div,{role:"option","aria-labelledby":h,"data-highlighted":d?"":void 0,"aria-selected":u&&d,"data-state":u?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:p,onFocus:me(a.onFocus,()=>m(!0)),onBlur:me(a.onBlur,()=>m(!1)),onPointerUp:me(a.onPointerUp,y),onPointerMove:me(a.onPointerMove,g=>{var v;s?(v=c.onItemLeave)==null||v.call(c):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(a.onPointerLeave,g=>{var v;g.currentTarget===document.activeElement&&((v=c.onItemLeave)==null||v.call(c))}),onKeyDown:me(a.onKeyDown,g=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&g.key===" "||(wTe.includes(g.key)&&y(),g.key===" "&&g.preventDefault())})})})})});hY.displayName=SC;var zy="SelectItemText",pY=_.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:s,...i}=t,a=Fd(zy,n),o=jd(zy,n),c=fY(zy,n),u=ETe(zy,n),[f,l]=_.useState(null),d=tt(e,g=>l(g),c.onItemTextChange,g=>{var v;return(v=o.itemTextRefCallback)==null?void 0:v.call(o,g,c.value,c.disabled)}),m=f==null?void 0:f.textContent,p=_.useMemo(()=>P.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:h,onNativeOptionRemove:y}=u;return Mn(()=>(h(p),()=>y(p)),[h,y,p]),P.jsxs(P.Fragment,{children:[P.jsx(De.span,{id:c.textId,...i,ref:d}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ks.createPortal(i.children,a.valueNode):null]})});pY.displayName=zy;var mY="SelectItemIndicator",gY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return fY(mY,n).isSelected?P.jsx(De.span,{"aria-hidden":!0,...r,ref:e}):null});gY.displayName=mY;var mN="SelectScrollUpButton",vY=_.forwardRef((t,e)=>{const n=jd(mN,t.__scopeSelect),r=m$(mN,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return Mn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(bY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});vY.displayName=mN;var gN="SelectScrollDownButton",yY=_.forwardRef((t,e)=>{const n=jd(gN,t.__scopeSelect),r=m$(gN,t.__scopeSelect),[s,i]=_.useState(!1),a=tt(e,r.onScrollButtonChange);return Mn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const u=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),s?P.jsx(bY,{...t,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});yY.displayName=gN;var bY=_.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=t,i=jd("SelectScrollButton",n),a=_.useRef(null),o=EA(n),c=_.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),Mn(()=>{var f;const u=o().find(l=>l.ref.current===document.activeElement);(f=u==null?void 0:u.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),P.jsx(De.div,{"aria-hidden":!0,...s,ref:e,style:{flexShrink:0,...s.style},onPointerDown:me(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:me(s.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:me(s.onPointerLeave,()=>{c()})})}),LTe="SelectSeparator",wY=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return P.jsx(De.div,{"aria-hidden":!0,...r,ref:e})});wY.displayName=LTe;var vN="SelectArrow",ITe=_.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,s=CA(n),i=Fd(vN,n),a=jd(vN,n);return i.open&&a.position==="popper"?P.jsx(w_,{...s,...r,ref:e}):null});ITe.displayName=vN;function _Y(t){return t===""||t===void 0}var xY=_.forwardRef((t,e)=>{const{value:n,...r}=t,s=_.useRef(null),i=tt(e,s),a=Cv(n);return _.useEffect(()=>{const o=s.current,c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==n&&f){const l=new Event("change",{bubbles:!0});f.call(o,n),o.dispatchEvent(l)}},[a,n]),P.jsx(T_,{asChild:!0,children:P.jsx("select",{...r,ref:i,defaultValue:n})})});xY.displayName="BubbleSelect";function SY(t){const e=Bt(t),n=_.useRef(""),r=_.useRef(0),s=_.useCallback(a=>{const o=n.current+a;e(o),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(o)},[e]),i=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function EY(t,e,n){const s=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=$Te(t,Math.max(i,0));s.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function $Te(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var FTe=Q9,CY=J9,jTe=tY,zTe=nY,BTe=rY,AY=sY,UTe=lY,RY=dY,PY=hY,HTe=pY,VTe=gY,TY=vY,kY=yY,DY=wY;const hUe=FTe,pUe=jTe,WTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(CY,{ref:r,className:ce("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...n,children:[e,P.jsx(zTe,{asChild:!0,children:P.jsx(L1,{className:"h-4 w-4 opacity-50"})})]}));WTe.displayName=CY.displayName;const NY=_.forwardRef(({className:t,...e},n)=>P.jsx(TY,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(Efe,{className:"h-4 w-4"})}));NY.displayName=TY.displayName;const OY=_.forwardRef(({className:t,...e},n)=>P.jsx(kY,{ref:n,className:ce("flex cursor-default items-center justify-center py-1",t),...e,children:P.jsx(L1,{className:"h-4 w-4"})}));OY.displayName=kY.displayName;const GTe=_.forwardRef(({className:t,children:e,position:n="popper",...r},s)=>P.jsx(BTe,{children:P.jsxs(AY,{ref:s,className:ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...r,children:[P.jsx(NY,{}),P.jsx(UTe,{className:ce("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),P.jsx(OY,{})]})}));GTe.displayName=AY.displayName;const qTe=_.forwardRef(({className:t,...e},n)=>P.jsx(RY,{ref:n,className:ce("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));qTe.displayName=RY.displayName;const KTe=_.forwardRef(({className:t,children:e,...n},r)=>P.jsxs(PY,{ref:r,className:ce("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[P.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:P.jsx(VTe,{children:P.jsx(n_,{className:"h-4 w-4"})})}),P.jsx(HTe,{children:e})]}));KTe.displayName=PY.displayName;const YTe=_.forwardRef(({className:t,...e},n)=>P.jsx(DY,{ref:n,className:ce("-mx-1 my-1 h-px bg-muted",t),...e}));YTe.displayName=DY.displayName;const XTe=CL,QTe=AL,ZTe=RL,MY=_.forwardRef(({className:t,...e},n)=>P.jsx(o_,{className:ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));MY.displayName=o_.displayName;const JTe=zo("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),LY=_.forwardRef(({side:t="right",className:e,children:n,...r},s)=>P.jsxs(ZTe,{children:[P.jsx(MY,{}),P.jsxs(a_,{ref:s,className:ce(JTe({side:t}),e),...r,children:[n,P.jsxs(u_,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[P.jsx(pL,{className:"h-4 w-4"}),P.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));LY.displayName=a_.displayName;const eke=_.forwardRef(({className:t,...e},n)=>P.jsx(l_,{ref:n,className:ce("text-lg font-semibold text-foreground",t),...e}));eke.displayName=l_.displayName;const tke=_.forwardRef(({className:t,...e},n)=>P.jsx(c_,{ref:n,className:ce("text-sm text-muted-foreground",t),...e}));tke.displayName=c_.displayName;var IY=["PageUp","PageDown"],$Y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],FY={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Nv="Slider",[yN,nke,rke]=qc(Nv),[jY,mUe]=Pn(Nv,[rke]),[ske,AA]=jY(Nv),zY=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:o=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:f,onValueChange:l=()=>{},onValueCommit:d=()=>{},inverted:m=!1,...p}=t,h=_.useRef(new Set),y=_.useRef(0),v=a==="horizontal"?ike:oke,[w=[],x]=sr({prop:f,defaultProp:u,onChange:D=>{var L;(L=[...h.current][y.current])==null||L.focus(),l(D)}}),A=_.useRef(w);function k(D){const O=dke(w,D);T(D,O)}function R(D){T(D,y.current)}function E(){const D=A.current[y.current];w[y.current]!==D&&d(w)}function T(D,O,{commit:L}={commit:!1}){const I=mke(i),F=gke(Math.round((D-r)/i)*i+r,I),U=e0(F,[r,s]);x((Y=[])=>{const V=cke(Y,U,O);if(pke(V,c*i)){y.current=V.indexOf(U);const H=String(V)!==String(Y);return H&&L&&d(V),H?V:Y}else return Y})}return P.jsx(ske,{scope:t.__scopeSlider,name:n,disabled:o,min:r,max:s,valueIndexToChangeRef:y,thumbs:h.current,values:w,orientation:a,children:P.jsx(yN.Provider,{scope:t.__scopeSlider,children:P.jsx(yN.Slot,{scope:t.__scopeSlider,children:P.jsx(v,{"aria-disabled":o,"data-disabled":o?"":void 0,...p,ref:e,onPointerDown:me(p.onPointerDown,()=>{o||(A.current=w)}),min:r,max:s,inverted:m,onSlideStart:o?void 0:k,onSlideMove:o?void 0:R,onSlideEnd:o?void 0:E,onHomeKeyDown:()=>!o&&T(r,0,{commit:!0}),onEndKeyDown:()=>!o&&T(s,w.length-1,{commit:!0}),onStepKeyDown:({event:D,direction:O})=>{if(!o){const F=IY.includes(D.key)||D.shiftKey&&$Y.includes(D.key)?10:1,U=y.current,Y=w[U],V=i*F*O;T(Y+V,U,{commit:!0})}}})})})})});zY.displayName=Nv;var[BY,UY]=jY(Nv,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ike=_.forwardRef((t,e)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:c,onStepKeyDown:u,...f}=t,[l,d]=_.useState(null),m=tt(e,w=>d(w)),p=_.useRef(),h=ka(s),y=h==="ltr",g=y&&!i||!y&&i;function v(w){const x=p.current||l.getBoundingClientRect(),A=[0,x.width],R=g$(A,g?[n,r]:[r,n]);return p.current=x,R(w-x.left)}return P.jsx(BY,{scope:t.__scopeSlider,startEdge:g?"left":"right",endEdge:g?"right":"left",direction:g?1:-1,size:"width",children:P.jsx(HY,{dir:h,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const x=v(w.clientX);a==null||a(x)},onSlideMove:w=>{const x=v(w.clientX);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,c==null||c()},onStepKeyDown:w=>{const A=FY[g?"from-left":"from-right"].includes(w.key);u==null||u({event:w,direction:A?-1:1})}})})}),oke=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:o,onStepKeyDown:c,...u}=t,f=_.useRef(null),l=tt(e,f),d=_.useRef(),m=!s;function p(h){const y=d.current||f.current.getBoundingClientRect(),g=[0,y.height],w=g$(g,m?[r,n]:[n,r]);return d.current=y,w(h-y.top)}return P.jsx(BY,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:P.jsx(HY,{"data-orientation":"vertical",...u,ref:l,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const y=p(h.clientY);i==null||i(y)},onSlideMove:h=>{const y=p(h.clientY);a==null||a(y)},onSlideEnd:()=>{d.current=void 0,o==null||o()},onStepKeyDown:h=>{const g=FY[m?"from-bottom":"from-top"].includes(h.key);c==null||c({event:h,direction:g?-1:1})}})})}),HY=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:o,onStepKeyDown:c,...u}=t,f=AA(Nv,n);return P.jsx(De.span,{...u,ref:e,onKeyDown:me(t.onKeyDown,l=>{l.key==="Home"?(a(l),l.preventDefault()):l.key==="End"?(o(l),l.preventDefault()):IY.concat($Y).includes(l.key)&&(c(l),l.preventDefault())}),onPointerDown:me(t.onPointerDown,l=>{const d=l.target;d.setPointerCapture(l.pointerId),l.preventDefault(),f.thumbs.has(d)?d.focus():r(l)}),onPointerMove:me(t.onPointerMove,l=>{l.target.hasPointerCapture(l.pointerId)&&s(l)}),onPointerUp:me(t.onPointerUp,l=>{const d=l.target;d.hasPointerCapture(l.pointerId)&&(d.releasePointerCapture(l.pointerId),i(l))})})}),VY="SliderTrack",WY=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=AA(VY,n);return P.jsx(De.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:e})});WY.displayName=VY;var bN="SliderRange",GY=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,s=AA(bN,n),i=UY(bN,n),a=_.useRef(null),o=tt(e,a),c=s.values.length,u=s.values.map(d=>KY(d,s.min,s.max)),f=c>1?Math.min(...u):0,l=100-Math.max(...u);return P.jsx(De.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:o,style:{...t.style,[i.startEdge]:f+"%",[i.endEdge]:l+"%"}})});GY.displayName=bN;var wN="SliderThumb",qY=_.forwardRef((t,e)=>{const n=nke(t.__scopeSlider),[r,s]=_.useState(null),i=tt(e,o=>s(o)),a=_.useMemo(()=>r?n().findIndex(o=>o.ref.current===r):-1,[n,r]);return P.jsx(ake,{...t,ref:i,index:a})}),ake=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:s,...i}=t,a=AA(wN,n),o=UY(wN,n),[c,u]=_.useState(null),f=tt(e,v=>u(v)),l=c?!!c.closest("form"):!0,d=g_(c),m=a.values[r],p=m===void 0?0:KY(m,a.min,a.max),h=uke(r,a.values.length),y=d==null?void 0:d[o.size],g=y?fke(y,p,o.direction):0;return _.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),P.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[o.startEdge]:`calc(${p}% + ${g}px)`},children:[P.jsx(yN.ItemSlot,{scope:t.__scopeSlider,children:P.jsx(De.span,{role:"slider","aria-label":t["aria-label"]||h,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:me(t.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),l&&P.jsx(lke,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),value:m},r)]})});qY.displayName=wN;var lke=t=>{const{value:e,...n}=t,r=_.useRef(null),s=Cv(e);return _.useEffect(()=>{const i=r.current,a=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&c){const u=new Event("input",{bubbles:!0});c.call(i,e),i.dispatchEvent(u)}},[s,e]),P.jsx("input",{style:{display:"none"},...n,ref:r,defaultValue:e})};function cke(t=[],e,n){const r=[...t];return r[n]=e,r.sort((s,i)=>s-i)}function KY(t,e,n){const i=100/(n-e)*(t-e);return e0(i,[0,100])}function uke(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function dke(t,e){if(t.length===1)return 0;const n=t.map(s=>Math.abs(s-e)),r=Math.min(...n);return n.indexOf(r)}function fke(t,e,n){const r=t/2,i=g$([0,50],[0,r]);return(r-i(e)*n)*n}function hke(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function pke(t,e){if(e>0){const n=hke(t);return Math.min(...n)>=e}return!0}function g$(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function mke(t){return(String(t).split(".")[1]||"").length}function gke(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var YY=zY,vke=WY,yke=GY,bke=qY;const wke=_.forwardRef(({className:t,...e},n)=>P.jsxs(YY,{ref:n,className:ce("relative flex w-full touch-none select-none items-center",t),...e,children:[P.jsx(vke,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:P.jsx(yke,{className:"absolute h-full bg-primary"})}),P.jsx(bke,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));wke.displayName=YY.displayName;var v$="Switch",[_ke,gUe]=Pn(v$),[xke,Ske]=_ke(v$),XY=_.forwardRef((t,e)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:o,value:c="on",onCheckedChange:u,...f}=t,[l,d]=_.useState(null),m=tt(e,v=>d(v)),p=_.useRef(!1),h=l?!!l.closest("form"):!0,[y=!1,g]=sr({prop:s,defaultProp:i,onChange:u});return P.jsxs(xke,{scope:n,checked:y,disabled:o,children:[P.jsx(De.button,{type:"button",role:"switch","aria-checked":y,"aria-required":a,"data-state":JY(y),"data-disabled":o?"":void 0,disabled:o,value:c,...f,ref:m,onClick:me(t.onClick,v=>{g(w=>!w),h&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})}),h&&P.jsx(Eke,{control:l,bubbles:!p.current,name:r,value:c,checked:y,required:a,disabled:o,style:{transform:"translateX(-100%)"}})]})});XY.displayName=v$;var QY="SwitchThumb",ZY=_.forwardRef((t,e)=>{const{__scopeSwitch:n,...r}=t,s=Ske(QY,n);return P.jsx(De.span,{"data-state":JY(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:e})});ZY.displayName=QY;var Eke=t=>{const{control:e,checked:n,bubbles:r=!0,...s}=t,i=_.useRef(null),a=Cv(n),o=g_(e);return _.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,l=Object.getOwnPropertyDescriptor(u,"checked").set;if(a!==n&&l){const d=new Event("click",{bubbles:r});l.call(c,n),c.dispatchEvent(d)}},[a,n,r]),P.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:i,style:{...t.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function JY(t){return t?"checked":"unchecked"}var eX=XY,Cke=ZY;const Ake=_.forwardRef(({className:t,...e},n)=>P.jsx(eX,{className:ce("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:n,children:P.jsx(Cke,{className:ce("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Ake.displayName=eX.displayName;const Rke=_.forwardRef(({className:t,...e},n)=>P.jsx("div",{className:"relative w-full overflow-auto",children:P.jsx("table",{ref:n,className:ce("w-full caption-bottom text-sm",t),...e})}));Rke.displayName="Table";const Pke=_.forwardRef(({className:t,...e},n)=>P.jsx("thead",{ref:n,className:ce("[&_tr]:border-b",t),...e}));Pke.displayName="TableHeader";const Tke=_.forwardRef(({className:t,...e},n)=>P.jsx("tbody",{ref:n,className:ce("[&_tr:last-child]:border-0",t),...e}));Tke.displayName="TableBody";const kke=_.forwardRef(({className:t,...e},n)=>P.jsx("tfoot",{ref:n,className:ce("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));kke.displayName="TableFooter";const Dke=_.forwardRef(({className:t,...e},n)=>P.jsx("tr",{ref:n,className:ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));Dke.displayName="TableRow";const Nke=_.forwardRef(({className:t,...e},n)=>P.jsx("th",{ref:n,className:ce("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));Nke.displayName="TableHead";const Oke=_.forwardRef(({className:t,...e},n)=>P.jsx("td",{ref:n,className:ce("py-2 px-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Oke.displayName="TableCell";const Mke=_.forwardRef(({className:t,...e},n)=>P.jsx("caption",{ref:n,className:ce("mt-4 text-sm text-muted-foreground",t),...e}));Mke.displayName="TableCaption";var y$="Tabs",[Lke,vUe]=Pn(y$,[Cl]),tX=Cl(),[Ike,b$]=Lke(y$),nX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:o,activationMode:c="automatic",...u}=t,f=ka(o),[l,d]=sr({prop:r,onChange:s,defaultProp:i});return P.jsx(Ike,{scope:n,baseId:Hr(),value:l,onValueChange:d,orientation:a,dir:f,activationMode:c,children:P.jsx(De.div,{dir:f,"data-orientation":a,...u,ref:e})})});nX.displayName=y$;var rX="TabsList",sX=_.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...s}=t,i=b$(rX,n),a=tX(n);return P.jsx(__,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:P.jsx(De.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:e})})});sX.displayName=rX;var iX="TabsTrigger",oX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=t,a=b$(iX,n),o=tX(n),c=cX(a.baseId,r),u=uX(a.baseId,r),f=r===a.value;return P.jsx(x_,{asChild:!0,...o,focusable:!s,active:f,children:P.jsx(De.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":u,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:e,onMouseDown:me(t.onMouseDown,l=>{!s&&l.button===0&&l.ctrlKey===!1?a.onValueChange(r):l.preventDefault()}),onKeyDown:me(t.onKeyDown,l=>{[" ","Enter"].includes(l.key)&&a.onValueChange(r)}),onFocus:me(t.onFocus,()=>{const l=a.activationMode!=="manual";!f&&!s&&l&&a.onValueChange(r)})})})});oX.displayName=iX;var aX="TabsContent",lX=_.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=t,o=b$(aX,n),c=cX(o.baseId,r),u=uX(o.baseId,r),f=r===o.value,l=_.useRef(f);return _.useEffect(()=>{const d=requestAnimationFrame(()=>l.current=!1);return()=>cancelAnimationFrame(d)},[]),P.jsx(Un,{present:s||f,children:({present:d})=>P.jsx(De.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:u,tabIndex:0,...a,ref:e,style:{...t.style,animationDuration:l.current?"0s":void 0},children:d&&i})})});lX.displayName=aX;function cX(t,e){return`${t}-trigger-${e}`}function uX(t,e){return`${t}-content-${e}`}var $ke=nX,dX=sX,fX=oX,hX=lX;const yUe=$ke,Fke=_.forwardRef(({className:t,...e},n)=>P.jsx(dX,{ref:n,className:ce("inline-flex h-9 items-center justify-center rounded-lg bg-accent p-1 text-muted-foreground",t),...e}));Fke.displayName=dX.displayName;const jke=_.forwardRef(({className:t,...e},n)=>P.jsx(fX,{ref:n,className:ce("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...e}));jke.displayName=fX.displayName;const zke=_.forwardRef(({className:t,...e},n)=>P.jsx(hX,{ref:n,className:ce("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));zke.displayName=hX.displayName;const pX=_.forwardRef(({className:t,...e},n)=>P.jsx("textarea",{className:ce("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...e}));pX.displayName="Textarea";var w$="ToastProvider",[_$,Bke,Uke]=qc("Toast"),[mX,bUe]=Pn("Toast",[Uke]),[Hke,RA]=mX(w$),gX=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=t,[o,c]=_.useState(null),[u,f]=_.useState(0),l=_.useRef(!1),d=_.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${w$}\`. Expected non-empty \`string\`.`),P.jsx(_$.Provider,{scope:e,children:P.jsx(Hke,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:o,onViewportChange:c,onToastAdd:_.useCallback(()=>f(m=>m+1),[]),onToastRemove:_.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:l,isClosePausedRef:d,children:a})})};gX.displayName=w$;var vX="ToastViewport",Vke=["F8"],_N="toast.viewportPause",xN="toast.viewportResume",yX=_.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=Vke,label:s="Notifications ({hotkey})",...i}=t,a=RA(vX,n),o=Bke(n),c=_.useRef(null),u=_.useRef(null),f=_.useRef(null),l=_.useRef(null),d=tt(e,l,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=a.toastCount>0;_.useEffect(()=>{const y=g=>{var w;r.every(x=>g[x]||g.code===x)&&((w=l.current)==null||w.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),_.useEffect(()=>{const y=c.current,g=l.current;if(p&&y&&g){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(_N);g.dispatchEvent(k),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(xN);g.dispatchEvent(k),a.isClosePausedRef.current=!1}},x=k=>{!y.contains(k.relatedTarget)&&w()},A=()=>{y.contains(document.activeElement)||w()};return y.addEventListener("focusin",v),y.addEventListener("focusout",x),y.addEventListener("pointermove",v),y.addEventListener("pointerleave",A),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{y.removeEventListener("focusin",v),y.removeEventListener("focusout",x),y.removeEventListener("pointermove",v),y.removeEventListener("pointerleave",A),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[p,a.isClosePausedRef]);const h=_.useCallback(({tabbingDirection:y})=>{const v=o().map(w=>{const x=w.ref.current,A=[x,...rDe(x)];return y==="forwards"?A:A.reverse()});return(y==="forwards"?v.reverse():v).flat()},[o]);return _.useEffect(()=>{const y=l.current;if(y){const g=v=>{var A,k,R;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const E=document.activeElement,T=v.shiftKey;if(v.target===y&&T){(A=u.current)==null||A.focus();return}const L=h({tabbingDirection:T?"backwards":"forwards"}),I=L.findIndex(F=>F===E);HT(L.slice(I+1))?v.preventDefault():T?(k=u.current)==null||k.focus():(R=f.current)==null||R.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[o,h]),P.jsxs(Rhe,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&P.jsx(SN,{ref:u,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"forwards"});HT(y)}}),P.jsx(_$.Slot,{scope:n,children:P.jsx(De.ol,{tabIndex:-1,...i,ref:d})}),p&&P.jsx(SN,{ref:f,onFocusFromOutsideViewport:()=>{const y=h({tabbingDirection:"backwards"});HT(y)}})]})});yX.displayName=vX;var bX="ToastFocusProxy",SN=_.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=RA(bX,n);return P.jsx(T_,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:a=>{var u;const o=a.relatedTarget;!((u=i.viewport)!=null&&u.contains(o))&&r()}})});SN.displayName=bX;var PA="Toast",Wke="toast.swipeStart",Gke="toast.swipeMove",qke="toast.swipeCancel",Kke="toast.swipeEnd",wX=_.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=t,[o=!0,c]=sr({prop:r,defaultProp:s,onChange:i});return P.jsx(Un,{present:n||o,children:P.jsx(Qke,{open:o,...a,ref:e,onClose:()=>c(!1),onPause:Bt(t.onPause),onResume:Bt(t.onResume),onSwipeStart:me(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(t.onSwipeMove,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${l}px`)}),onSwipeCancel:me(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(t.onSwipeEnd,u=>{const{x:f,y:l}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${l}px`),c(!1)})})})});wX.displayName=PA;var[Yke,Xke]=mX(PA,{onClose(){}}),Qke=_.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:o,onPause:c,onResume:u,onSwipeStart:f,onSwipeMove:l,onSwipeCancel:d,onSwipeEnd:m,...p}=t,h=RA(PA,n),[y,g]=_.useState(null),v=tt(e,F=>g(F)),w=_.useRef(null),x=_.useRef(null),A=s||h.duration,k=_.useRef(0),R=_.useRef(A),E=_.useRef(0),{onToastAdd:T,onToastRemove:D}=h,O=Bt(()=>{var U;(y==null?void 0:y.contains(document.activeElement))&&((U=h.viewport)==null||U.focus()),a()}),L=_.useCallback(F=>{!F||F===1/0||(window.clearTimeout(E.current),k.current=new Date().getTime(),E.current=window.setTimeout(O,F))},[O]);_.useEffect(()=>{const F=h.viewport;if(F){const U=()=>{L(R.current),u==null||u()},Y=()=>{const V=new Date().getTime()-k.current;R.current=R.current-V,window.clearTimeout(E.current),c==null||c()};return F.addEventListener(_N,Y),F.addEventListener(xN,U),()=>{F.removeEventListener(_N,Y),F.removeEventListener(xN,U)}}},[h.viewport,A,c,u,L]),_.useEffect(()=>{i&&!h.isClosePausedRef.current&&L(A)},[i,A,h.isClosePausedRef,L]),_.useEffect(()=>(T(),()=>D()),[T,D]);const I=_.useMemo(()=>y?RX(y):null,[y]);return h.viewport?P.jsxs(P.Fragment,{children:[I&&P.jsx(Zke,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:I}),P.jsx(Yke,{scope:n,onClose:O,children:ks.createPortal(P.jsx(_$.ItemSlot,{scope:n,children:P.jsx(Ahe,{asChild:!0,onEscapeKeyDown:me(o,()=>{h.isFocusedToastEscapeKeyDownRef.current||O(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:P.jsx(De.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":h.swipeDirection,...p,ref:v,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:me(t.onKeyDown,F=>{F.key==="Escape"&&(o==null||o(F.nativeEvent),F.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:me(t.onPointerDown,F=>{F.button===0&&(w.current={x:F.clientX,y:F.clientY})}),onPointerMove:me(t.onPointerMove,F=>{if(!w.current)return;const U=F.clientX-w.current.x,Y=F.clientY-w.current.y,V=!!x.current,H=["left","right"].includes(h.swipeDirection),ee=["left","up"].includes(h.swipeDirection)?Math.min:Math.max,re=H?ee(0,U):0,X=H?0:ee(0,Y),q=F.pointerType==="touch"?10:2,K={x:re,y:X},Z={originalEvent:F,delta:K};V?(x.current=K,mS(Gke,l,Z,{discrete:!1})):BB(K,h.swipeDirection,q)?(x.current=K,mS(Wke,f,Z,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(U)>q||Math.abs(Y)>q)&&(w.current=null)}),onPointerUp:me(t.onPointerUp,F=>{const U=x.current,Y=F.target;if(Y.hasPointerCapture(F.pointerId)&&Y.releasePointerCapture(F.pointerId),x.current=null,w.current=null,U){const V=F.currentTarget,H={originalEvent:F,delta:U};BB(U,h.swipeDirection,h.swipeThreshold)?mS(Kke,m,H,{discrete:!0}):mS(qke,d,H,{discrete:!0}),V.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Zke=t=>{const{__scopeToast:e,children:n,...r}=t,s=RA(PA,e),[i,a]=_.useState(!1),[o,c]=_.useState(!1);return tDe(()=>a(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),o?null:P.jsx(wv,{asChild:!0,children:P.jsx(T_,{...r,children:i&&P.jsxs(P.Fragment,{children:[s.label," ",n]})})})},Jke="ToastTitle",_X=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});_X.displayName=Jke;var eDe="ToastDescription",xX=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return P.jsx(De.div,{...r,ref:e})});xX.displayName=eDe;var SX="ToastAction",EX=_.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?P.jsx(AX,{altText:n,asChild:!0,children:P.jsx(x$,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${SX}\`. Expected non-empty \`string\`.`),null)});EX.displayName=SX;var CX="ToastClose",x$=_.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=Xke(CX,n);return P.jsx(AX,{asChild:!0,children:P.jsx(De.button,{type:"button",...r,ref:e,onClick:me(t.onClick,s.onClose)})})});x$.displayName=CX;var AX=_.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return P.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function RX(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),nDe(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...RX(r))}}),e}function mS(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?Hb(s,i):s.dispatchEvent(i)}var BB=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function tDe(t=()=>{}){const e=Bt(t);Mn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function nDe(t){return t.nodeType===t.ELEMENT_NODE}function rDe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function HT(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var sDe=gX,PX=yX,TX=wX,kX=_X,DX=xX,NX=EX,OX=x$;const iDe=sDe,MX=_.forwardRef(({className:t,...e},n)=>P.jsx(PX,{ref:n,className:ce("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));MX.displayName=PX.displayName;const oDe=zo("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground",success:"success bg-green-300 text-success-foreground border-green-400 group"},position:{center:"bottom-0 mx-auto w-auto sm:bottom-0"}},defaultVariants:{variant:"default"}}),LX=_.forwardRef(({className:t,variant:e,...n},r)=>P.jsx(TX,{ref:r,className:ce(oDe({variant:e}),t),...n}));LX.displayName=TX.displayName;const aDe=_.forwardRef(({className:t,...e},n)=>P.jsx(NX,{ref:n,className:ce("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));aDe.displayName=NX.displayName;const IX=_.forwardRef(({className:t,...e},n)=>P.jsx(OX,{ref:n,className:ce("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:P.jsx(pL,{className:"w-4 h-4"})}));IX.displayName=OX.displayName;const $X=_.forwardRef(({className:t,...e},n)=>P.jsx(kX,{ref:n,className:ce("text-sm font-semibold",t),...e}));$X.displayName=kX.displayName;const FX=_.forwardRef(({className:t,...e},n)=>P.jsx(DX,{ref:n,className:ce("text-sm opacity-90",t),...e}));FX.displayName=DX.displayName;const lDe=3,cDe=1e6;let VT=0;function uDe(){return VT=(VT+1)%Number.MAX_SAFE_INTEGER,VT.toString()}const WT=new Map,UB=t=>{if(WT.has(t))return;const e=setTimeout(()=>{WT.delete(t),mb({type:"REMOVE_TOAST",toastId:t})},cDe);WT.set(t,e)},dDe=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,lDe)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?UB(n):t.toasts.forEach(r=>{UB(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},WS=[];let GS={toasts:[]};function mb(t){GS=dDe(GS,t),WS.forEach(e=>{e(GS)})}function fDe({...t}){const e=uDe(),n=s=>mb({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>mb({type:"DISMISS_TOAST",toastId:e});return mb({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function jX(){const[t,e]=_.useState(GS);return _.useEffect(()=>(WS.push(e),()=>{const n=WS.indexOf(e);n>-1&&WS.splice(n,1)}),[t]),{...t,toast:fDe,dismiss:n=>mb({type:"DISMISS_TOAST",toastId:n})}}function zX(){const{toasts:t}=jX();return P.jsxs(iDe,{swipeDirection:"down",children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return P.jsxs(LX,{...i,children:[P.jsxs("div",{className:"grid gap-1",children:[n&&P.jsx($X,{children:n}),r&&P.jsx(FX,{children:r})]}),s,P.jsx(IX,{})]},e)}),P.jsx(MX,{className:"bottom-0 w-auto mx-auto sm:bottom-0 sm:left-0 sm:right-0"})]})}var hDe="Toggle",S$=_.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:s,...i}=t,[a=!1,o]=sr({prop:n,onChange:s,defaultProp:r});return P.jsx(De.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":t.disabled?"":void 0,...i,ref:e,onClick:me(t.onClick,()=>{t.disabled||o(!a)})})});S$.displayName=hDe;var BX=S$;const UX=zo("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),pDe=_.forwardRef(({className:t,variant:e,size:n,...r},s)=>P.jsx(BX,{ref:s,className:ce(UX({variant:e,size:n,className:t})),...r}));pDe.displayName=BX.displayName;var Ov="ToggleGroup",[HX,wUe]=Pn(Ov,[Cl]),VX=Cl(),E$=se.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const s=r;return P.jsx(mDe,{...s,ref:e})}if(n==="multiple"){const s=r;return P.jsx(gDe,{...s,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Ov}\``)});E$.displayName=Ov;var[WX,GX]=HX(Ov),mDe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a,o]=sr({prop:n,defaultProp:r,onChange:s});return P.jsx(WX,{scope:t.__scopeToggleGroup,type:"single",value:a?[a]:[],onItemActivate:o,onItemDeactivate:se.useCallback(()=>o(""),[o]),children:P.jsx(qX,{...i,ref:e})})}),gDe=se.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=t,[a=[],o]=sr({prop:n,defaultProp:r,onChange:s}),c=se.useCallback(f=>o((l=[])=>[...l,f]),[o]),u=se.useCallback(f=>o((l=[])=>l.filter(d=>d!==f)),[o]);return P.jsx(WX,{scope:t.__scopeToggleGroup,type:"multiple",value:a,onItemActivate:c,onItemDeactivate:u,children:P.jsx(qX,{...i,ref:e})})});E$.displayName=Ov;var[vDe,yDe]=HX(Ov),qX=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:s=!0,orientation:i,dir:a,loop:o=!0,...c}=t,u=VX(n),f=ka(a),l={role:"group",dir:f,...c};return P.jsx(vDe,{scope:n,rovingFocus:s,disabled:r,children:s?P.jsx(__,{asChild:!0,...u,orientation:i,dir:f,loop:o,children:P.jsx(De.div,{...l,ref:e})}):P.jsx(De.div,{...l,ref:e})})}),EC="ToggleGroupItem",KX=se.forwardRef((t,e)=>{const n=GX(EC,t.__scopeToggleGroup),r=yDe(EC,t.__scopeToggleGroup),s=VX(t.__scopeToggleGroup),i=n.value.includes(t.value),a=r.disabled||t.disabled,o={...t,pressed:i,disabled:a},c=se.useRef(null);return r.rovingFocus?P.jsx(x_,{asChild:!0,...s,focusable:!a,active:i,ref:c,children:P.jsx(HB,{...o,ref:e})}):P.jsx(HB,{...o,ref:e})});KX.displayName=EC;var HB=se.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...s}=t,i=GX(EC,n),a={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},o=i.type==="single"?a:void 0;return P.jsx(S$,{...o,...s,ref:e,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),YX=E$,XX=KX;const QX=_.createContext({size:"default",variant:"default"}),bDe=_.forwardRef(({className:t,variant:e,size:n,children:r,...s},i)=>P.jsx(YX,{ref:i,className:ce("flex items-center justify-center gap-1",t),...s,children:P.jsx(QX.Provider,{value:{variant:e,size:n},children:r})}));bDe.displayName=YX.displayName;const wDe=_.forwardRef(({className:t,children:e,variant:n,size:r,...s},i)=>{const a=_.useContext(QX);return P.jsx(XX,{ref:i,className:ce(UX({variant:a.variant||n,size:a.size||r}),t),...s,children:e})});wDe.displayName=XX.displayName;var[TA,_Ue]=Pn("Tooltip",[El]),kA=El(),ZX="TooltipProvider",_De=700,EN="tooltip.open",[xDe,C$]=TA(ZX),JX=t=>{const{__scopeTooltip:e,delayDuration:n=_De,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[a,o]=_.useState(!0),c=_.useRef(!1),u=_.useRef(0);return _.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),P.jsx(xDe,{scope:e,isOpenDelayed:a,delayDuration:n,onOpen:_.useCallback(()=>{window.clearTimeout(u.current),o(!1)},[]),onClose:_.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:_.useCallback(f=>{c.current=f},[]),disableHoverableContent:s,children:i})};JX.displayName=ZX;var DA="Tooltip",[SDe,NA]=TA(DA),eQ=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:s=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:o}=t,c=C$(DA,t.__scopeTooltip),u=kA(e),[f,l]=_.useState(null),d=Hr(),m=_.useRef(0),p=a??c.disableHoverableContent,h=o??c.delayDuration,y=_.useRef(!1),[g=!1,v]=sr({prop:r,defaultProp:s,onChange:R=>{R?(c.onOpen(),document.dispatchEvent(new CustomEvent(EN))):c.onClose(),i==null||i(R)}}),w=_.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),x=_.useCallback(()=>{window.clearTimeout(m.current),y.current=!1,v(!0)},[v]),A=_.useCallback(()=>{window.clearTimeout(m.current),v(!1)},[v]),k=_.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,v(!0)},h)},[h,v]);return _.useEffect(()=>()=>window.clearTimeout(m.current),[]),P.jsx(aA,{...u,children:P.jsx(SDe,{scope:e,contentId:d,open:g,stateAttribute:w,trigger:f,onTriggerChange:l,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayed?k():x()},[c.isOpenDelayed,k,x]),onTriggerLeave:_.useCallback(()=>{p?A():window.clearTimeout(m.current)},[A,p]),onOpen:x,onClose:A,disableHoverableContent:p,children:n})})};eQ.displayName=DA;var CN="TooltipTrigger",tQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=NA(CN,n),i=C$(CN,n),a=kA(n),o=_.useRef(null),c=tt(e,o,s.onTriggerChange),u=_.useRef(!1),f=_.useRef(!1),l=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),P.jsx(Pv,{asChild:!0,...a,children:P.jsx(De.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:me(t.onPointerMove,d=>{d.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),f.current=!0)}),onPointerLeave:me(t.onPointerLeave,()=>{s.onTriggerLeave(),f.current=!1}),onPointerDown:me(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:me(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:me(t.onBlur,s.onClose),onClick:me(t.onClick,s.onClose)})})});tQ.displayName=CN;var EDe="TooltipPortal",[xUe,CDe]=TA(EDe,{forceMount:void 0}),dv="TooltipContent",nQ=_.forwardRef((t,e)=>{const n=CDe(dv,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,a=NA(dv,t.__scopeTooltip);return P.jsx(Un,{present:r||a.open,children:a.disableHoverableContent?P.jsx(rQ,{side:s,...i,ref:e}):P.jsx(ADe,{side:s,...i,ref:e})})}),ADe=_.forwardRef((t,e)=>{const n=NA(dv,t.__scopeTooltip),r=C$(dv,t.__scopeTooltip),s=_.useRef(null),i=tt(e,s),[a,o]=_.useState(null),{trigger:c,onClose:u}=n,f=s.current,{onPointerInTransitChange:l}=r,d=_.useCallback(()=>{o(null),l(!1)},[l]),m=_.useCallback((p,h)=>{const y=p.currentTarget,g={x:p.clientX,y:p.clientY},v=kDe(g,y.getBoundingClientRect()),w=DDe(g,v),x=NDe(h.getBoundingClientRect()),A=MDe([...w,...x]);o(A),l(!0)},[l]);return _.useEffect(()=>()=>d(),[d]),_.useEffect(()=>{if(c&&f){const p=y=>m(y,f),h=y=>m(y,c);return c.addEventListener("pointerleave",p),f.addEventListener("pointerleave",h),()=>{c.removeEventListener("pointerleave",p),f.removeEventListener("pointerleave",h)}}},[c,f,m,d]),_.useEffect(()=>{if(a){const p=h=>{const y=h.target,g={x:h.clientX,y:h.clientY},v=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),w=!ODe(g,a);v?d():w&&(d(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,f,a,u,d]),P.jsx(rQ,{...t,ref:i})}),[RDe,PDe]=TA(DA,{isInside:!1}),rQ=_.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...o}=t,c=NA(dv,n),u=kA(n),{onClose:f}=c;return _.useEffect(()=>(document.addEventListener(EN,f),()=>document.removeEventListener(EN,f)),[f]),_.useEffect(()=>{if(c.trigger){const l=d=>{const m=d.target;m!=null&&m.contains(c.trigger)&&f()};return window.addEventListener("scroll",l,{capture:!0}),()=>window.removeEventListener("scroll",l,{capture:!0})}},[c.trigger,f]),P.jsx(Yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:l=>l.preventDefault(),onDismiss:f,children:P.jsxs(b_,{"data-state":c.stateAttribute,...u,...o,ref:e,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[P.jsx(iL,{children:r}),P.jsx(RDe,{scope:n,isInside:!0,children:P.jsx(h7,{id:c.contentId,role:"tooltip",children:s||r})})]})})});nQ.displayName=dv;var sQ="TooltipArrow",TDe=_.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=kA(n);return PDe(sQ,n).isInside?null:P.jsx(w_,{...s,...r,ref:e})});TDe.displayName=sQ;function kDe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function DDe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function NDe(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function ODe(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,a=e.length-1;ir!=f>r&&n<(u-o)*(r-c)/(f-c)+o&&(s=!s)}return s}function MDe(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),LDe(e)}function LDe(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var IDe=JX,$De=eQ,FDe=tQ,iQ=nQ;const jDe=IDe,SUe=$De,EUe=FDe,zDe=_.forwardRef(({className:t,sideOffset:e=4,...n},r)=>P.jsx(iQ,{ref:r,sideOffset:e,className:ce("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));zDe.displayName=iQ.displayName;/** * @remix-run/router v1.23.0 * * Copyright (c) Remix Software Inc. @@ -247,8 +247,8 @@ Defaulting to \`null\`.`}var J7=Y7,lPe=Q7;const cPe=_.forwardRef(({className:t,v * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Gn(){return Gn=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function fv(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function FDe(){return Math.random().toString(36).substr(2,8)}function UB(t,e){return{usr:t.state,key:t.key,idx:e}}function t0(t,e,n,r){return n===void 0&&(n=null),Gn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?zd(e):e,{state:n,key:e&&e.key||r||FDe()})}function Zh(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function zd(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function jDe(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,o=Er.Pop,c=null,u=f();u==null&&(u=0,a.replaceState(Gn({},a.state,{idx:u}),""));function f(){return(a.state||{idx:null}).idx}function l(){o=Er.Pop;let y=f(),g=y==null?null:y-u;u=y,c&&c({action:o,location:h.location,delta:g})}function d(y,g){o=Er.Push;let v=t0(h.location,y,g);u=f()+1;let w=UB(v,u),x=h.createHref(v);try{a.pushState(w,"",x)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(x)}i&&c&&c({action:o,location:h.location,delta:1})}function m(y,g){o=Er.Replace;let v=t0(h.location,y,g);u=f();let w=UB(v,u),x=h.createHref(v);a.replaceState(w,"",x),i&&c&&c({action:o,location:h.location,delta:0})}function p(y){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof y=="string"?y:Zh(y);return v=v.replace(/ $/,"%20"),Dt(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let h={get action(){return o},get location(){return t(s,a)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(BB,l),c=y,()=>{s.removeEventListener(BB,l),c=null}},createHref(y){return e(s,y)},createURL:p,encodeLocation(y){let g=p(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:m,go(y){return a.go(y)}};return h}var fn;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(fn||(fn={}));const zDe=new Set(["lazy","caseSensitive","path","id","index","children"]);function BDe(t){return t.index===!0}function EC(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((s,i)=>{let a=[...n,String(i)],o=typeof s.id=="string"?s.id:a.join("-");if(Dt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Dt(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),BDe(s)){let c=Gn({},s,e(s),{id:o});return r[o]=c,c}else{let c=Gn({},s,e(s),{id:o,children:void 0});return r[o]=c,s.children&&(c.children=EC(s.children,e,a,r)),c}})}function pf(t,e,n){return n===void 0&&(n="/"),GS(t,e,n,!1)}function GS(t,e,n,r){let s=typeof e=="string"?zd(e):e,i=Rd(s.pathname||"/",n);if(i==null)return null;let a=nQ(t);HDe(a);let o=null;for(let c=0;o==null&&c{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(Dt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Dc([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(Dt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),nQ(i.children,e,f,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:XDe(u,i.index),routesMeta:f})};return t.forEach((i,a)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))s(i,a);else for(let c of rQ(i.path))s(i,a,c)}),e}function rQ(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=rQ(r.join("/")),o=[];return o.push(...a.map(c=>c===""?i:[i,c].join("/"))),s&&o.push(...a),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function HDe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:QDe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const VDe=/^:[\w-]+$/,WDe=3,GDe=2,qDe=1,KDe=10,YDe=-2,HB=t=>t==="*";function XDe(t,e){let n=t.split("/"),r=n.length;return n.some(HB)&&(r+=YDe),e&&(r+=GDe),n.filter(s=>!HB(s)).reduce((s,i)=>s+(VDe.test(i)?WDe:i===""?qDe:KDe),r)}function QDe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function ZDe(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,s={},i="/",a=[];for(let o=0;o{let{paramName:d,isOptional:m}=f;if(d==="*"){let h=o[l]||"";a=i.slice(0,i.length-h.length).replace(/(.)\/+$/,"$1")}const p=o[l];return m&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:t}}function JDe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),fv(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function eNe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return fv(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Rd(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function tNe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?zd(t):t;return{pathname:n?n.startsWith("/")?n:nNe(n,e):e,search:sNe(r),hash:iNe(s)}}function nNe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function WT(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function sQ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function NA(t,e){let n=sQ(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function OA(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=zd(t):(s=Gn({},t),Dt(!s.pathname||!s.pathname.includes("?"),WT("?","pathname","search",s)),Dt(!s.pathname||!s.pathname.includes("#"),WT("#","pathname","hash",s)),Dt(!s.search||!s.search.includes("#"),WT("#","search","hash",s)));let i=t===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=n;else{let l=e.length-1;if(!r&&a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),l-=1;s.pathname=d.join("/")}o=l>=0?e[l]:"/"}let c=tNe(s,o),u=a&&a!=="/"&&a.endsWith("/"),f=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const Dc=t=>t.join("/").replace(/\/\/+/g,"/"),rNe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sNe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,iNe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class CC{constructor(e,n,r,s){s===void 0&&(s=!1),this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function n0(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const iQ=["post","put","patch","delete"],oNe=new Set(iQ),aNe=["get",...iQ],lNe=new Set(aNe),cNe=new Set([301,302,303,307,308]),uNe=new Set([307,308]),GT={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},dNe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},em={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},E$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fNe=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),oQ="remix-router-transitions";function hNe(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Dt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let te=t.detectErrorBoundary;s=oe=>({hasErrorBoundary:te(oe)})}else s=fNe;let i={},a=EC(t.routes,s,void 0,i),o,c=t.basename||"/",u=t.dataStrategy||vNe,f=t.patchRoutesOnNavigation,l=Gn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),d=null,m=new Set,p=null,h=null,y=null,g=t.hydrationData!=null,v=pf(a,t.history.location,c),w=!1,x=null;if(v==null&&!f){let te=di(404,{pathname:t.history.location.pathname}),{matches:oe,route:he}=t4(a);v=oe,x={[he.id]:te}}v&&!t.hydrationData&&ln(v,a,t.history.location.pathname).active&&(v=null);let A;if(v)if(v.some(te=>te.route.lazy))A=!1;else if(!v.some(te=>te.route.loader))A=!0;else if(l.v7_partialHydration){let te=t.hydrationData?t.hydrationData.loaderData:null,oe=t.hydrationData?t.hydrationData.errors:null;if(oe){let he=v.findIndex(Ce=>oe[Ce.route.id]!==void 0);A=v.slice(0,he+1).every(Ce=>!AN(Ce.route,te,oe))}else A=v.every(he=>!AN(he.route,te,oe))}else A=t.hydrationData!=null;else if(A=!1,v=[],l.v7_partialHydration){let te=ln(null,a,t.history.location.pathname);te.active&&te.matches&&(w=!0,v=te.matches)}let k,R={historyAction:t.history.action,location:t.history.location,matches:v,initialized:A,navigation:GT,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=Er.Pop,T=!1,D,O=!1,L=new Map,I=null,F=!1,U=!1,Y=[],V=new Set,H=new Map,ee=0,re=-1,X=new Map,q=new Set,K=new Map,Z=new Map,ue=new Set,de=new Map,ie=new Map,be;function Ae(){if(d=t.history.listen(te=>{let{action:oe,location:he,delta:Ce}=te;if(be){be(),be=void 0;return}fv(ie.size===0||Ce!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Le=ot({currentLocation:R.location,nextLocation:he,historyAction:oe});if(Le&&Ce!=null){let qe=new Promise(st=>{be=st});t.history.go(Ce*-1),it(Le,{state:"blocked",location:he,proceed(){it(Le,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),qe.then(()=>t.history.go(Ce))},reset(){let st=new Map(R.blockers);st.set(Le,em),Ne({blockers:st})}});return}return Qe(oe,he)}),n){DNe(e,L);let te=()=>NNe(e,L);e.addEventListener("pagehide",te),I=()=>e.removeEventListener("pagehide",te)}return R.initialized||Qe(Er.Pop,R.location,{initialHydration:!0}),k}function _e(){d&&d(),I&&I(),m.clear(),D&&D.abort(),R.fetchers.forEach((te,oe)=>bt(oe)),R.blockers.forEach((te,oe)=>Be(oe))}function Me(te){return m.add(te),()=>m.delete(te)}function Ne(te,oe){oe===void 0&&(oe={}),R=Gn({},R,te);let he=[],Ce=[];l.v7_fetcherPersist&&R.fetchers.forEach((Le,qe)=>{Le.state==="idle"&&(ue.has(qe)?Ce.push(qe):he.push(qe))}),ue.forEach(Le=>{!R.fetchers.has(Le)&&!H.has(Le)&&Ce.push(Le)}),[...m].forEach(Le=>Le(R,{deletedFetchers:Ce,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),l.v7_fetcherPersist?(he.forEach(Le=>R.fetchers.delete(Le)),Ce.forEach(Le=>bt(Le))):Ce.forEach(Le=>ue.delete(Le))}function ye(te,oe,he){var Ce,Le;let{flushSync:qe}=he===void 0?{}:he,st=R.actionData!=null&&R.navigation.formMethod!=null&&pa(R.navigation.formMethod)&&R.navigation.state==="loading"&&((Ce=te.state)==null?void 0:Ce._isRedirect)!==!0,Ue;oe.actionData?Object.keys(oe.actionData).length>0?Ue=oe.actionData:Ue=null:st?Ue=R.actionData:Ue=null;let Xe=oe.loaderData?JB(R.loaderData,oe.loaderData,oe.matches||[],oe.errors):R.loaderData,We=R.blockers;We.size>0&&(We=new Map(We),We.forEach((Lt,Rr)=>We.set(Rr,em)));let Je=T===!0||R.navigation.formMethod!=null&&pa(R.navigation.formMethod)&&((Le=te.state)==null?void 0:Le._isRedirect)!==!0;o&&(a=o,o=void 0),F||E===Er.Pop||(E===Er.Push?t.history.push(te,te.state):E===Er.Replace&&t.history.replace(te,te.state));let mt;if(E===Er.Pop){let Lt=L.get(R.location.pathname);Lt&&Lt.has(te.pathname)?mt={currentLocation:R.location,nextLocation:te}:L.has(te.pathname)&&(mt={currentLocation:te,nextLocation:R.location})}else if(O){let Lt=L.get(R.location.pathname);Lt?Lt.add(te.pathname):(Lt=new Set([te.pathname]),L.set(R.location.pathname,Lt)),mt={currentLocation:R.location,nextLocation:te}}Ne(Gn({},oe,{actionData:Ue,loaderData:Xe,historyAction:E,location:te,initialized:!0,navigation:GT,revalidation:"idle",restoreScrollPosition:an(te,oe.matches||R.matches),preventScrollReset:Je,blockers:We}),{viewTransitionOpts:mt,flushSync:qe===!0}),E=Er.Pop,T=!1,O=!1,F=!1,U=!1,Y=[]}async function $e(te,oe){if(typeof te=="number"){t.history.go(te);return}let he=CN(R.location,R.matches,c,l.v7_prependBasename,te,l.v7_relativeSplatPath,oe==null?void 0:oe.fromRouteId,oe==null?void 0:oe.relative),{path:Ce,submission:Le,error:qe}=WB(l.v7_normalizeFormMethod,!1,he,oe),st=R.location,Ue=t0(R.location,Ce,oe&&oe.state);Ue=Gn({},Ue,t.history.encodeLocation(Ue));let Xe=oe&&oe.replace!=null?oe.replace:void 0,We=Er.Push;Xe===!0?We=Er.Replace:Xe===!1||Le!=null&&pa(Le.formMethod)&&Le.formAction===R.location.pathname+R.location.search&&(We=Er.Replace);let Je=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,mt=(oe&&oe.flushSync)===!0,Lt=ot({currentLocation:st,nextLocation:Ue,historyAction:We});if(Lt){it(Lt,{state:"blocked",location:Ue,proceed(){it(Lt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),$e(te,oe)},reset(){let Rr=new Map(R.blockers);Rr.set(Lt,em),Ne({blockers:Rr})}});return}return await Qe(We,Ue,{submission:Le,pendingError:qe,preventScrollReset:Je,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:mt})}function ut(){if(xe(),Ne({revalidation:"loading"}),R.navigation.state!=="submitting"){if(R.navigation.state==="idle"){Qe(R.historyAction,R.location,{startUninterruptedRevalidation:!0});return}Qe(E||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:O===!0})}}async function Qe(te,oe,he){D&&D.abort(),D=null,E=te,F=(he&&he.startUninterruptedRevalidation)===!0,vn(R.location,R.matches),T=(he&&he.preventScrollReset)===!0,O=(he&&he.enableViewTransition)===!0;let Ce=o||a,Le=he&&he.overrideNavigation,qe=he!=null&&he.initialHydration&&R.matches&&R.matches.length>0&&!w?R.matches:pf(Ce,oe,c),st=(he&&he.flushSync)===!0;if(qe&&R.initialized&&!U&&SNe(R.location,oe)&&!(he&&he.submission&&pa(he.submission.formMethod))){ye(oe,{matches:qe},{flushSync:st});return}let Ue=ln(qe,Ce,oe.pathname);if(Ue.active&&Ue.matches&&(qe=Ue.matches),!qe){let{error:yn,notFoundMatches:Wt,route:Hn}=St(oe.pathname);ye(oe,{matches:Wt,loaderData:{},errors:{[Hn.id]:yn}},{flushSync:st});return}D=new AbortController;let Xe=Vp(t.history,oe,D.signal,he&&he.submission),We;if(he&&he.pendingError)We=[mf(qe).route.id,{type:fn.error,error:he.pendingError}];else if(he&&he.submission&&pa(he.submission.formMethod)){let yn=await vt(Xe,oe,he.submission,qe,Ue.active,{replace:he.replace,flushSync:st});if(yn.shortCircuited)return;if(yn.pendingActionResult){let[Wt,Hn]=yn.pendingActionResult;if(Qi(Hn)&&n0(Hn.error)&&Hn.error.status===404){D=null,ye(oe,{matches:yn.matches,loaderData:{},errors:{[Wt]:Hn.error}});return}}qe=yn.matches||qe,We=yn.pendingActionResult,Le=qT(oe,he.submission),st=!1,Ue.active=!1,Xe=Vp(t.history,Xe.url,Xe.signal)}let{shortCircuited:Je,matches:mt,loaderData:Lt,errors:Rr}=await Sn(Xe,oe,qe,Ue.active,Le,he&&he.submission,he&&he.fetcherSubmission,he&&he.replace,he&&he.initialHydration===!0,st,We);Je||(D=null,ye(oe,Gn({matches:mt||qe},e4(We),{loaderData:Lt,errors:Rr})))}async function vt(te,oe,he,Ce,Le,qe){qe===void 0&&(qe={}),xe();let st=TNe(oe,he);if(Ne({navigation:st},{flushSync:qe.flushSync===!0}),Le){let We=await Tn(Ce,oe.pathname,te.signal);if(We.type==="aborted")return{shortCircuited:!0};if(We.type==="error"){let Je=mf(We.partialMatches).route.id;return{matches:We.partialMatches,pendingActionResult:[Je,{type:fn.error,error:We.error}]}}else if(We.matches)Ce=We.matches;else{let{notFoundMatches:Je,error:mt,route:Lt}=St(oe.pathname);return{matches:Je,pendingActionResult:[Lt.id,{type:fn.error,error:mt}]}}}let Ue,Xe=By(Ce,oe);if(!Xe.route.action&&!Xe.route.lazy)Ue={type:fn.error,error:di(405,{method:te.method,pathname:oe.pathname,routeId:Xe.route.id})};else if(Ue=(await Pe("action",R,te,[Xe],Ce,null))[Xe.route.id],te.signal.aborted)return{shortCircuited:!0};if(Ef(Ue)){let We;return qe&&qe.replace!=null?We=qe.replace:We=XB(Ue.response.headers.get("Location"),new URL(te.url),c)===R.location.pathname+R.location.search,await ge(te,Ue,!0,{submission:he,replace:We}),{shortCircuited:!0}}if(ud(Ue))throw di(400,{type:"defer-action"});if(Qi(Ue)){let We=mf(Ce,Xe.route.id);return(qe&&qe.replace)!==!0&&(E=Er.Push),{matches:Ce,pendingActionResult:[We.route.id,Ue]}}return{matches:Ce,pendingActionResult:[Xe.route.id,Ue]}}async function Sn(te,oe,he,Ce,Le,qe,st,Ue,Xe,We,Je){let mt=Le||qT(oe,qe),Lt=qe||st||r4(mt),Rr=!F&&(!l.v7_partialHydration||!Xe);if(Ce){if(Rr){let Vn=Yt(Je);Ne(Gn({navigation:mt},Vn!==void 0?{actionData:Vn}:{}),{flushSync:We})}let $t=await Tn(he,oe.pathname,te.signal);if($t.type==="aborted")return{shortCircuited:!0};if($t.type==="error"){let Vn=mf($t.partialMatches).route.id;return{matches:$t.partialMatches,loaderData:{},errors:{[Vn]:$t.error}}}else if($t.matches)he=$t.matches;else{let{error:Vn,notFoundMatches:eu,route:Kd}=St(oe.pathname);return{matches:eu,loaderData:{},errors:{[Kd.id]:Vn}}}}let yn=o||a,[Wt,Hn]=qB(t.history,R,he,Lt,oe,l.v7_partialHydration&&Xe===!0,l.v7_skipActionErrorRevalidation,U,Y,V,ue,K,q,yn,c,Je);if(nt($t=>!(he&&he.some(Vn=>Vn.route.id===$t))||Wt&&Wt.some(Vn=>Vn.route.id===$t)),re=++ee,Wt.length===0&&Hn.length===0){let $t=Ut();return ye(oe,Gn({matches:he,loaderData:{},errors:Je&&Qi(Je[1])?{[Je[0]]:Je[1].error}:null},e4(Je),$t?{fetchers:new Map(R.fetchers)}:{}),{flushSync:We}),{shortCircuited:!0}}if(Rr){let $t={};if(!Ce){$t.navigation=mt;let Vn=Yt(Je);Vn!==void 0&&($t.actionData=Vn)}Hn.length>0&&($t.fetchers=mn(Hn)),Ne($t,{flushSync:We})}Hn.forEach($t=>{Kn($t.key),$t.controller&&H.set($t.key,$t.controller)});let Jc=()=>Hn.forEach($t=>Kn($t.key));D&&D.signal.addEventListener("abort",Jc);let{loaderResults:Ma,fetcherResults:Ho}=await Oe(R,he,Wt,Hn,te);if(te.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",Jc),Hn.forEach($t=>H.delete($t.key));let Ms=mS(Ma);if(Ms)return await ge(te,Ms.result,!0,{replace:Ue}),{shortCircuited:!0};if(Ms=mS(Ho),Ms)return q.add(Ms.key),await ge(te,Ms.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:Bv,errors:Wd}=ZB(R,he,Ma,Je,Hn,Ho,de);de.forEach(($t,Vn)=>{$t.subscribe(eu=>{(eu||$t.done)&&de.delete(Vn)})}),l.v7_partialHydration&&Xe&&R.errors&&(Wd=Gn({},R.errors,Wd));let Pl=Ut(),Gd=on(re),qd=Pl||Gd||Hn.length>0;return Gn({matches:he,loaderData:Bv,errors:Wd},qd?{fetchers:new Map(R.fetchers)}:{})}function Yt(te){if(te&&!Qi(te[1]))return{[te[0]]:te[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function mn(te){return te.forEach(oe=>{let he=R.fetchers.get(oe.key),Ce=Sy(void 0,he?he.data:void 0);R.fetchers.set(oe.key,Ce)}),new Map(R.fetchers)}function Xt(te,oe,he,Ce){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Kn(te);let Le=(Ce&&Ce.flushSync)===!0,qe=o||a,st=CN(R.location,R.matches,c,l.v7_prependBasename,he,l.v7_relativeSplatPath,oe,Ce==null?void 0:Ce.relative),Ue=pf(qe,st,c),Xe=ln(Ue,qe,st);if(Xe.active&&Xe.matches&&(Ue=Xe.matches),!Ue){Ye(te,oe,di(404,{pathname:st}),{flushSync:Le});return}let{path:We,submission:Je,error:mt}=WB(l.v7_normalizeFormMethod,!0,st,Ce);if(mt){Ye(te,oe,mt,{flushSync:Le});return}let Lt=By(Ue,We),Rr=(Ce&&Ce.preventScrollReset)===!0;if(Je&&pa(Je.formMethod)){J(te,oe,We,Lt,Ue,Xe.active,Le,Rr,Je);return}K.set(te,{routeId:oe,path:We}),fe(te,oe,We,Lt,Ue,Xe.active,Le,Rr,Je)}async function J(te,oe,he,Ce,Le,qe,st,Ue,Xe){xe(),K.delete(te);function We(ir){if(!ir.route.action&&!ir.route.lazy){let Tl=di(405,{method:Xe.formMethod,pathname:he,routeId:oe});return Ye(te,oe,Tl,{flushSync:st}),!0}return!1}if(!qe&&We(Ce))return;let Je=R.fetchers.get(te);Te(te,kNe(Xe,Je),{flushSync:st});let mt=new AbortController,Lt=Vp(t.history,he,mt.signal,Xe);if(qe){let ir=await Tn(Le,new URL(Lt.url).pathname,Lt.signal,te);if(ir.type==="aborted")return;if(ir.type==="error"){Ye(te,oe,ir.error,{flushSync:st});return}else if(ir.matches){if(Le=ir.matches,Ce=By(Le,he),We(Ce))return}else{Ye(te,oe,di(404,{pathname:he}),{flushSync:st});return}}H.set(te,mt);let Rr=ee,Wt=(await Pe("action",R,Lt,[Ce],Le,te))[Ce.route.id];if(Lt.signal.aborted){H.get(te)===mt&&H.delete(te);return}if(l.v7_fetcherPersist&&ue.has(te)){if(Ef(Wt)||Qi(Wt)){Te(te,bu(void 0));return}}else{if(Ef(Wt))if(H.delete(te),re>Rr){Te(te,bu(void 0));return}else return q.add(te),Te(te,Sy(Xe)),ge(Lt,Wt,!1,{fetcherSubmission:Xe,preventScrollReset:Ue});if(Qi(Wt)){Ye(te,oe,Wt.error);return}}if(ud(Wt))throw di(400,{type:"defer-action"});let Hn=R.navigation.location||R.location,Jc=Vp(t.history,Hn,mt.signal),Ma=o||a,Ho=R.navigation.state!=="idle"?pf(Ma,R.navigation.location,c):R.matches;Dt(Ho,"Didn't find any matches after fetcher action");let Ms=++ee;X.set(te,Ms);let Bv=Sy(Xe,Wt.data);R.fetchers.set(te,Bv);let[Wd,Pl]=qB(t.history,R,Ho,Xe,Hn,!1,l.v7_skipActionErrorRevalidation,U,Y,V,ue,K,q,Ma,c,[Ce.route.id,Wt]);Pl.filter(ir=>ir.key!==te).forEach(ir=>{let Tl=ir.key,Uv=R.fetchers.get(Tl),V_=Sy(void 0,Uv?Uv.data:void 0);R.fetchers.set(Tl,V_),Kn(Tl),ir.controller&&H.set(Tl,ir.controller)}),Ne({fetchers:new Map(R.fetchers)});let Gd=()=>Pl.forEach(ir=>Kn(ir.key));mt.signal.addEventListener("abort",Gd);let{loaderResults:qd,fetcherResults:$t}=await Oe(R,Ho,Wd,Pl,Jc);if(mt.signal.aborted)return;mt.signal.removeEventListener("abort",Gd),X.delete(te),H.delete(te),Pl.forEach(ir=>H.delete(ir.key));let Vn=mS(qd);if(Vn)return ge(Jc,Vn.result,!1,{preventScrollReset:Ue});if(Vn=mS($t),Vn)return q.add(Vn.key),ge(Jc,Vn.result,!1,{preventScrollReset:Ue});let{loaderData:eu,errors:Kd}=ZB(R,Ho,qd,void 0,Pl,$t,de);if(R.fetchers.has(te)){let ir=bu(Wt.data);R.fetchers.set(te,ir)}on(Ms),R.navigation.state==="loading"&&Ms>re?(Dt(E,"Expected pending action"),D&&D.abort(),ye(R.navigation.location,{matches:Ho,loaderData:eu,errors:Kd,fetchers:new Map(R.fetchers)})):(Ne({errors:Kd,loaderData:JB(R.loaderData,eu,Ho,Kd),fetchers:new Map(R.fetchers)}),U=!1)}async function fe(te,oe,he,Ce,Le,qe,st,Ue,Xe){let We=R.fetchers.get(te);Te(te,Sy(Xe,We?We.data:void 0),{flushSync:st});let Je=new AbortController,mt=Vp(t.history,he,Je.signal);if(qe){let Wt=await Tn(Le,new URL(mt.url).pathname,mt.signal,te);if(Wt.type==="aborted")return;if(Wt.type==="error"){Ye(te,oe,Wt.error,{flushSync:st});return}else if(Wt.matches)Le=Wt.matches,Ce=By(Le,he);else{Ye(te,oe,di(404,{pathname:he}),{flushSync:st});return}}H.set(te,Je);let Lt=ee,yn=(await Pe("loader",R,mt,[Ce],Le,te))[Ce.route.id];if(ud(yn)&&(yn=await C$(yn,mt.signal,!0)||yn),H.get(te)===Je&&H.delete(te),!mt.signal.aborted){if(ue.has(te)){Te(te,bu(void 0));return}if(Ef(yn))if(re>Lt){Te(te,bu(void 0));return}else{q.add(te),await ge(mt,yn,!1,{preventScrollReset:Ue});return}if(Qi(yn)){Ye(te,oe,yn.error);return}Dt(!ud(yn),"Unhandled fetcher deferred data"),Te(te,bu(yn.data))}}async function ge(te,oe,he,Ce){let{submission:Le,fetcherSubmission:qe,preventScrollReset:st,replace:Ue}=Ce===void 0?{}:Ce;oe.response.headers.has("X-Remix-Revalidate")&&(U=!0);let Xe=oe.response.headers.get("Location");Dt(Xe,"Expected a Location header on the redirect Response"),Xe=XB(Xe,new URL(te.url),c);let We=t0(R.location,Xe,{_isRedirect:!0});if(n){let Wt=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))Wt=!0;else if(E$.test(Xe)){const Hn=t.history.createURL(Xe);Wt=Hn.origin!==e.location.origin||Rd(Hn.pathname,c)==null}if(Wt){Ue?e.location.replace(Xe):e.location.assign(Xe);return}}D=null;let Je=Ue===!0||oe.response.headers.has("X-Remix-Replace")?Er.Replace:Er.Push,{formMethod:mt,formAction:Lt,formEncType:Rr}=R.navigation;!Le&&!qe&&mt&&Lt&&Rr&&(Le=r4(R.navigation));let yn=Le||qe;if(uNe.has(oe.response.status)&&yn&&pa(yn.formMethod))await Qe(Je,We,{submission:Gn({},yn,{formAction:Xe}),preventScrollReset:st||T,enableViewTransition:he?O:void 0});else{let Wt=qT(We,Le);await Qe(Je,We,{overrideNavigation:Wt,fetcherSubmission:qe,preventScrollReset:st||T,enableViewTransition:he?O:void 0})}}async function Pe(te,oe,he,Ce,Le,qe){let st,Ue={};try{st=await yNe(u,te,oe,he,Ce,Le,qe,i,s)}catch(Xe){return Ce.forEach(We=>{Ue[We.route.id]={type:fn.error,error:Xe}}),Ue}for(let[Xe,We]of Object.entries(st))if(ENe(We)){let Je=We.result;Ue[Xe]={type:fn.redirect,response:_Ne(Je,he,Xe,Le,c,l.v7_relativeSplatPath)}}else Ue[Xe]=await wNe(We);return Ue}async function Oe(te,oe,he,Ce,Le){let qe=te.matches,st=Pe("loader",te,Le,he,oe,null),Ue=Promise.all(Ce.map(async Je=>{if(Je.matches&&Je.match&&Je.controller){let Lt=(await Pe("loader",te,Vp(t.history,Je.path,Je.controller.signal),[Je.match],Je.matches,Je.key))[Je.match.route.id];return{[Je.key]:Lt}}else return Promise.resolve({[Je.key]:{type:fn.error,error:di(404,{pathname:Je.path})}})})),Xe=await st,We=(await Ue).reduce((Je,mt)=>Object.assign(Je,mt),{});return await Promise.all([RNe(oe,Xe,Le.signal,qe,te.loaderData),PNe(oe,We,Ce)]),{loaderResults:Xe,fetcherResults:We}}function xe(){U=!0,Y.push(...nt()),K.forEach((te,oe)=>{H.has(oe)&&V.add(oe),Kn(oe)})}function Te(te,oe,he){he===void 0&&(he={}),R.fetchers.set(te,oe),Ne({fetchers:new Map(R.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Ye(te,oe,he,Ce){Ce===void 0&&(Ce={});let Le=mf(R.matches,oe);bt(te),Ne({errors:{[Le.route.id]:he},fetchers:new Map(R.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function Rt(te){return Z.set(te,(Z.get(te)||0)+1),ue.has(te)&&ue.delete(te),R.fetchers.get(te)||dNe}function bt(te){let oe=R.fetchers.get(te);H.has(te)&&!(oe&&oe.state==="loading"&&X.has(te))&&Kn(te),K.delete(te),X.delete(te),q.delete(te),l.v7_fetcherPersist&&ue.delete(te),V.delete(te),R.fetchers.delete(te)}function Os(te){let oe=(Z.get(te)||0)-1;oe<=0?(Z.delete(te),ue.add(te),l.v7_fetcherPersist||bt(te)):Z.set(te,oe),Ne({fetchers:new Map(R.fetchers)})}function Kn(te){let oe=H.get(te);oe&&(oe.abort(),H.delete(te))}function ps(te){for(let oe of te){let he=Rt(oe),Ce=bu(he.data);R.fetchers.set(oe,Ce)}}function Ut(){let te=[],oe=!1;for(let he of q){let Ce=R.fetchers.get(he);Dt(Ce,"Expected fetcher: "+he),Ce.state==="loading"&&(q.delete(he),te.push(he),oe=!0)}return ps(te),oe}function on(te){let oe=[];for(let[he,Ce]of X)if(Ce0}function gn(te,oe){let he=R.blockers.get(te)||em;return ie.get(te)!==oe&&ie.set(te,oe),he}function Be(te){R.blockers.delete(te),ie.delete(te)}function it(te,oe){let he=R.blockers.get(te)||em;Dt(he.state==="unblocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="proceeding"||he.state==="blocked"&&oe.state==="unblocked"||he.state==="proceeding"&&oe.state==="unblocked","Invalid blocker state transition: "+he.state+" -> "+oe.state);let Ce=new Map(R.blockers);Ce.set(te,oe),Ne({blockers:Ce})}function ot(te){let{currentLocation:oe,nextLocation:he,historyAction:Ce}=te;if(ie.size===0)return;ie.size>1&&fv(!1,"A router only supports one blocker at a time");let Le=Array.from(ie.entries()),[qe,st]=Le[Le.length-1],Ue=R.blockers.get(qe);if(!(Ue&&Ue.state==="proceeding")&&st({currentLocation:oe,nextLocation:he,historyAction:Ce}))return qe}function St(te){let oe=di(404,{pathname:te}),he=o||a,{matches:Ce,route:Le}=t4(he);return nt(),{notFoundMatches:Ce,route:Le,error:oe}}function nt(te){let oe=[];return de.forEach((he,Ce)=>{(!te||te(Ce))&&(he.cancel(),oe.push(Ce),de.delete(Ce))}),oe}function Ht(te,oe,he){if(p=te,y=oe,h=he||null,!g&&R.navigation===GT){g=!0;let Ce=an(R.location,R.matches);Ce!=null&&Ne({restoreScrollPosition:Ce})}return()=>{p=null,y=null,h=null}}function Ct(te,oe){return h&&h(te,oe.map(Ce=>UDe(Ce,R.loaderData)))||te.key}function vn(te,oe){if(p&&y){let he=Ct(te,oe);p[he]=y()}}function an(te,oe){if(p){let he=Ct(te,oe),Ce=p[he];if(typeof Ce=="number")return Ce}return null}function ln(te,oe,he){if(f)if(te){if(Object.keys(te[0].params).length>0)return{active:!0,matches:GS(oe,he,c,!0)}}else return{active:!0,matches:GS(oe,he,c,!0)||[]};return{active:!1,matches:null}}async function Tn(te,oe,he,Ce){if(!f)return{type:"success",matches:te};let Le=te;for(;;){let qe=o==null,st=o||a,Ue=i;try{await f({signal:he,path:oe,matches:Le,fetcherKey:Ce,patch:(Je,mt)=>{he.aborted||YB(Je,mt,st,Ue,s)}})}catch(Je){return{type:"error",error:Je,partialMatches:Le}}finally{qe&&!he.aborted&&(a=[...a])}if(he.aborted)return{type:"aborted"};let Xe=pf(st,oe,c);if(Xe)return{type:"success",matches:Xe};let We=GS(st,oe,c,!0);if(!We||Le.length===We.length&&Le.every((Je,mt)=>Je.route.id===We[mt].route.id))return{type:"success",matches:null};Le=We}}function hr(te){i={},o=EC(te,s,void 0,i)}function kn(te,oe){let he=o==null;YB(te,oe,o||a,i,s),he&&(a=[...a],Ne({}))}return k={get basename(){return c},get future(){return l},get state(){return R},get routes(){return a},get window(){return e},initialize:Ae,subscribe:Me,enableScrollRestoration:Ht,navigate:$e,fetch:Xt,revalidate:ut,createHref:te=>t.history.createHref(te),encodeLocation:te=>t.history.encodeLocation(te),getFetcher:Rt,deleteFetcher:Os,dispose:_e,getBlocker:gn,deleteBlocker:Be,patchRoutes:kn,_internalFetchControllers:H,_internalActiveDeferreds:de,_internalSetRoutes:hr},k}function pNe(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function CN(t,e,n,r,s,i,a,o){let c,u;if(a){c=[];for(let l of e)if(c.push(l),l.route.id===a){u=l;break}}else c=e,u=e[e.length-1];let f=OA(s||".",NA(c,i),Rd(t.pathname,n)||t.pathname,o==="path");if(s==null&&(f.search=t.search,f.hash=t.hash),(s==null||s===""||s===".")&&u){let l=A$(f.search);if(u.route.index&&!l)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&l){let d=new URLSearchParams(f.search),m=d.getAll("index");d.delete("index"),m.filter(h=>h).forEach(h=>d.append("index",h));let p=d.toString();f.search=p?"?"+p:""}}return r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:Dc([n,f.pathname])),Zh(f)}function WB(t,e,n,r){if(!r||!pNe(r))return{path:n};if(r.formMethod&&!ANe(r.formMethod))return{path:n,error:di(405,{method:r.formMethod})};let s=()=>({path:n,error:di(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=t?i.toUpperCase():i.toLowerCase(),o=cQ(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!pa(a))return s();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[h,y]=p;return""+m+h+"="+y+` -`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!pa(a))return s();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return s()}}}Dt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=RN(r.formData),u=r.formData;else if(r.body instanceof FormData)c=RN(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=QB(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=QB(c)}catch{return s()}let f={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(pa(f.formMethod))return{path:n,submission:f};let l=zd(n);return e&&l.search&&A$(l.search)&&c.append("index",""),l.search="?"+c,{path:Zh(l),submission:f}}function GB(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(s=>s.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function qB(t,e,n,r,s,i,a,o,c,u,f,l,d,m,p,h){let y=h?Qi(h[1])?h[1].error:h[1].data:void 0,g=t.createURL(e.location),v=t.createURL(s),w=n;i&&e.errors?w=GB(n,Object.keys(e.errors)[0],!0):h&&Qi(h[1])&&(w=GB(n,h[0]));let x=h?h[1].statusCode:void 0,A=a&&x&&x>=400,k=w.filter((E,T)=>{let{route:D}=E;if(D.lazy)return!0;if(D.loader==null)return!1;if(i)return AN(D,e.loaderData,e.errors);if(mNe(e.loaderData,e.matches[T],E)||c.some(I=>I===E.route.id))return!0;let O=e.matches[T],L=E;return KB(E,Gn({currentUrl:g,currentParams:O.params,nextUrl:v,nextParams:L.params},r,{actionResult:y,actionStatus:x,defaultShouldRevalidate:A?!1:o||g.pathname+g.search===v.pathname+v.search||g.search!==v.search||aQ(O,L)}))}),R=[];return l.forEach((E,T)=>{if(i||!n.some(F=>F.route.id===E.routeId)||f.has(T))return;let D=pf(m,E.path,p);if(!D){R.push({key:T,routeId:E.routeId,path:E.path,matches:null,match:null,controller:null});return}let O=e.fetchers.get(T),L=By(D,E.path),I=!1;d.has(T)?I=!1:u.has(T)?(u.delete(T),I=!0):O&&O.state!=="idle"&&O.data===void 0?I=o:I=KB(L,Gn({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:x,defaultShouldRevalidate:A?!1:o})),I&&R.push({key:T,routeId:E.routeId,path:E.path,matches:D,match:L,controller:new AbortController})}),[k,R]}function AN(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,s=n!=null&&n[t.id]!==void 0;return!r&&s?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!s}function mNe(t,e,n){let r=!e||n.route.id!==e.route.id,s=t[n.route.id]===void 0;return r||s}function aQ(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function KB(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function YB(t,e,n,r,s){var i;let a;if(t){let u=r[t];Dt(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),a=u.children}else a=n;let o=e.filter(u=>!a.some(f=>lQ(u,f))),c=EC(o,s,[t||"_","patch",String(((i=a)==null?void 0:i.length)||"0")],r);a.push(...c)}function lQ(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var s;return(s=e.children)==null?void 0:s.some(i=>lQ(n,i))}):!1}async function gNe(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let s=n[t.id];Dt(s,"No route found in manifest");let i={};for(let a in r){let c=s[a]!==void 0&&a!=="hasErrorBoundary";fv(!c,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!zDe.has(a)&&(i[a]=r[a])}Object.assign(s,i),Object.assign(s,Gn({},e(s),{lazy:void 0}))}async function vNe(t){let{matches:e}=t,n=e.filter(s=>s.shouldLoad);return(await Promise.all(n.map(s=>s.resolve()))).reduce((s,i,a)=>Object.assign(s,{[n[a].route.id]:i}),{})}async function yNe(t,e,n,r,s,i,a,o,c,u){let f=i.map(m=>m.route.lazy?gNe(m.route,c,o):void 0),l=i.map((m,p)=>{let h=f[p],y=s.some(v=>v.route.id===m.route.id);return Gn({},m,{shouldLoad:y,resolve:async v=>(v&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(y=!0),y?bNe(e,r,m,h,v,u):Promise.resolve({type:fn.data,result:void 0}))})}),d=await t({matches:l,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(f)}catch{}return d}async function bNe(t,e,n,r,s,i){let a,o,c=u=>{let f,l=new Promise((p,h)=>f=h);o=()=>f(),e.signal.addEventListener("abort",o);let d=p=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:i},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(s?s(h=>d(h)):d())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,l])};try{let u=n.route[t];if(r)if(u){let f,[l]=await Promise.all([c(u).catch(d=>{f=d}),r]);if(f!==void 0)throw f;a=l}else if(await r,u=n.route[t],u)a=await c(u);else if(t==="action"){let f=new URL(e.url),l=f.pathname+f.search;throw di(405,{method:e.method,pathname:l,routeId:n.route.id})}else return{type:fn.data,result:void 0};else if(u)a=await c(u);else{let f=new URL(e.url),l=f.pathname+f.search;throw di(404,{pathname:l})}Dt(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:fn.error,result:u}}finally{o&&e.signal.removeEventListener("abort",o)}return a}async function wNe(t){let{result:e,type:n}=t;if(uQ(e)){let l;try{let d=e.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?e.body==null?l=null:l=await e.json():l=await e.text()}catch(d){return{type:fn.error,error:d}}return n===fn.error?{type:fn.error,error:new CC(e.status,e.statusText,l),statusCode:e.status,headers:e.headers}:{type:fn.data,data:l,statusCode:e.status,headers:e.headers}}if(n===fn.error){if(n4(e)){var r,s;if(e.data instanceof Error){var i,a;return{type:fn.error,error:e.data,statusCode:(i=e.init)==null?void 0:i.status,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}}return{type:fn.error,error:new CC(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:n0(e)?e.status:void 0,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}}return{type:fn.error,error:e,statusCode:n0(e)?e.status:void 0}}if(CNe(e)){var o,c;return{type:fn.deferred,deferredData:e,statusCode:(o=e.init)==null?void 0:o.status,headers:((c=e.init)==null?void 0:c.headers)&&new Headers(e.init.headers)}}if(n4(e)){var u,f;return{type:fn.data,data:e.data,statusCode:(u=e.init)==null?void 0:u.status,headers:(f=e.init)!=null&&f.headers?new Headers(e.init.headers):void 0}}return{type:fn.data,data:e}}function _Ne(t,e,n,r,s,i){let a=t.headers.get("Location");if(Dt(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!E$.test(a)){let o=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=CN(new URL(e.url),o,s,!0,a,i),t.headers.set("Location",a)}return t}function XB(t,e,n){if(E$.test(t)){let r=t,s=r.startsWith("//")?new URL(e.protocol+r):new URL(r),i=Rd(s.pathname,n)!=null;if(s.origin===e.origin&&i)return s.pathname+s.search+s.hash}return t}function Vp(t,e,n,r){let s=t.createURL(cQ(e)).toString(),i={signal:n};if(r&&pa(r.formMethod)){let{formMethod:a,formEncType:o}=r;i.method=a.toUpperCase(),o==="application/json"?(i.headers=new Headers({"Content-Type":o}),i.body=JSON.stringify(r.json)):o==="text/plain"?i.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?i.body=RN(r.formData):i.body=r.formData}return new Request(s,i)}function RN(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function QB(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function xNe(t,e,n,r,s){let i={},a=null,o,c=!1,u={},f=n&&Qi(n[1])?n[1].error:void 0;return t.forEach(l=>{if(!(l.route.id in e))return;let d=l.route.id,m=e[d];if(Dt(!Ef(m),"Cannot handle redirect results in processLoaderData"),Qi(m)){let p=m.error;f!==void 0&&(p=f,f=void 0),a=a||{};{let h=mf(t,d);a[h.route.id]==null&&(a[h.route.id]=p)}i[d]=void 0,c||(c=!0,o=n0(m.error)?m.error.status:500),m.headers&&(u[d]=m.headers)}else ud(m)?(r.set(d,m.deferredData),i[d]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[d]=m.headers)):(i[d]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[d]=m.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:o||200,loaderHeaders:u}}function ZB(t,e,n,r,s,i,a){let{loaderData:o,errors:c}=xNe(e,n,r,a);return s.forEach(u=>{let{key:f,match:l,controller:d}=u,m=i[f];if(Dt(m,"Did not find corresponding fetcher result"),!(d&&d.signal.aborted))if(Qi(m)){let p=mf(t.matches,l==null?void 0:l.route.id);c&&c[p.route.id]||(c=Gn({},c,{[p.route.id]:m.error})),t.fetchers.delete(f)}else if(Ef(m))Dt(!1,"Unhandled fetcher revalidation redirect");else if(ud(m))Dt(!1,"Unhandled fetcher deferred data");else{let p=bu(m.data);t.fetchers.set(f,p)}}),{loaderData:o,errors:c}}function JB(t,e,n,r){let s=Gn({},e);for(let i of n){let a=i.route.id;if(e.hasOwnProperty(a)?e[a]!==void 0&&(s[a]=e[a]):t[a]!==void 0&&i.route.loader&&(s[a]=t[a]),r&&r.hasOwnProperty(a))break}return s}function e4(t){return t?Qi(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function mf(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function t4(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function di(t,e){let{pathname:n,routeId:r,method:s,type:i,message:a}=e===void 0?{}:e,o="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(o="Bad Request",s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):t===403?(o="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",c='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new CC(t||500,o,new Error(c),!0)}function mS(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,s]=e[n];if(Ef(s))return{key:r,result:s}}}function cQ(t){let e=typeof t=="string"?zd(t):t;return Zh(Gn({},e,{hash:""}))}function SNe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function ENe(t){return uQ(t.result)&&cNe.has(t.result.status)}function ud(t){return t.type===fn.deferred}function Qi(t){return t.type===fn.error}function Ef(t){return(t&&t.type)===fn.redirect}function n4(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function CNe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function uQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function ANe(t){return lNe.has(t.toLowerCase())}function pa(t){return oNe.has(t.toLowerCase())}async function RNe(t,e,n,r,s){let i=Object.entries(e);for(let a=0;a(d==null?void 0:d.route.id)===o);if(!u)continue;let f=r.find(d=>d.route.id===u.route.id),l=f!=null&&!aQ(f,u)&&(s&&s[u.route.id])!==void 0;ud(c)&&l&&await C$(c,n,!1).then(d=>{d&&(e[o]=d)})}}async function PNe(t,e,n){for(let r=0;r(u==null?void 0:u.route.id)===i)&&ud(o)&&(Dt(a,"Expected an AbortController for revalidating fetcher deferred result"),await C$(o,a.signal,!0).then(u=>{u&&(e[s]=u)}))}}async function C$(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:fn.data,data:t.deferredData.unwrappedData}}catch(s){return{type:fn.error,error:s}}return{type:fn.data,data:t.deferredData.data}}}function A$(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function By(t,e){let n=typeof e=="string"?zd(e).search:e.search;if(t[t.length-1].route.index&&A$(n||""))return t[t.length-1];let r=sQ(t);return r[r.length-1]}function r4(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:i,json:a}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function qT(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function TNe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Sy(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function kNe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function bu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function DNe(t,e){try{let n=t.sessionStorage.getItem(oQ);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&e.set(s,new Set(i||[]))}}catch{}}function NNe(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem(oQ,JSON.stringify(n))}catch(r){fv(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + */function Gn(){return Gn=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function fv(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function UDe(){return Math.random().toString(36).substr(2,8)}function WB(t,e){return{usr:t.state,key:t.key,idx:e}}function t0(t,e,n,r){return n===void 0&&(n=null),Gn({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?zd(e):e,{state:n,key:e&&e.key||r||UDe()})}function Jh(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function zd(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function HDe(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,o=Er.Pop,c=null,u=f();u==null&&(u=0,a.replaceState(Gn({},a.state,{idx:u}),""));function f(){return(a.state||{idx:null}).idx}function l(){o=Er.Pop;let y=f(),g=y==null?null:y-u;u=y,c&&c({action:o,location:h.location,delta:g})}function d(y,g){o=Er.Push;let v=t0(h.location,y,g);u=f()+1;let w=WB(v,u),x=h.createHref(v);try{a.pushState(w,"",x)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(x)}i&&c&&c({action:o,location:h.location,delta:1})}function m(y,g){o=Er.Replace;let v=t0(h.location,y,g);u=f();let w=WB(v,u),x=h.createHref(v);a.replaceState(w,"",x),i&&c&&c({action:o,location:h.location,delta:0})}function p(y){let g=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof y=="string"?y:Jh(y);return v=v.replace(/ $/,"%20"),Dt(g,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,g)}let h={get action(){return o},get location(){return t(s,a)},listen(y){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(VB,l),c=y,()=>{s.removeEventListener(VB,l),c=null}},createHref(y){return e(s,y)},createURL:p,encodeLocation(y){let g=p(y);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:d,replace:m,go(y){return a.go(y)}};return h}var fn;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(fn||(fn={}));const VDe=new Set(["lazy","caseSensitive","path","id","index","children"]);function WDe(t){return t.index===!0}function CC(t,e,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),t.map((s,i)=>{let a=[...n,String(i)],o=typeof s.id=="string"?s.id:a.join("-");if(Dt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Dt(!r[o],'Found a route id collision on id "'+o+`". Route id's must be globally unique within Data Router usages`),WDe(s)){let c=Gn({},s,e(s),{id:o});return r[o]=c,c}else{let c=Gn({},s,e(s),{id:o,children:void 0});return r[o]=c,s.children&&(c.children=CC(s.children,e,a,r)),c}})}function pf(t,e,n){return n===void 0&&(n="/"),qS(t,e,n,!1)}function qS(t,e,n,r){let s=typeof e=="string"?zd(e):e,i=Rd(s.pathname||"/",n);if(i==null)return null;let a=oQ(t);qDe(a);let o=null;for(let c=0;o==null&&c{let c={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(Dt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Nc([r,c.relativePath]),f=n.concat(c);i.children&&i.children.length>0&&(Dt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),oQ(i.children,e,f,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:eNe(u,i.index),routesMeta:f})};return t.forEach((i,a)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))s(i,a);else for(let c of aQ(i.path))s(i,a,c)}),e}function aQ(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=aQ(r.join("/")),o=[];return o.push(...a.map(c=>c===""?i:[i,c].join("/"))),s&&o.push(...a),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function qDe(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:tNe(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const KDe=/^:[\w-]+$/,YDe=3,XDe=2,QDe=1,ZDe=10,JDe=-2,GB=t=>t==="*";function eNe(t,e){let n=t.split("/"),r=n.length;return n.some(GB)&&(r+=JDe),e&&(r+=XDe),n.filter(s=>!GB(s)).reduce((s,i)=>s+(KDe.test(i)?YDe:i===""?QDe:ZDe),r)}function tNe(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function nNe(t,e,n){n===void 0&&(n=!1);let{routesMeta:r}=t,s={},i="/",a=[];for(let o=0;o{let{paramName:d,isOptional:m}=f;if(d==="*"){let h=o[l]||"";a=i.slice(0,i.length-h.length).replace(/(.)\/+$/,"$1")}const p=o[l];return m&&!p?u[d]=void 0:u[d]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:t}}function rNe(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),fv(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,o,c)=>(r.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function sNe(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return fv(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Rd(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function iNe(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?zd(t):t;return{pathname:n?n.startsWith("/")?n:oNe(n,e):e,search:lNe(r),hash:cNe(s)}}function oNe(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function GT(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function lQ(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function OA(t,e){let n=lQ(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MA(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=zd(t):(s=Gn({},t),Dt(!s.pathname||!s.pathname.includes("?"),GT("?","pathname","search",s)),Dt(!s.pathname||!s.pathname.includes("#"),GT("#","pathname","hash",s)),Dt(!s.search||!s.search.includes("#"),GT("#","search","hash",s)));let i=t===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=n;else{let l=e.length-1;if(!r&&a.startsWith("..")){let d=a.split("/");for(;d[0]==="..";)d.shift(),l-=1;s.pathname=d.join("/")}o=l>=0?e[l]:"/"}let c=iNe(s,o),u=a&&a!=="/"&&a.endsWith("/"),f=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||f)&&(c.pathname+="/"),c}const Nc=t=>t.join("/").replace(/\/\/+/g,"/"),aNe=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),lNe=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,cNe=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;class AC{constructor(e,n,r,s){s===void 0&&(s=!1),this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function n0(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const cQ=["post","put","patch","delete"],uNe=new Set(cQ),dNe=["get",...cQ],fNe=new Set(dNe),hNe=new Set([301,302,303,307,308]),pNe=new Set([307,308]),qT={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},mNe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tm={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},A$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gNe=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),uQ="remix-router-transitions";function vNe(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u",r=!n;Dt(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let s;if(t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let te=t.detectErrorBoundary;s=oe=>({hasErrorBoundary:te(oe)})}else s=gNe;let i={},a=CC(t.routes,s,void 0,i),o,c=t.basename||"/",u=t.dataStrategy||_Ne,f=t.patchRoutesOnNavigation,l=Gn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},t.future),d=null,m=new Set,p=null,h=null,y=null,g=t.hydrationData!=null,v=pf(a,t.history.location,c),w=!1,x=null;if(v==null&&!f){let te=di(404,{pathname:t.history.location.pathname}),{matches:oe,route:he}=s4(a);v=oe,x={[he.id]:te}}v&&!t.hydrationData&&ln(v,a,t.history.location.pathname).active&&(v=null);let A;if(v)if(v.some(te=>te.route.lazy))A=!1;else if(!v.some(te=>te.route.loader))A=!0;else if(l.v7_partialHydration){let te=t.hydrationData?t.hydrationData.loaderData:null,oe=t.hydrationData?t.hydrationData.errors:null;if(oe){let he=v.findIndex(Ce=>oe[Ce.route.id]!==void 0);A=v.slice(0,he+1).every(Ce=>!RN(Ce.route,te,oe))}else A=v.every(he=>!RN(he.route,te,oe))}else A=t.hydrationData!=null;else if(A=!1,v=[],l.v7_partialHydration){let te=ln(null,a,t.history.location.pathname);te.active&&te.matches&&(w=!0,v=te.matches)}let k,R={historyAction:t.history.action,location:t.history.location,matches:v,initialized:A,navigation:qT,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||x,fetchers:new Map,blockers:new Map},E=Er.Pop,T=!1,D,O=!1,L=new Map,I=null,F=!1,U=!1,Y=[],V=new Set,H=new Map,ee=0,re=-1,X=new Map,q=new Set,K=new Map,Z=new Map,ue=new Set,de=new Map,ie=new Map,be;function Ae(){if(d=t.history.listen(te=>{let{action:oe,location:he,delta:Ce}=te;if(be){be(),be=void 0;return}fv(ie.size===0||Ce!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Le=ot({currentLocation:R.location,nextLocation:he,historyAction:oe});if(Le&&Ce!=null){let qe=new Promise(st=>{be=st});t.history.go(Ce*-1),it(Le,{state:"blocked",location:he,proceed(){it(Le,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),qe.then(()=>t.history.go(Ce))},reset(){let st=new Map(R.blockers);st.set(Le,tm),Ne({blockers:st})}});return}return Qe(oe,he)}),n){LNe(e,L);let te=()=>INe(e,L);e.addEventListener("pagehide",te),I=()=>e.removeEventListener("pagehide",te)}return R.initialized||Qe(Er.Pop,R.location,{initialHydration:!0}),k}function _e(){d&&d(),I&&I(),m.clear(),D&&D.abort(),R.fetchers.forEach((te,oe)=>bt(oe)),R.blockers.forEach((te,oe)=>Be(oe))}function Me(te){return m.add(te),()=>m.delete(te)}function Ne(te,oe){oe===void 0&&(oe={}),R=Gn({},R,te);let he=[],Ce=[];l.v7_fetcherPersist&&R.fetchers.forEach((Le,qe)=>{Le.state==="idle"&&(ue.has(qe)?Ce.push(qe):he.push(qe))}),ue.forEach(Le=>{!R.fetchers.has(Le)&&!H.has(Le)&&Ce.push(Le)}),[...m].forEach(Le=>Le(R,{deletedFetchers:Ce,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),l.v7_fetcherPersist?(he.forEach(Le=>R.fetchers.delete(Le)),Ce.forEach(Le=>bt(Le))):Ce.forEach(Le=>ue.delete(Le))}function ye(te,oe,he){var Ce,Le;let{flushSync:qe}=he===void 0?{}:he,st=R.actionData!=null&&R.navigation.formMethod!=null&&ma(R.navigation.formMethod)&&R.navigation.state==="loading"&&((Ce=te.state)==null?void 0:Ce._isRedirect)!==!0,Ue;oe.actionData?Object.keys(oe.actionData).length>0?Ue=oe.actionData:Ue=null:st?Ue=R.actionData:Ue=null;let Xe=oe.loaderData?n4(R.loaderData,oe.loaderData,oe.matches||[],oe.errors):R.loaderData,We=R.blockers;We.size>0&&(We=new Map(We),We.forEach((Lt,Rr)=>We.set(Rr,tm)));let Je=T===!0||R.navigation.formMethod!=null&&ma(R.navigation.formMethod)&&((Le=te.state)==null?void 0:Le._isRedirect)!==!0;o&&(a=o,o=void 0),F||E===Er.Pop||(E===Er.Push?t.history.push(te,te.state):E===Er.Replace&&t.history.replace(te,te.state));let mt;if(E===Er.Pop){let Lt=L.get(R.location.pathname);Lt&&Lt.has(te.pathname)?mt={currentLocation:R.location,nextLocation:te}:L.has(te.pathname)&&(mt={currentLocation:te,nextLocation:R.location})}else if(O){let Lt=L.get(R.location.pathname);Lt?Lt.add(te.pathname):(Lt=new Set([te.pathname]),L.set(R.location.pathname,Lt)),mt={currentLocation:R.location,nextLocation:te}}Ne(Gn({},oe,{actionData:Ue,loaderData:Xe,historyAction:E,location:te,initialized:!0,navigation:qT,revalidation:"idle",restoreScrollPosition:an(te,oe.matches||R.matches),preventScrollReset:Je,blockers:We}),{viewTransitionOpts:mt,flushSync:qe===!0}),E=Er.Pop,T=!1,O=!1,F=!1,U=!1,Y=[]}async function $e(te,oe){if(typeof te=="number"){t.history.go(te);return}let he=AN(R.location,R.matches,c,l.v7_prependBasename,te,l.v7_relativeSplatPath,oe==null?void 0:oe.fromRouteId,oe==null?void 0:oe.relative),{path:Ce,submission:Le,error:qe}=KB(l.v7_normalizeFormMethod,!1,he,oe),st=R.location,Ue=t0(R.location,Ce,oe&&oe.state);Ue=Gn({},Ue,t.history.encodeLocation(Ue));let Xe=oe&&oe.replace!=null?oe.replace:void 0,We=Er.Push;Xe===!0?We=Er.Replace:Xe===!1||Le!=null&&ma(Le.formMethod)&&Le.formAction===R.location.pathname+R.location.search&&(We=Er.Replace);let Je=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,mt=(oe&&oe.flushSync)===!0,Lt=ot({currentLocation:st,nextLocation:Ue,historyAction:We});if(Lt){it(Lt,{state:"blocked",location:Ue,proceed(){it(Lt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),$e(te,oe)},reset(){let Rr=new Map(R.blockers);Rr.set(Lt,tm),Ne({blockers:Rr})}});return}return await Qe(We,Ue,{submission:Le,pendingError:qe,preventScrollReset:Je,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:mt})}function ut(){if(xe(),Ne({revalidation:"loading"}),R.navigation.state!=="submitting"){if(R.navigation.state==="idle"){Qe(R.historyAction,R.location,{startUninterruptedRevalidation:!0});return}Qe(E||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:O===!0})}}async function Qe(te,oe,he){D&&D.abort(),D=null,E=te,F=(he&&he.startUninterruptedRevalidation)===!0,vn(R.location,R.matches),T=(he&&he.preventScrollReset)===!0,O=(he&&he.enableViewTransition)===!0;let Ce=o||a,Le=he&&he.overrideNavigation,qe=he!=null&&he.initialHydration&&R.matches&&R.matches.length>0&&!w?R.matches:pf(Ce,oe,c),st=(he&&he.flushSync)===!0;if(qe&&R.initialized&&!U&&RNe(R.location,oe)&&!(he&&he.submission&&ma(he.submission.formMethod))){ye(oe,{matches:qe},{flushSync:st});return}let Ue=ln(qe,Ce,oe.pathname);if(Ue.active&&Ue.matches&&(qe=Ue.matches),!qe){let{error:yn,notFoundMatches:Wt,route:Hn}=St(oe.pathname);ye(oe,{matches:Wt,loaderData:{},errors:{[Hn.id]:yn}},{flushSync:st});return}D=new AbortController;let Xe=Wp(t.history,oe,D.signal,he&&he.submission),We;if(he&&he.pendingError)We=[mf(qe).route.id,{type:fn.error,error:he.pendingError}];else if(he&&he.submission&&ma(he.submission.formMethod)){let yn=await vt(Xe,oe,he.submission,qe,Ue.active,{replace:he.replace,flushSync:st});if(yn.shortCircuited)return;if(yn.pendingActionResult){let[Wt,Hn]=yn.pendingActionResult;if(Qi(Hn)&&n0(Hn.error)&&Hn.error.status===404){D=null,ye(oe,{matches:yn.matches,loaderData:{},errors:{[Wt]:Hn.error}});return}}qe=yn.matches||qe,We=yn.pendingActionResult,Le=KT(oe,he.submission),st=!1,Ue.active=!1,Xe=Wp(t.history,Xe.url,Xe.signal)}let{shortCircuited:Je,matches:mt,loaderData:Lt,errors:Rr}=await Sn(Xe,oe,qe,Ue.active,Le,he&&he.submission,he&&he.fetcherSubmission,he&&he.replace,he&&he.initialHydration===!0,st,We);Je||(D=null,ye(oe,Gn({matches:mt||qe},r4(We),{loaderData:Lt,errors:Rr})))}async function vt(te,oe,he,Ce,Le,qe){qe===void 0&&(qe={}),xe();let st=ONe(oe,he);if(Ne({navigation:st},{flushSync:qe.flushSync===!0}),Le){let We=await Tn(Ce,oe.pathname,te.signal);if(We.type==="aborted")return{shortCircuited:!0};if(We.type==="error"){let Je=mf(We.partialMatches).route.id;return{matches:We.partialMatches,pendingActionResult:[Je,{type:fn.error,error:We.error}]}}else if(We.matches)Ce=We.matches;else{let{notFoundMatches:Je,error:mt,route:Lt}=St(oe.pathname);return{matches:Je,pendingActionResult:[Lt.id,{type:fn.error,error:mt}]}}}let Ue,Xe=By(Ce,oe);if(!Xe.route.action&&!Xe.route.lazy)Ue={type:fn.error,error:di(405,{method:te.method,pathname:oe.pathname,routeId:Xe.route.id})};else if(Ue=(await Pe("action",R,te,[Xe],Ce,null))[Xe.route.id],te.signal.aborted)return{shortCircuited:!0};if(Ef(Ue)){let We;return qe&&qe.replace!=null?We=qe.replace:We=JB(Ue.response.headers.get("Location"),new URL(te.url),c)===R.location.pathname+R.location.search,await ge(te,Ue,!0,{submission:he,replace:We}),{shortCircuited:!0}}if(ud(Ue))throw di(400,{type:"defer-action"});if(Qi(Ue)){let We=mf(Ce,Xe.route.id);return(qe&&qe.replace)!==!0&&(E=Er.Push),{matches:Ce,pendingActionResult:[We.route.id,Ue]}}return{matches:Ce,pendingActionResult:[Xe.route.id,Ue]}}async function Sn(te,oe,he,Ce,Le,qe,st,Ue,Xe,We,Je){let mt=Le||KT(oe,qe),Lt=qe||st||o4(mt),Rr=!F&&(!l.v7_partialHydration||!Xe);if(Ce){if(Rr){let Vn=Yt(Je);Ne(Gn({navigation:mt},Vn!==void 0?{actionData:Vn}:{}),{flushSync:We})}let $t=await Tn(he,oe.pathname,te.signal);if($t.type==="aborted")return{shortCircuited:!0};if($t.type==="error"){let Vn=mf($t.partialMatches).route.id;return{matches:$t.partialMatches,loaderData:{},errors:{[Vn]:$t.error}}}else if($t.matches)he=$t.matches;else{let{error:Vn,notFoundMatches:eu,route:Kd}=St(oe.pathname);return{matches:eu,loaderData:{},errors:{[Kd.id]:Vn}}}}let yn=o||a,[Wt,Hn]=XB(t.history,R,he,Lt,oe,l.v7_partialHydration&&Xe===!0,l.v7_skipActionErrorRevalidation,U,Y,V,ue,K,q,yn,c,Je);if(nt($t=>!(he&&he.some(Vn=>Vn.route.id===$t))||Wt&&Wt.some(Vn=>Vn.route.id===$t)),re=++ee,Wt.length===0&&Hn.length===0){let $t=Ut();return ye(oe,Gn({matches:he,loaderData:{},errors:Je&&Qi(Je[1])?{[Je[0]]:Je[1].error}:null},r4(Je),$t?{fetchers:new Map(R.fetchers)}:{}),{flushSync:We}),{shortCircuited:!0}}if(Rr){let $t={};if(!Ce){$t.navigation=mt;let Vn=Yt(Je);Vn!==void 0&&($t.actionData=Vn)}Hn.length>0&&($t.fetchers=mn(Hn)),Ne($t,{flushSync:We})}Hn.forEach($t=>{Kn($t.key),$t.controller&&H.set($t.key,$t.controller)});let Jc=()=>Hn.forEach($t=>Kn($t.key));D&&D.signal.addEventListener("abort",Jc);let{loaderResults:La,fetcherResults:Vo}=await Oe(R,he,Wt,Hn,te);if(te.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",Jc),Hn.forEach($t=>H.delete($t.key));let Ms=gS(La);if(Ms)return await ge(te,Ms.result,!0,{replace:Ue}),{shortCircuited:!0};if(Ms=gS(Vo),Ms)return q.add(Ms.key),await ge(te,Ms.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:Bv,errors:Wd}=t4(R,he,La,Je,Hn,Vo,de);de.forEach(($t,Vn)=>{$t.subscribe(eu=>{(eu||$t.done)&&de.delete(Vn)})}),l.v7_partialHydration&&Xe&&R.errors&&(Wd=Gn({},R.errors,Wd));let Tl=Ut(),Gd=on(re),qd=Tl||Gd||Hn.length>0;return Gn({matches:he,loaderData:Bv,errors:Wd},qd?{fetchers:new Map(R.fetchers)}:{})}function Yt(te){if(te&&!Qi(te[1]))return{[te[0]]:te[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function mn(te){return te.forEach(oe=>{let he=R.fetchers.get(oe.key),Ce=Sy(void 0,he?he.data:void 0);R.fetchers.set(oe.key,Ce)}),new Map(R.fetchers)}function Xt(te,oe,he,Ce){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Kn(te);let Le=(Ce&&Ce.flushSync)===!0,qe=o||a,st=AN(R.location,R.matches,c,l.v7_prependBasename,he,l.v7_relativeSplatPath,oe,Ce==null?void 0:Ce.relative),Ue=pf(qe,st,c),Xe=ln(Ue,qe,st);if(Xe.active&&Xe.matches&&(Ue=Xe.matches),!Ue){Ye(te,oe,di(404,{pathname:st}),{flushSync:Le});return}let{path:We,submission:Je,error:mt}=KB(l.v7_normalizeFormMethod,!0,st,Ce);if(mt){Ye(te,oe,mt,{flushSync:Le});return}let Lt=By(Ue,We),Rr=(Ce&&Ce.preventScrollReset)===!0;if(Je&&ma(Je.formMethod)){J(te,oe,We,Lt,Ue,Xe.active,Le,Rr,Je);return}K.set(te,{routeId:oe,path:We}),fe(te,oe,We,Lt,Ue,Xe.active,Le,Rr,Je)}async function J(te,oe,he,Ce,Le,qe,st,Ue,Xe){xe(),K.delete(te);function We(ir){if(!ir.route.action&&!ir.route.lazy){let kl=di(405,{method:Xe.formMethod,pathname:he,routeId:oe});return Ye(te,oe,kl,{flushSync:st}),!0}return!1}if(!qe&&We(Ce))return;let Je=R.fetchers.get(te);Te(te,MNe(Xe,Je),{flushSync:st});let mt=new AbortController,Lt=Wp(t.history,he,mt.signal,Xe);if(qe){let ir=await Tn(Le,new URL(Lt.url).pathname,Lt.signal,te);if(ir.type==="aborted")return;if(ir.type==="error"){Ye(te,oe,ir.error,{flushSync:st});return}else if(ir.matches){if(Le=ir.matches,Ce=By(Le,he),We(Ce))return}else{Ye(te,oe,di(404,{pathname:he}),{flushSync:st});return}}H.set(te,mt);let Rr=ee,Wt=(await Pe("action",R,Lt,[Ce],Le,te))[Ce.route.id];if(Lt.signal.aborted){H.get(te)===mt&&H.delete(te);return}if(l.v7_fetcherPersist&&ue.has(te)){if(Ef(Wt)||Qi(Wt)){Te(te,bu(void 0));return}}else{if(Ef(Wt))if(H.delete(te),re>Rr){Te(te,bu(void 0));return}else return q.add(te),Te(te,Sy(Xe)),ge(Lt,Wt,!1,{fetcherSubmission:Xe,preventScrollReset:Ue});if(Qi(Wt)){Ye(te,oe,Wt.error);return}}if(ud(Wt))throw di(400,{type:"defer-action"});let Hn=R.navigation.location||R.location,Jc=Wp(t.history,Hn,mt.signal),La=o||a,Vo=R.navigation.state!=="idle"?pf(La,R.navigation.location,c):R.matches;Dt(Vo,"Didn't find any matches after fetcher action");let Ms=++ee;X.set(te,Ms);let Bv=Sy(Xe,Wt.data);R.fetchers.set(te,Bv);let[Wd,Tl]=XB(t.history,R,Vo,Xe,Hn,!1,l.v7_skipActionErrorRevalidation,U,Y,V,ue,K,q,La,c,[Ce.route.id,Wt]);Tl.filter(ir=>ir.key!==te).forEach(ir=>{let kl=ir.key,Uv=R.fetchers.get(kl),W_=Sy(void 0,Uv?Uv.data:void 0);R.fetchers.set(kl,W_),Kn(kl),ir.controller&&H.set(kl,ir.controller)}),Ne({fetchers:new Map(R.fetchers)});let Gd=()=>Tl.forEach(ir=>Kn(ir.key));mt.signal.addEventListener("abort",Gd);let{loaderResults:qd,fetcherResults:$t}=await Oe(R,Vo,Wd,Tl,Jc);if(mt.signal.aborted)return;mt.signal.removeEventListener("abort",Gd),X.delete(te),H.delete(te),Tl.forEach(ir=>H.delete(ir.key));let Vn=gS(qd);if(Vn)return ge(Jc,Vn.result,!1,{preventScrollReset:Ue});if(Vn=gS($t),Vn)return q.add(Vn.key),ge(Jc,Vn.result,!1,{preventScrollReset:Ue});let{loaderData:eu,errors:Kd}=t4(R,Vo,qd,void 0,Tl,$t,de);if(R.fetchers.has(te)){let ir=bu(Wt.data);R.fetchers.set(te,ir)}on(Ms),R.navigation.state==="loading"&&Ms>re?(Dt(E,"Expected pending action"),D&&D.abort(),ye(R.navigation.location,{matches:Vo,loaderData:eu,errors:Kd,fetchers:new Map(R.fetchers)})):(Ne({errors:Kd,loaderData:n4(R.loaderData,eu,Vo,Kd),fetchers:new Map(R.fetchers)}),U=!1)}async function fe(te,oe,he,Ce,Le,qe,st,Ue,Xe){let We=R.fetchers.get(te);Te(te,Sy(Xe,We?We.data:void 0),{flushSync:st});let Je=new AbortController,mt=Wp(t.history,he,Je.signal);if(qe){let Wt=await Tn(Le,new URL(mt.url).pathname,mt.signal,te);if(Wt.type==="aborted")return;if(Wt.type==="error"){Ye(te,oe,Wt.error,{flushSync:st});return}else if(Wt.matches)Le=Wt.matches,Ce=By(Le,he);else{Ye(te,oe,di(404,{pathname:he}),{flushSync:st});return}}H.set(te,Je);let Lt=ee,yn=(await Pe("loader",R,mt,[Ce],Le,te))[Ce.route.id];if(ud(yn)&&(yn=await R$(yn,mt.signal,!0)||yn),H.get(te)===Je&&H.delete(te),!mt.signal.aborted){if(ue.has(te)){Te(te,bu(void 0));return}if(Ef(yn))if(re>Lt){Te(te,bu(void 0));return}else{q.add(te),await ge(mt,yn,!1,{preventScrollReset:Ue});return}if(Qi(yn)){Ye(te,oe,yn.error);return}Dt(!ud(yn),"Unhandled fetcher deferred data"),Te(te,bu(yn.data))}}async function ge(te,oe,he,Ce){let{submission:Le,fetcherSubmission:qe,preventScrollReset:st,replace:Ue}=Ce===void 0?{}:Ce;oe.response.headers.has("X-Remix-Revalidate")&&(U=!0);let Xe=oe.response.headers.get("Location");Dt(Xe,"Expected a Location header on the redirect Response"),Xe=JB(Xe,new URL(te.url),c);let We=t0(R.location,Xe,{_isRedirect:!0});if(n){let Wt=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))Wt=!0;else if(A$.test(Xe)){const Hn=t.history.createURL(Xe);Wt=Hn.origin!==e.location.origin||Rd(Hn.pathname,c)==null}if(Wt){Ue?e.location.replace(Xe):e.location.assign(Xe);return}}D=null;let Je=Ue===!0||oe.response.headers.has("X-Remix-Replace")?Er.Replace:Er.Push,{formMethod:mt,formAction:Lt,formEncType:Rr}=R.navigation;!Le&&!qe&&mt&&Lt&&Rr&&(Le=o4(R.navigation));let yn=Le||qe;if(pNe.has(oe.response.status)&&yn&&ma(yn.formMethod))await Qe(Je,We,{submission:Gn({},yn,{formAction:Xe}),preventScrollReset:st||T,enableViewTransition:he?O:void 0});else{let Wt=KT(We,Le);await Qe(Je,We,{overrideNavigation:Wt,fetcherSubmission:qe,preventScrollReset:st||T,enableViewTransition:he?O:void 0})}}async function Pe(te,oe,he,Ce,Le,qe){let st,Ue={};try{st=await xNe(u,te,oe,he,Ce,Le,qe,i,s)}catch(Xe){return Ce.forEach(We=>{Ue[We.route.id]={type:fn.error,error:Xe}}),Ue}for(let[Xe,We]of Object.entries(st))if(PNe(We)){let Je=We.result;Ue[Xe]={type:fn.redirect,response:CNe(Je,he,Xe,Le,c,l.v7_relativeSplatPath)}}else Ue[Xe]=await ENe(We);return Ue}async function Oe(te,oe,he,Ce,Le){let qe=te.matches,st=Pe("loader",te,Le,he,oe,null),Ue=Promise.all(Ce.map(async Je=>{if(Je.matches&&Je.match&&Je.controller){let Lt=(await Pe("loader",te,Wp(t.history,Je.path,Je.controller.signal),[Je.match],Je.matches,Je.key))[Je.match.route.id];return{[Je.key]:Lt}}else return Promise.resolve({[Je.key]:{type:fn.error,error:di(404,{pathname:Je.path})}})})),Xe=await st,We=(await Ue).reduce((Je,mt)=>Object.assign(Je,mt),{});return await Promise.all([DNe(oe,Xe,Le.signal,qe,te.loaderData),NNe(oe,We,Ce)]),{loaderResults:Xe,fetcherResults:We}}function xe(){U=!0,Y.push(...nt()),K.forEach((te,oe)=>{H.has(oe)&&V.add(oe),Kn(oe)})}function Te(te,oe,he){he===void 0&&(he={}),R.fetchers.set(te,oe),Ne({fetchers:new Map(R.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Ye(te,oe,he,Ce){Ce===void 0&&(Ce={});let Le=mf(R.matches,oe);bt(te),Ne({errors:{[Le.route.id]:he},fetchers:new Map(R.fetchers)},{flushSync:(Ce&&Ce.flushSync)===!0})}function Rt(te){return Z.set(te,(Z.get(te)||0)+1),ue.has(te)&&ue.delete(te),R.fetchers.get(te)||mNe}function bt(te){let oe=R.fetchers.get(te);H.has(te)&&!(oe&&oe.state==="loading"&&X.has(te))&&Kn(te),K.delete(te),X.delete(te),q.delete(te),l.v7_fetcherPersist&&ue.delete(te),V.delete(te),R.fetchers.delete(te)}function Os(te){let oe=(Z.get(te)||0)-1;oe<=0?(Z.delete(te),ue.add(te),l.v7_fetcherPersist||bt(te)):Z.set(te,oe),Ne({fetchers:new Map(R.fetchers)})}function Kn(te){let oe=H.get(te);oe&&(oe.abort(),H.delete(te))}function ps(te){for(let oe of te){let he=Rt(oe),Ce=bu(he.data);R.fetchers.set(oe,Ce)}}function Ut(){let te=[],oe=!1;for(let he of q){let Ce=R.fetchers.get(he);Dt(Ce,"Expected fetcher: "+he),Ce.state==="loading"&&(q.delete(he),te.push(he),oe=!0)}return ps(te),oe}function on(te){let oe=[];for(let[he,Ce]of X)if(Ce0}function gn(te,oe){let he=R.blockers.get(te)||tm;return ie.get(te)!==oe&&ie.set(te,oe),he}function Be(te){R.blockers.delete(te),ie.delete(te)}function it(te,oe){let he=R.blockers.get(te)||tm;Dt(he.state==="unblocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="blocked"||he.state==="blocked"&&oe.state==="proceeding"||he.state==="blocked"&&oe.state==="unblocked"||he.state==="proceeding"&&oe.state==="unblocked","Invalid blocker state transition: "+he.state+" -> "+oe.state);let Ce=new Map(R.blockers);Ce.set(te,oe),Ne({blockers:Ce})}function ot(te){let{currentLocation:oe,nextLocation:he,historyAction:Ce}=te;if(ie.size===0)return;ie.size>1&&fv(!1,"A router only supports one blocker at a time");let Le=Array.from(ie.entries()),[qe,st]=Le[Le.length-1],Ue=R.blockers.get(qe);if(!(Ue&&Ue.state==="proceeding")&&st({currentLocation:oe,nextLocation:he,historyAction:Ce}))return qe}function St(te){let oe=di(404,{pathname:te}),he=o||a,{matches:Ce,route:Le}=s4(he);return nt(),{notFoundMatches:Ce,route:Le,error:oe}}function nt(te){let oe=[];return de.forEach((he,Ce)=>{(!te||te(Ce))&&(he.cancel(),oe.push(Ce),de.delete(Ce))}),oe}function Ht(te,oe,he){if(p=te,y=oe,h=he||null,!g&&R.navigation===qT){g=!0;let Ce=an(R.location,R.matches);Ce!=null&&Ne({restoreScrollPosition:Ce})}return()=>{p=null,y=null,h=null}}function Ct(te,oe){return h&&h(te,oe.map(Ce=>GDe(Ce,R.loaderData)))||te.key}function vn(te,oe){if(p&&y){let he=Ct(te,oe);p[he]=y()}}function an(te,oe){if(p){let he=Ct(te,oe),Ce=p[he];if(typeof Ce=="number")return Ce}return null}function ln(te,oe,he){if(f)if(te){if(Object.keys(te[0].params).length>0)return{active:!0,matches:qS(oe,he,c,!0)}}else return{active:!0,matches:qS(oe,he,c,!0)||[]};return{active:!1,matches:null}}async function Tn(te,oe,he,Ce){if(!f)return{type:"success",matches:te};let Le=te;for(;;){let qe=o==null,st=o||a,Ue=i;try{await f({signal:he,path:oe,matches:Le,fetcherKey:Ce,patch:(Je,mt)=>{he.aborted||ZB(Je,mt,st,Ue,s)}})}catch(Je){return{type:"error",error:Je,partialMatches:Le}}finally{qe&&!he.aborted&&(a=[...a])}if(he.aborted)return{type:"aborted"};let Xe=pf(st,oe,c);if(Xe)return{type:"success",matches:Xe};let We=qS(st,oe,c,!0);if(!We||Le.length===We.length&&Le.every((Je,mt)=>Je.route.id===We[mt].route.id))return{type:"success",matches:null};Le=We}}function hr(te){i={},o=CC(te,s,void 0,i)}function kn(te,oe){let he=o==null;ZB(te,oe,o||a,i,s),he&&(a=[...a],Ne({}))}return k={get basename(){return c},get future(){return l},get state(){return R},get routes(){return a},get window(){return e},initialize:Ae,subscribe:Me,enableScrollRestoration:Ht,navigate:$e,fetch:Xt,revalidate:ut,createHref:te=>t.history.createHref(te),encodeLocation:te=>t.history.encodeLocation(te),getFetcher:Rt,deleteFetcher:Os,dispose:_e,getBlocker:gn,deleteBlocker:Be,patchRoutes:kn,_internalFetchControllers:H,_internalActiveDeferreds:de,_internalSetRoutes:hr},k}function yNe(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function AN(t,e,n,r,s,i,a,o){let c,u;if(a){c=[];for(let l of e)if(c.push(l),l.route.id===a){u=l;break}}else c=e,u=e[e.length-1];let f=MA(s||".",OA(c,i),Rd(t.pathname,n)||t.pathname,o==="path");if(s==null&&(f.search=t.search,f.hash=t.hash),(s==null||s===""||s===".")&&u){let l=P$(f.search);if(u.route.index&&!l)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&l){let d=new URLSearchParams(f.search),m=d.getAll("index");d.delete("index"),m.filter(h=>h).forEach(h=>d.append("index",h));let p=d.toString();f.search=p?"?"+p:""}}return r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:Nc([n,f.pathname])),Jh(f)}function KB(t,e,n,r){if(!r||!yNe(r))return{path:n};if(r.formMethod&&!kNe(r.formMethod))return{path:n,error:di(405,{method:r.formMethod})};let s=()=>({path:n,error:di(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=t?i.toUpperCase():i.toLowerCase(),o=hQ(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ma(a))return s();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,p)=>{let[h,y]=p;return""+m+h+"="+y+` +`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!ma(a))return s();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:o,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return s()}}}Dt(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=PN(r.formData),u=r.formData;else if(r.body instanceof FormData)c=PN(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=e4(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=e4(c)}catch{return s()}let f={formMethod:a,formAction:o,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(ma(f.formMethod))return{path:n,submission:f};let l=zd(n);return e&&l.search&&P$(l.search)&&c.append("index",""),l.search="?"+c,{path:Jh(l),submission:f}}function YB(t,e,n){n===void 0&&(n=!1);let r=t.findIndex(s=>s.route.id===e);return r>=0?t.slice(0,n?r+1:r):t}function XB(t,e,n,r,s,i,a,o,c,u,f,l,d,m,p,h){let y=h?Qi(h[1])?h[1].error:h[1].data:void 0,g=t.createURL(e.location),v=t.createURL(s),w=n;i&&e.errors?w=YB(n,Object.keys(e.errors)[0],!0):h&&Qi(h[1])&&(w=YB(n,h[0]));let x=h?h[1].statusCode:void 0,A=a&&x&&x>=400,k=w.filter((E,T)=>{let{route:D}=E;if(D.lazy)return!0;if(D.loader==null)return!1;if(i)return RN(D,e.loaderData,e.errors);if(bNe(e.loaderData,e.matches[T],E)||c.some(I=>I===E.route.id))return!0;let O=e.matches[T],L=E;return QB(E,Gn({currentUrl:g,currentParams:O.params,nextUrl:v,nextParams:L.params},r,{actionResult:y,actionStatus:x,defaultShouldRevalidate:A?!1:o||g.pathname+g.search===v.pathname+v.search||g.search!==v.search||dQ(O,L)}))}),R=[];return l.forEach((E,T)=>{if(i||!n.some(F=>F.route.id===E.routeId)||f.has(T))return;let D=pf(m,E.path,p);if(!D){R.push({key:T,routeId:E.routeId,path:E.path,matches:null,match:null,controller:null});return}let O=e.fetchers.get(T),L=By(D,E.path),I=!1;d.has(T)?I=!1:u.has(T)?(u.delete(T),I=!0):O&&O.state!=="idle"&&O.data===void 0?I=o:I=QB(L,Gn({currentUrl:g,currentParams:e.matches[e.matches.length-1].params,nextUrl:v,nextParams:n[n.length-1].params},r,{actionResult:y,actionStatus:x,defaultShouldRevalidate:A?!1:o})),I&&R.push({key:T,routeId:E.routeId,path:E.path,matches:D,match:L,controller:new AbortController})}),[k,R]}function RN(t,e,n){if(t.lazy)return!0;if(!t.loader)return!1;let r=e!=null&&e[t.id]!==void 0,s=n!=null&&n[t.id]!==void 0;return!r&&s?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!r&&!s}function bNe(t,e,n){let r=!e||n.route.id!==e.route.id,s=t[n.route.id]===void 0;return r||s}function dQ(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function QB(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function ZB(t,e,n,r,s){var i;let a;if(t){let u=r[t];Dt(u,"No route found to patch children into: routeId = "+t),u.children||(u.children=[]),a=u.children}else a=n;let o=e.filter(u=>!a.some(f=>fQ(u,f))),c=CC(o,s,[t||"_","patch",String(((i=a)==null?void 0:i.length)||"0")],r);a.push(...c)}function fQ(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,r)=>{var s;return(s=e.children)==null?void 0:s.some(i=>fQ(n,i))}):!1}async function wNe(t,e,n){if(!t.lazy)return;let r=await t.lazy();if(!t.lazy)return;let s=n[t.id];Dt(s,"No route found in manifest");let i={};for(let a in r){let c=s[a]!==void 0&&a!=="hasErrorBoundary";fv(!c,'Route "'+s.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!VDe.has(a)&&(i[a]=r[a])}Object.assign(s,i),Object.assign(s,Gn({},e(s),{lazy:void 0}))}async function _Ne(t){let{matches:e}=t,n=e.filter(s=>s.shouldLoad);return(await Promise.all(n.map(s=>s.resolve()))).reduce((s,i,a)=>Object.assign(s,{[n[a].route.id]:i}),{})}async function xNe(t,e,n,r,s,i,a,o,c,u){let f=i.map(m=>m.route.lazy?wNe(m.route,c,o):void 0),l=i.map((m,p)=>{let h=f[p],y=s.some(v=>v.route.id===m.route.id);return Gn({},m,{shouldLoad:y,resolve:async v=>(v&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(y=!0),y?SNe(e,r,m,h,v,u):Promise.resolve({type:fn.data,result:void 0}))})}),d=await t({matches:l,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(f)}catch{}return d}async function SNe(t,e,n,r,s,i){let a,o,c=u=>{let f,l=new Promise((p,h)=>f=h);o=()=>f(),e.signal.addEventListener("abort",o);let d=p=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+t+'" [routeId: '+n.route.id+"]"))):u({request:e,params:n.params,context:i},...p!==void 0?[p]:[]),m=(async()=>{try{return{type:"data",result:await(s?s(h=>d(h)):d())}}catch(p){return{type:"error",result:p}}})();return Promise.race([m,l])};try{let u=n.route[t];if(r)if(u){let f,[l]=await Promise.all([c(u).catch(d=>{f=d}),r]);if(f!==void 0)throw f;a=l}else if(await r,u=n.route[t],u)a=await c(u);else if(t==="action"){let f=new URL(e.url),l=f.pathname+f.search;throw di(405,{method:e.method,pathname:l,routeId:n.route.id})}else return{type:fn.data,result:void 0};else if(u)a=await c(u);else{let f=new URL(e.url),l=f.pathname+f.search;throw di(404,{pathname:l})}Dt(a.result!==void 0,"You defined "+(t==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+t+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:fn.error,result:u}}finally{o&&e.signal.removeEventListener("abort",o)}return a}async function ENe(t){let{result:e,type:n}=t;if(pQ(e)){let l;try{let d=e.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?e.body==null?l=null:l=await e.json():l=await e.text()}catch(d){return{type:fn.error,error:d}}return n===fn.error?{type:fn.error,error:new AC(e.status,e.statusText,l),statusCode:e.status,headers:e.headers}:{type:fn.data,data:l,statusCode:e.status,headers:e.headers}}if(n===fn.error){if(i4(e)){var r,s;if(e.data instanceof Error){var i,a;return{type:fn.error,error:e.data,statusCode:(i=e.init)==null?void 0:i.status,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}}return{type:fn.error,error:new AC(((r=e.init)==null?void 0:r.status)||500,void 0,e.data),statusCode:n0(e)?e.status:void 0,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}}return{type:fn.error,error:e,statusCode:n0(e)?e.status:void 0}}if(TNe(e)){var o,c;return{type:fn.deferred,deferredData:e,statusCode:(o=e.init)==null?void 0:o.status,headers:((c=e.init)==null?void 0:c.headers)&&new Headers(e.init.headers)}}if(i4(e)){var u,f;return{type:fn.data,data:e.data,statusCode:(u=e.init)==null?void 0:u.status,headers:(f=e.init)!=null&&f.headers?new Headers(e.init.headers):void 0}}return{type:fn.data,data:e}}function CNe(t,e,n,r,s,i){let a=t.headers.get("Location");if(Dt(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!A$.test(a)){let o=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=AN(new URL(e.url),o,s,!0,a,i),t.headers.set("Location",a)}return t}function JB(t,e,n){if(A$.test(t)){let r=t,s=r.startsWith("//")?new URL(e.protocol+r):new URL(r),i=Rd(s.pathname,n)!=null;if(s.origin===e.origin&&i)return s.pathname+s.search+s.hash}return t}function Wp(t,e,n,r){let s=t.createURL(hQ(e)).toString(),i={signal:n};if(r&&ma(r.formMethod)){let{formMethod:a,formEncType:o}=r;i.method=a.toUpperCase(),o==="application/json"?(i.headers=new Headers({"Content-Type":o}),i.body=JSON.stringify(r.json)):o==="text/plain"?i.body=r.text:o==="application/x-www-form-urlencoded"&&r.formData?i.body=PN(r.formData):i.body=r.formData}return new Request(s,i)}function PN(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function e4(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function ANe(t,e,n,r,s){let i={},a=null,o,c=!1,u={},f=n&&Qi(n[1])?n[1].error:void 0;return t.forEach(l=>{if(!(l.route.id in e))return;let d=l.route.id,m=e[d];if(Dt(!Ef(m),"Cannot handle redirect results in processLoaderData"),Qi(m)){let p=m.error;f!==void 0&&(p=f,f=void 0),a=a||{};{let h=mf(t,d);a[h.route.id]==null&&(a[h.route.id]=p)}i[d]=void 0,c||(c=!0,o=n0(m.error)?m.error.status:500),m.headers&&(u[d]=m.headers)}else ud(m)?(r.set(d,m.deferredData),i[d]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[d]=m.headers)):(i[d]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(o=m.statusCode),m.headers&&(u[d]=m.headers))}),f!==void 0&&n&&(a={[n[0]]:f},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:o||200,loaderHeaders:u}}function t4(t,e,n,r,s,i,a){let{loaderData:o,errors:c}=ANe(e,n,r,a);return s.forEach(u=>{let{key:f,match:l,controller:d}=u,m=i[f];if(Dt(m,"Did not find corresponding fetcher result"),!(d&&d.signal.aborted))if(Qi(m)){let p=mf(t.matches,l==null?void 0:l.route.id);c&&c[p.route.id]||(c=Gn({},c,{[p.route.id]:m.error})),t.fetchers.delete(f)}else if(Ef(m))Dt(!1,"Unhandled fetcher revalidation redirect");else if(ud(m))Dt(!1,"Unhandled fetcher deferred data");else{let p=bu(m.data);t.fetchers.set(f,p)}}),{loaderData:o,errors:c}}function n4(t,e,n,r){let s=Gn({},e);for(let i of n){let a=i.route.id;if(e.hasOwnProperty(a)?e[a]!==void 0&&(s[a]=e[a]):t[a]!==void 0&&i.route.loader&&(s[a]=t[a]),r&&r.hasOwnProperty(a))break}return s}function r4(t){return t?Qi(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function mf(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function s4(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function di(t,e){let{pathname:n,routeId:r,method:s,type:i,message:a}=e===void 0?{}:e,o="Unknown Server Error",c="Unknown @remix-run/router error";return t===400?(o="Bad Request",s&&n&&r?c="You made a "+s+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):t===403?(o="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):t===404?(o="Not Found",c='No route matches URL "'+n+'"'):t===405&&(o="Method Not Allowed",s&&n&&r?c="You made a "+s.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":s&&(c='Invalid request method "'+s.toUpperCase()+'"')),new AC(t||500,o,new Error(c),!0)}function gS(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,s]=e[n];if(Ef(s))return{key:r,result:s}}}function hQ(t){let e=typeof t=="string"?zd(t):t;return Jh(Gn({},e,{hash:""}))}function RNe(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function PNe(t){return pQ(t.result)&&hNe.has(t.result.status)}function ud(t){return t.type===fn.deferred}function Qi(t){return t.type===fn.error}function Ef(t){return(t&&t.type)===fn.redirect}function i4(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function TNe(t){let e=t;return e&&typeof e=="object"&&typeof e.data=="object"&&typeof e.subscribe=="function"&&typeof e.cancel=="function"&&typeof e.resolveData=="function"}function pQ(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function kNe(t){return fNe.has(t.toLowerCase())}function ma(t){return uNe.has(t.toLowerCase())}async function DNe(t,e,n,r,s){let i=Object.entries(e);for(let a=0;a(d==null?void 0:d.route.id)===o);if(!u)continue;let f=r.find(d=>d.route.id===u.route.id),l=f!=null&&!dQ(f,u)&&(s&&s[u.route.id])!==void 0;ud(c)&&l&&await R$(c,n,!1).then(d=>{d&&(e[o]=d)})}}async function NNe(t,e,n){for(let r=0;r(u==null?void 0:u.route.id)===i)&&ud(o)&&(Dt(a,"Expected an AbortController for revalidating fetcher deferred result"),await R$(o,a.signal,!0).then(u=>{u&&(e[s]=u)}))}}async function R$(t,e,n){if(n===void 0&&(n=!1),!await t.deferredData.resolveData(e)){if(n)try{return{type:fn.data,data:t.deferredData.unwrappedData}}catch(s){return{type:fn.error,error:s}}return{type:fn.data,data:t.deferredData.data}}}function P$(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function By(t,e){let n=typeof e=="string"?zd(e).search:e.search;if(t[t.length-1].route.index&&P$(n||""))return t[t.length-1];let r=lQ(t);return r[r.length-1]}function o4(t){let{formMethod:e,formAction:n,formEncType:r,text:s,formData:i,json:a}=t;if(!(!e||!n||!r)){if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:e,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function KT(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function ONe(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Sy(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function MNe(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function bu(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function LNe(t,e){try{let n=t.sessionStorage.getItem(uQ);if(n){let r=JSON.parse(n);for(let[s,i]of Object.entries(r||{}))i&&Array.isArray(i)&&e.set(s,new Set(i||[]))}}catch{}}function INe(t,e){if(e.size>0){let n={};for(let[r,s]of e)n[r]=[...s];try{t.sessionStorage.setItem(uQ,JSON.stringify(n))}catch(r){fv(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** * React Router v6.30.0 * * Copyright (c) Remix Software Inc. @@ -257,7 +257,7 @@ Defaulting to \`null\`.`}var J7=Y7,lPe=Q7;const cPe=_.forwardRef(({className:t,v * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function hv(){return hv=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),_.useCallback(function(u,f){if(f===void 0&&(f={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let l=OA(u,JSON.parse(a),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:Dc([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,a,i,t])}const LNe=_.createContext(null);function INe(t){let e=_.useContext(Rl).outlet;return e&&_.createElement(LNe.Provider,{value:t},e)}function yUe(){let{matches:t}=_.useContext(Rl),e=t[t.length-1];return e?e.params:{}}function pQ(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=_.useContext(Bd),{matches:s}=_.useContext(Rl),{pathname:i}=Ud(),a=JSON.stringify(NA(s,r.v7_relativeSplatPath));return _.useMemo(()=>OA(t,JSON.parse(a),i,n==="path"),[t,a,i,n])}function $Ne(t,e,n,r){Mv()||Dt(!1);let{navigator:s,static:i}=_.useContext(Bd),{matches:a}=_.useContext(Rl),o=a[a.length-1],c=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let f=Ud(),l;l=f;let d=l.pathname||"/",m=d;if(u!=="/"){let y=u.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=!i&&n&&n.matches&&n.matches.length>0?n.matches:pf(t,{pathname:m});return UNe(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Dc([u,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:Dc([u,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function FNe(){let t=VNe(),e=n0(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:s},n):null,null)}const jNe=_.createElement(FNe,null);class zNe extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement(Rl.Provider,{value:this.props.routeContext},_.createElement(fQ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function BNe(t){let{routeContext:e,match:n,children:r}=t,s=_.useContext(MA);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Rl.Provider,{value:e},r)}function UNe(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,o=(s=n)==null?void 0:s.errors;if(o!=null){let f=a.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id])!==void 0);f>=0||Dt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,l,d)=>{let m,p=!1,h=null,y=null;n&&(m=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||jNe,c&&(u<0&&d===0?(qNe("route-fallback"),p=!0,y=null):u===d&&(p=!0,y=l.route.hydrateFallbackElement||null)));let g=e.concat(a.slice(0,d+1)),v=()=>{let w;return m?w=h:p?w=y:l.route.Component?w=_.createElement(l.route.Component,null):l.route.element?w=l.route.element:w=f,_.createElement(BNe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(l.route.ErrorBoundary||l.route.errorElement||d===0)?_.createElement(zNe,{location:n.location,revalidation:n.revalidation,component:h,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var mQ=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(mQ||{}),gQ=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(gQ||{});function vQ(t){let e=_.useContext(MA);return e||Dt(!1),e}function yQ(t){let e=_.useContext(dQ);return e||Dt(!1),e}function HNe(t){let e=_.useContext(Rl);return e||Dt(!1),e}function bQ(t){let e=HNe(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function VNe(){var t;let e=_.useContext(fQ),n=yQ(),r=bQ();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let WNe=0;function bUe(t){let{router:e,basename:n}=vQ(),r=yQ(),[s,i]=_.useState(""),a=_.useCallback(o=>{if(typeof t!="function")return!!t;if(n==="/")return t(o);let{currentLocation:c,nextLocation:u,historyAction:f}=o;return t({currentLocation:hv({},c,{pathname:Rd(c.pathname,n)||c.pathname}),nextLocation:hv({},u,{pathname:Rd(u.pathname,n)||u.pathname}),historyAction:f})},[n,t]);return _.useEffect(()=>{let o=String(++WNe);return i(o),()=>e.deleteBlocker(o)},[e]),_.useEffect(()=>{s!==""&&e.getBlocker(s,a)},[e,s,a]),s&&r.blockers.has(s)?r.blockers.get(s):em}function GNe(){let{router:t}=vQ(mQ.UseNavigateStable),e=bQ(gQ.UseNavigateStable),n=_.useRef(!1);return hQ(()=>{n.current=!0}),_.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,hv({fromRouteId:e},i)))},[t,e])}const s4={};function qNe(t,e,n){s4[t]||(s4[t]=!0)}function KNe(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function wQ(t){let{to:e,replace:n,state:r,relative:s}=t;Mv()||Dt(!1);let{future:i,static:a}=_.useContext(Bd),{matches:o}=_.useContext(Rl),{pathname:c}=Ud(),u=Lv(),f=OA(e,NA(o,i.v7_relativeSplatPath),c,s==="path"),l=JSON.stringify(f);return _.useEffect(()=>u(JSON.parse(l),{replace:n,state:r,relative:s}),[u,l,s,n,r]),null}function gS(t){return INe(t.context)}function YNe(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Er.Pop,navigator:i,static:a=!1,future:o}=t;Mv()&&Dt(!1);let c=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:c,navigator:i,static:a,future:hv({v7_relativeSplatPath:!1},o)}),[c,o,i,a]);typeof r=="string"&&(r=zd(r));let{pathname:f="/",search:l="",hash:d="",state:m=null,key:p="default"}=r,h=_.useMemo(()=>{let y=Rd(f,c);return y==null?null:{location:{pathname:y,search:l,hash:d,state:m,key:p},navigationType:s}},[c,f,l,d,m,p,s]);return h==null?null:_.createElement(Bd.Provider,{value:u},_.createElement(R$.Provider,{children:n,value:h}))}new Promise(()=>{});function XNe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:_.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:_.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:_.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** + */function hv(){return hv=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),_.useCallback(function(u,f){if(f===void 0&&(f={}),!o.current)return;if(typeof u=="number"){r.go(u);return}let l=MA(u,JSON.parse(a),i,f.relative==="path");t==null&&e!=="/"&&(l.pathname=l.pathname==="/"?e:Nc([e,l.pathname])),(f.replace?r.replace:r.push)(l,f.state,f)},[e,r,a,i,t])}const jNe=_.createContext(null);function zNe(t){let e=_.useContext(Pl).outlet;return e&&_.createElement(jNe.Provider,{value:t},e)}function CUe(){let{matches:t}=_.useContext(Pl),e=t[t.length-1];return e?e.params:{}}function yQ(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=_.useContext(Bd),{matches:s}=_.useContext(Pl),{pathname:i}=Ud(),a=JSON.stringify(OA(s,r.v7_relativeSplatPath));return _.useMemo(()=>MA(t,JSON.parse(a),i,n==="path"),[t,a,i,n])}function BNe(t,e,n,r){Mv()||Dt(!1);let{navigator:s,static:i}=_.useContext(Bd),{matches:a}=_.useContext(Pl),o=a[a.length-1],c=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let f=Ud(),l;l=f;let d=l.pathname||"/",m=d;if(u!=="/"){let y=u.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=!i&&n&&n.matches&&n.matches.length>0?n.matches:pf(t,{pathname:m});return GNe(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},c,y.params),pathname:Nc([u,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?u:Nc([u,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r)}function UNe(){let t=KNe(),e=n0(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),n?_.createElement("pre",{style:s},n):null,null)}const HNe=_.createElement(UNe,null);class VNe extends _.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?_.createElement(Pl.Provider,{value:this.props.routeContext},_.createElement(gQ.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function WNe(t){let{routeContext:e,match:n,children:r}=t,s=_.useContext(LA);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),_.createElement(Pl.Provider,{value:e},r)}function GNe(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let a=t,o=(s=n)==null?void 0:s.errors;if(o!=null){let f=a.findIndex(l=>l.route.id&&(o==null?void 0:o[l.route.id])!==void 0);f>=0||Dt(!1),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,l,d)=>{let m,p=!1,h=null,y=null;n&&(m=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||HNe,c&&(u<0&&d===0?(QNe("route-fallback"),p=!0,y=null):u===d&&(p=!0,y=l.route.hydrateFallbackElement||null)));let g=e.concat(a.slice(0,d+1)),v=()=>{let w;return m?w=h:p?w=y:l.route.Component?w=_.createElement(l.route.Component,null):l.route.element?w=l.route.element:w=f,_.createElement(WNe,{match:l,routeContext:{outlet:f,matches:g,isDataRoute:n!=null},children:w})};return n&&(l.route.ErrorBoundary||l.route.errorElement||d===0)?_.createElement(VNe,{location:n.location,revalidation:n.revalidation,component:h,error:m,children:v(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):v()},null)}var bQ=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(bQ||{}),wQ=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(wQ||{});function _Q(t){let e=_.useContext(LA);return e||Dt(!1),e}function xQ(t){let e=_.useContext(mQ);return e||Dt(!1),e}function qNe(t){let e=_.useContext(Pl);return e||Dt(!1),e}function SQ(t){let e=qNe(),n=e.matches[e.matches.length-1];return n.route.id||Dt(!1),n.route.id}function KNe(){var t;let e=_.useContext(gQ),n=xQ(),r=SQ();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}let YNe=0;function AUe(t){let{router:e,basename:n}=_Q(),r=xQ(),[s,i]=_.useState(""),a=_.useCallback(o=>{if(typeof t!="function")return!!t;if(n==="/")return t(o);let{currentLocation:c,nextLocation:u,historyAction:f}=o;return t({currentLocation:hv({},c,{pathname:Rd(c.pathname,n)||c.pathname}),nextLocation:hv({},u,{pathname:Rd(u.pathname,n)||u.pathname}),historyAction:f})},[n,t]);return _.useEffect(()=>{let o=String(++YNe);return i(o),()=>e.deleteBlocker(o)},[e]),_.useEffect(()=>{s!==""&&e.getBlocker(s,a)},[e,s,a]),s&&r.blockers.has(s)?r.blockers.get(s):tm}function XNe(){let{router:t}=_Q(bQ.UseNavigateStable),e=SQ(wQ.UseNavigateStable),n=_.useRef(!1);return vQ(()=>{n.current=!0}),_.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,hv({fromRouteId:e},i)))},[t,e])}const a4={};function QNe(t,e,n){a4[t]||(a4[t]=!0)}function ZNe(t,e){t==null||t.v7_startTransition,(t==null?void 0:t.v7_relativeSplatPath)===void 0&&(!e||e.v7_relativeSplatPath),e&&(e.v7_fetcherPersist,e.v7_normalizeFormMethod,e.v7_partialHydration,e.v7_skipActionErrorRevalidation)}function EQ(t){let{to:e,replace:n,state:r,relative:s}=t;Mv()||Dt(!1);let{future:i,static:a}=_.useContext(Bd),{matches:o}=_.useContext(Pl),{pathname:c}=Ud(),u=Lv(),f=MA(e,OA(o,i.v7_relativeSplatPath),c,s==="path"),l=JSON.stringify(f);return _.useEffect(()=>u(JSON.parse(l),{replace:n,state:r,relative:s}),[u,l,s,n,r]),null}function vS(t){return zNe(t.context)}function JNe(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Er.Pop,navigator:i,static:a=!1,future:o}=t;Mv()&&Dt(!1);let c=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:c,navigator:i,static:a,future:hv({v7_relativeSplatPath:!1},o)}),[c,o,i,a]);typeof r=="string"&&(r=zd(r));let{pathname:f="/",search:l="",hash:d="",state:m=null,key:p="default"}=r,h=_.useMemo(()=>{let y=Rd(f,c);return y==null?null:{location:{pathname:y,search:l,hash:d,state:m,key:p},navigationType:s}},[c,f,l,d,m,p,s]);return h==null?null:_.createElement(Bd.Provider,{value:u},_.createElement(T$.Provider,{children:n,value:h}))}new Promise(()=>{});function eOe(t){let e={hasErrorBoundary:t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&Object.assign(e,{element:_.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(e,{hydrateFallbackElement:_.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(e,{errorElement:_.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),e}/** * React Router DOM v6.30.0 * * Copyright (c) Remix Software Inc. @@ -266,18 +266,18 @@ Defaulting to \`null\`.`}var J7=Y7,lPe=Q7;const cPe=_.forwardRef(({className:t,v * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function r0(){return r0=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[s]=t[s]);return n}function ZNe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function JNe(t,e){return t.button===0&&(!e||e==="_self")&&!ZNe(t)}function PN(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function eOe(t,e){let n=PN(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const tOe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],nOe="6";try{window.__reactRouterVersion=nOe}catch{}function rOe(t,e){return hNe({basename:e==null?void 0:e.basename,future:r0({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:$De({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||sOe(),routes:t,mapRouteProperties:XNe,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function sOe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=r0({},e,{errors:iOe(e.errors)})),e}function iOe(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,s]of e)if(s&&s.__type==="RouteErrorResponse")n[r]=new CC(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let a=new i(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const oOe=_.createContext({isTransitioning:!1}),aOe=_.createContext(new Map),lOe="startTransition",i4=Kw[lOe],cOe="flushSync",o4=Wue[cOe];function uOe(t){i4?i4(t):t()}function Ey(t){o4?o4(t):t()}class dOe{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function fOe(t){let{fallbackElement:e,router:n,future:r}=t,[s,i]=_.useState(n.state),[a,o]=_.useState(),[c,u]=_.useState({isTransitioning:!1}),[f,l]=_.useState(),[d,m]=_.useState(),[p,h]=_.useState(),y=_.useRef(new Map),{v7_startTransition:g}=r||{},v=_.useCallback(E=>{g?uOe(E):E()},[g]),w=_.useCallback((E,T)=>{let{deletedFetchers:D,flushSync:O,viewTransitionOpts:L}=T;E.fetchers.forEach((F,U)=>{F.data!==void 0&&y.current.set(U,F.data)}),D.forEach(F=>y.current.delete(F));let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||I){O?Ey(()=>i(E)):v(()=>i(E));return}if(O){Ey(()=>{d&&(f&&f.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let F=n.window.document.startViewTransition(()=>{Ey(()=>i(E))});F.finished.finally(()=>{Ey(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),Ey(()=>m(F));return}d?(f&&f.resolve(),d.skipTransition(),h({state:E,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,d,f,y,v]);_.useLayoutEffect(()=>n.subscribe(w),[n,w]),_.useEffect(()=>{c.isTransitioning&&!c.flushSync&&l(new dOe)},[c]),_.useEffect(()=>{if(f&&a&&n.window){let E=a,T=f.promise,D=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await T});D.finished.finally(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(D)}},[v,a,f,n.window]),_.useEffect(()=>{f&&a&&s.location.key===a.location.key&&f.resolve()},[f,d,s.location,a]),_.useEffect(()=>{!c.isTransitioning&&p&&(o(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),h(void 0))},[c.isTransitioning,p]),_.useEffect(()=>{},[]);let x=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,T,D)=>n.navigate(E,{state:T,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(E,T,D)=>n.navigate(E,{replace:!0,state:T,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[n]),A=n.basename||"/",k=_.useMemo(()=>({router:n,navigator:x,static:!1,basename:A}),[n,x,A]),R=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.useEffect(()=>KNe(r,n.future),[r,n.future]),_.createElement(_.Fragment,null,_.createElement(MA.Provider,{value:k},_.createElement(dQ.Provider,{value:s},_.createElement(aOe.Provider,{value:y.current},_.createElement(oOe.Provider,{value:c},_.createElement(YNe,{basename:A,location:s.location,navigationType:s.historyAction,navigator:x,future:R},s.initialized||n.future.v7_partialHydration?_.createElement(hOe,{routes:n.routes,future:n.future,state:s}):e))))),null)}const hOe=_.memo(pOe);function pOe(t){let{routes:e,future:n,state:r}=t;return $Ne(e,void 0,r,n)}const mOe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gOe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gf=_.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:o,target:c,to:u,preventScrollReset:f,viewTransition:l}=e,d=QNe(e,tOe),{basename:m}=_.useContext(Bd),p,h=!1;if(typeof u=="string"&&gOe.test(u)&&(p=u,mOe))try{let w=new URL(window.location.href),x=u.startsWith("//")?new URL(w.protocol+u):new URL(u),A=Rd(x.pathname,m);x.origin===w.origin&&A!=null?u=A+x.search+x.hash:h=!0}catch{}let y=ONe(u,{relative:s}),g=vOe(u,{replace:a,state:o,target:c,preventScrollReset:f,relative:s,viewTransition:l});function v(w){r&&r(w),w.defaultPrevented||g(w)}return _.createElement("a",r0({},d,{href:p||y,onClick:h||i?r:v,ref:n,target:c}))});var a4;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(a4||(a4={}));var l4;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(l4||(l4={}));function vOe(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,c=Lv(),u=Ud(),f=pQ(t,{relative:a});return _.useCallback(l=>{if(JNe(l,n)){l.preventDefault();let d=r!==void 0?r:Zh(u)===Zh(f);c(t,{replace:d,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,c,f,r,s,n,t,i,a,o])}function yOe(t){let e=_.useRef(PN(t)),n=_.useRef(!1),r=Ud(),s=_.useMemo(()=>eOe(r.search,n.current?null:e.current),[r.search]),i=Lv(),a=_.useCallback((o,c)=>{const u=PN(typeof o=="function"?o(s):o);n.current=!0,i("?"+u,c)},[i,s]);return[s,a]}const _Q=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:a})=>P.jsx(rW,{open:t,children:P.jsxs(AL,{children:[P.jsxs(RL,{children:[P.jsx(TL,{children:r}),P.jsx(kL,{children:s})]}),P.jsxs(PL,{children:[P.jsx(NL,{children:P.jsx(gf,{to:"#",onClick:e,children:i})}),P.jsx(DL,{children:P.jsx(gf,{to:"#",onClick:n,children:a})})]})]})}),pt=t=>typeof t=="string",Cy=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},c4=t=>t==null?"":""+t,bOe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},wOe=/###/g,u4=t=>t&&t.indexOf("###")>-1?t.replace(wOe,"."):t,d4=t=>!t||pt(t),gb=(t,e,n)=>{const r=pt(e)?e.split("."):e;let s=0;for(;s{const{obj:r,k:s}=gb(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],a=e.slice(0,e.length-1),o=gb(t,a,Object);for(;o.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),o=gb(t,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${i}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${i}`]=n},_Oe=(t,e,n,r)=>{const{obj:s,k:i}=gb(t,e,Object);s[i]=s[i]||[],s[i].push(n)},AC=(t,e)=>{const{obj:n,k:r}=gb(t,e);if(n)return n[r]},xOe=(t,e,n)=>{const r=AC(t,n);return r!==void 0?r:AC(e,n)},xQ=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?pt(t[r])||t[r]instanceof String||pt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):xQ(t[r],e[r],n):t[r]=e[r]);return t},Wp=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var SOe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const EOe=t=>pt(t)?t.replace(/[&<>"'\/]/g,e=>SOe[e]):t;class COe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const AOe=[" ",",","?","!",";"],ROe=new COe(20),POe=(t,e,n)=>{e=e||"",n=n||"";const r=AOe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=ROe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!s.test(t);if(!i){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(i=!0)}return i},TN=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let s=t;for(let i=0;i-1&&ct&&t.replace("_","-"),TOe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class PC{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||TOe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[o,c]=a;for(let u=0;u{let[o,c]=a;for(let u=0;u1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,n],r&&(Array.isArray(r)?o.push(...r):pt(r)&&i?o.push(...r.split(i)):o.push(r)));const c=AC(this.data,o);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=o[0],n=o[1],r=o.slice(2).join(".")),c||!a||!pt(r)?c:TN(this.data&&this.data[e]&&this.data[e][n],r,i)}addResource(e,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let o=[e,n];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(o=e.split("."),s=n,n=o[1]),this.addNamespaces(n),f4(this.data,o,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(pt(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),s=r,r=n,n=o[1]),this.addNamespaces(n);let c=AC(this.data,o)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?xQ(c,r,i):c={...c,...r},f4(this.data,o,c),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var SQ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,r,s))}),e}};const p4={};class TC extends LA{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),bOe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=fl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!POe(e,r,s);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:pt(i)?[i]:i};const u=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(s)}return{key:e,namespaces:pt(i)?[i]:i}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],n),c=o[o.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const x=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${x}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${x}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const l=this.resolve(e,n);let d=l&&l.res;const m=l&&l.usedKey||a,p=l&&l.exactUsedKey||a,h=Object.prototype.toString.apply(d),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!pt(d)&&typeof d!="boolean"&&typeof d!="number";if(v&&d&&w&&y.indexOf(h)<0&&!(pt(g)&&Array.isArray(d))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,d,{...n,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(l.res=x,l.usedParams=this.getUsedParamsDetails(n),l):x}if(i){const x=Array.isArray(d),A=x?[]:{},k=x?p:m;for(const R in d)if(Object.prototype.hasOwnProperty.call(d,R)){const E=`${k}${i}${R}`;A[R]=this.translate(E,{...n,joinArrays:!1,ns:o}),A[R]===E&&(A[R]=d[R])}d=A}}else if(v&&pt(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,n,r));else{let x=!1,A=!1;const k=n.count!==void 0&&!pt(n.count),R=TC.hasDefaultValue(n),E=k?this.pluralResolver.getSuffix(u,n.count,n):"",T=n.ordinal&&k?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",D=k&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),O=D&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${T}`]||n.defaultValue;!this.isValidLookup(d)&&R&&(x=!0,d=O),this.isValidLookup(d)||(A=!0,d=a);const I=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:d,F=R&&O!==d&&this.options.updateMissing;if(A||x||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,a,F?O:d),i){const H=this.resolve(a,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let H=0;H{const X=R&&re!==d?re:I;this.options.missingKeyHandler?this.options.missingKeyHandler(H,c,ee,X,F,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,c,ee,X,F,n),this.emit("missingKey",H,c,ee,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?U.forEach(H=>{const ee=this.pluralResolver.getSuffixes(H,n);D&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(re=>{V([H],a+re,n[`defaultValue${re}`]||O)})}):V(U,a,O))}d=this.extendTranslation(d,e,n,l,r),A&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${c}:${a}`),(A||x)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,x?d:void 0):d=this.options.parseMissingKeyHandler(d))}return s?(l.res=d,l.usedParams=this.getUsedParamsDetails(n),l):d}extendTranslation(e,n,r,s,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=pt(e)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const d=e.match(this.interpolator.nestingRegexp);f=d&&d.length}let l=r.replace&&!pt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,r.lng||this.language||s.usedLng,r),u){const d=e.match(this.interpolator.nestingRegexp),m=d&&d.length;f1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,a,o;return pt(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),f=u.key;s=f;let l=u.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=n.count!==void 0&&!pt(n.count),m=d&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(pt(n.context)||typeof n.context=="number")&&n.context!=="",h=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(y=>{this.isValidLookup(r)||(o=y,!p4[`${h[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(p4[`${h[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${h.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(g=>{if(this.isValidLookup(r))return;a=g;const v=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,f,g,y,n);else{let x;d&&(x=this.pluralResolver.getSuffix(g,n.count,n));const A=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(v.push(f+x),n.ordinal&&x.indexOf(k)===0&&v.push(f+x.replace(k,this.options.pluralSeparator)),m&&v.push(f+A)),p){const R=`${f}${this.options.contextSeparator}${n.context}`;v.push(R),d&&(v.push(R+x),n.ordinal&&x.indexOf(k)===0&&v.push(R+x.replace(k,this.options.pluralSeparator)),m&&v.push(R+A))}}let w;for(;w=v.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(g,y,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!pt(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}const KT=t=>t.charAt(0).toUpperCase()+t.slice(1);class m4{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fl.create("languageUtils")}getScriptPartFromCode(e){if(e=RC(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=RC(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(pt(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(e)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=KT(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=KT(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=KT(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),pt(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],i=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return pt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):pt(e)&&i(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&i(this.formatLanguageCode(a))}),s}}let kOe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],DOe={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const NOe=["v1","v2","v3"],OOe=["v4"],g4={zero:0,one:1,two:2,few:3,many:4,other:5},MOe=()=>{const t={};return kOe.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:DOe[e.fc]}})}),t};class LOe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=fl.create("pluralResolver"),(!this.options.compatibilityJSON||OOe.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=MOe(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=RC(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!e.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,i)=>g4[s]-g4[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(e,s,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let s=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const i=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!NOe.includes(this.options.compatibilityJSON)}}const v4=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=xOe(t,e,n);return!i&&s&&pt(n)&&(i=TN(t,n,r),i===void 0&&(i=TN(e,n,r))),i},YT=t=>t.replace(/\$/g,"$$$$");class IOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=fl.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:c,formatSeparator:u,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=n!==void 0?n:EOe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Wp(i):a||"{{",this.suffix=o?Wp(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Wp(d):m||Wp("$t("),this.nestingSuffix=p?Wp(p):h||Wp(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let i,a,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const g=v4(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:m}):g}const p=m.split(this.formatSeparator),h=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(v4(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...s,...n,interpolationkey:h})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,l=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>YT(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?YT(this.escape(m)):YT(m)}].forEach(m=>{for(o=0;i=m.regex.exec(e);){const p=i[1].trim();if(a=u(p),a===void 0)if(typeof f=="function"){const y=f(e,i,s);a=pt(y)?y:""}else if(s&&Object.prototype.hasOwnProperty.call(s,p))a="";else if(l){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!pt(a)&&!this.useRawValueToEscape&&(a=c4(a));const h=m.safeValue(a);if(e=e.replace(i[0],h),l?(m.regex.lastIndex+=a.length,m.regex.lastIndex-=i[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,a;const o=(c,u)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const l=c.split(new RegExp(`${f}[ ]*{`));let d=`{${l[1]}`;c=l[0],d=this.interpolate(d,a);const m=d.match(/'/g),p=d.match(/"/g);(m&&m.length%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(h){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,h),`${c}${f}${d}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!pt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(l=>l.trim());s[1]=f.shift(),c=f,u=!0}if(i=n(o.call(this,s[1].trim(),a),a),i&&s[0]===e&&!pt(i))return i;pt(i)||(i=c4(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),u&&(i=c.reduce((f,l)=>this.format(f,l,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const $Oe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[o,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},Gp=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const a=r+JSON.stringify(i);let o=e[a];return o||(o=t(RC(r),s),e[a]=o),o(n)}};class FOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=fl.create("formatter"),this.options=e,this.formats={number:Gp((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:Gp((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:Gp((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:Gp((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:Gp((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Gp(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(o=>o.indexOf(")")>-1)){const o=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,o)].join(this.formatSeparator)}return i.reduce((o,c)=>{const{formatName:u,formatOptions:f}=$Oe(c);if(this.formats[u]){let l=o;try{const d=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=d.locale||d.lng||s.locale||s.lng||r;l=this.formats[u](o,m,{...f,...s,...d})}catch(d){this.logger.warn(d)}return l}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const jOe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class zOe extends LA{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=fl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(e,n,r,s){const i={},a={},o={},c={};return e.forEach(u=>{let f=!0;n.forEach(l=>{const d=`${u}|${l}`;!r.reload&&this.store.hasResourceBundle(u,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),i[d]===void 0&&(i[d]=!0),c[l]===void 0&&(c[l]=!0)))}),f||(o[u]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),i=s[0],a=s[1];n&&this.emit("failedLoading",i,a,n),!n&&r&&this.store.addResourceBundle(i,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const o={};this.queue.forEach(c=>{_Oe(c.loaded,[i],a),jOe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{o[u]||(o[u]={});const f=c.loaded[u];f.length&&f.forEach(l=>{o[u][l]===void 0&&(o[u][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(u&&f&&s{this.read.call(this,e,n,r,s+1,i*2,a)},i);return}a(u,f)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return c(e,n,o)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();pt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pt(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,n,r,s,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...a,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,n,r,s,c):f=u(e,n,r,s),f&&typeof f.then=="function"?f.then(l=>o(null,l)).catch(o):o(null,f)}catch(f){o(f)}else u(e,n,r,s,o,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const y4=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),pt(t[1])&&(e.defaultValue=t[1]),pt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),b4=t=>(pt(t.ns)&&(t.ns=[t.ns]),pt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),pt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),vS=()=>{},BOe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class s0 extends LA{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=b4(e),this.services={},this.logger=fl,this.modules={external:[]},BOe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(pt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=y4();this.options={...s,...this.options,...b4(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const i=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?fl.init(i(this.modules.logger),this.options):fl.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=FOe);const l=new m4(this.options);this.store=new h4(this.options.resources,this.options);const d=this.services;d.logger=fl,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new LOe(l,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(d.formatter=i(f),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new IOe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new zOe(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y1?p-1:0),y=1;y{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=vS),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const c=Cy(),u=()=>{const f=(l,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(d),r(l,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vS;const s=pt(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(i,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(o)})}else r(null)}reloadResources(e,n,r){const s=Cy();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=vS),this.services.backendConnector.reload(e,n,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&SQ.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=Cy();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},o=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=pt(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,r){var s=this;const i=function(a,o){let c;if(typeof o!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),l=2;l`${c.keyPrefix}${d}${p}`):m=c.keyPrefix?`${c.keyPrefix}${d}${a}`:a,s.t(m,c)};return pt(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(o,c)=>{const u=this.services.backendConnector.state[`${o}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(i,e)))}loadNamespaces(e,n){const r=Cy();return this.options.ns?(pt(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Cy();pt(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=s.concat(i),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new m4(y4());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new s0(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:vS;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new s0(s);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new h4(this.store.data,s),i.services.resourceStore=i.store),i.translator=new TC(i.services,s),i.translator.on("*",function(o){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f{const[e,n]=_.useState(!1),[r,s]=_.useState({title:"Título",description:"Descripción",cancelLabel:tr("common.no"),confirmLabel:tr("common.yes"),onCancel:()=>{},onConfirm:()=>{},...t}),i=(u,f)=>{u==null||u.preventDefault(),f&&s(f),n(!0)},a=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onCancel(u)},o=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onConfirm(u)},c=r?P.jsx(_Q,{isOpen:e,onCancel:a,onConfirm:o,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):P.jsx(P.Fragment,{});return{openDialog:i,cancelDialog:a,confirmDialog:o,DialogComponent:c}};var EQ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,a)=>{const o=a(375),c=a(8571),u=a(9474),f=a(1687),l=a(8652),d=a(8160),m=a(3292),p=a(6354),h=a(8901),y=a(9708),g=a(6914),v=a(2294),w=a(6133),x=a(1152),A=a(8863),k=a(2036),R={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return o(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){o(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const T=this.clone();T.$_terms.alterations=T.$_terms.alterations||[];for(const D in E){const O=E[D];o(typeof O=="function","Alteration adjuster for",D,"must be a function"),T.$_terms.alterations.push({target:D,adjuster:O})}return T.$_temp.ruleset=!1,T}artifact(E){return o(E!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return o(E===!1||typeof E=="string","Invalid to value"),o(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,T){return this._default("default",E,T)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const T=this.clone();return E!==void 0&&(E=T.$_compile(E,{override:!1})),T.$_setFlag("empty",E,{clone:!1})}error(E){return o(E,"Missing error"),o(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,T={}){return o(E!==void 0,"Missing example"),d.assertOptions(T,["override"]),this._inner("examples",E,{single:!0,override:T.override})}external(E,T){return typeof E=="object"&&(o(!T,"Cannot combine options with description"),T=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(T===void 0||T&&typeof T=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:T},{single:!0})}failover(E,T){return this._default("failover",E,T)}forbidden(){return this.presence("forbidden")}id(E){return E?(o(typeof E=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return o(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return o(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){o(E.length,"Missing notes");for(const T of E)o(T&&typeof T=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return o(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){o(E,"Missing preferences"),o(E.context===void 0,"Cannot override context"),o(E.externals===void 0,"Cannot override externals"),o(E.warnings===void 0,"Cannot override warnings"),o(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const T=this.clone();return T._preferences=d.preferences(T._preferences,E),T}presence(E){return o(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return o(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const T=this.clone(),D=E!==void 0&&!E;return T._preferences=d.preferences(T._preferences,{convert:D}),T}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const T of E)o(T&&typeof T=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return o(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const T=this.allow(...E);return T.$_setFlag("only",!!T._valids,{clone:!1}),T}when(E,T){const D=this.clone();D.$_terms.whens||(D.$_terms.whens=[]);const O=m.when(D,E,T);if(!["any","link"].includes(D.type)){const L=O.is?[O]:O.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===D.type,"Cannot combine",D.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===D.type,"Cannot combine",D.type,"with",I.otherwise&&I.otherwise.type)}return D.$_terms.whens.push(O),D.$_mutateRebuild()}cache(E){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const T=this.clone();return T._cache=E||l.provider.provision(),T.$_temp.ruleset=!1,T}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){o(d.isSchema(E),"Invalid schema object"),o(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let T=this.clone();if(this.type==="any"&&E.type!=="any"){const D=E.clone();for(const O of Object.keys(T))O!=="type"&&(D[O]=T[O]);T=D}T._ids.concat(E._ids),T._refs.register(E,w.toSibling),T._preferences=T._preferences?d.preferences(T._preferences,E._preferences):E._preferences,T._valids=k.merge(T._valids,E._valids,E._invalids),T._invalids=k.merge(T._invalids,E._invalids,E._valids);for(const D of E._singleRules.keys())T._singleRules.has(D)&&(T._rules=T._rules.filter(O=>O.keep||O.name!==D),T._singleRules.delete(D));for(const D of E._rules)E._definition.rules[D.method].multi||T._singleRules.set(D.name,D),T._rules.push(D);if(T._flags.empty&&E._flags.empty){T._flags.empty=T._flags.empty.concat(E._flags.empty);const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else if(E._flags.empty){T._flags.empty=E._flags.empty;const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else f(T._flags,E._flags);for(const D in E.$_terms){const O=E.$_terms[D];O?T.$_terms[D]?T.$_terms[D]=T.$_terms[D].concat(O):T.$_terms[D]=O.slice():T.$_terms[D]||(T.$_terms[D]=O)}return this.$_root._tracer&&this.$_root._tracer._combine(T,[this,E]),T.$_mutateRebuild()}extend(E){return o(!E.base,"Cannot extend type with another base"),h.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,T){o(!this._inRuleset(),"Cannot fork inside a ruleset");let D=this;for(let O of[].concat(E))O=Array.isArray(O)?O:O.split("."),D=D._ids.fork(O,T,D);return D.$_temp.ruleset=!1,D}rule(E){const T=this._definition;d.assertOptions(E,Object.keys(T.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const D=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(D>=0&&DD.tailor(E),ref:!1}),T.$_temp.ruleset=!1,T.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,T){return A.entry(E,this,T)}validateAsync(E,T){return A.entryAsync(E,this,T)}$_addRule(E){typeof E=="string"&&(E={name:E}),o(E&&typeof E=="object","Invalid options"),o(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)o(I[0]!=="_","Cannot set private rule properties");const T=Object.assign({},E);T._resolve=[],T.method=T.method||T.name;const D=this._definition.rules[T.method],O=T.args;o(D,"Unknown rule",T.method);const L=this.clone();if(O){o(Object.keys(O).length===1||Object.keys(O).length===this._definition.rules[T.name].args.length,"Invalid rule definition for",this.type,T.name);for(const I in O){let F=O[I];if(D.argsByName){const U=D.argsByName.get(I);if(U.ref&&d.isResolvable(F))T._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),O[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?O[I]=F:delete O[I]}}return D.multi||(L._ruleRemove(T.name,{clone:!1}),L._singleRules.set(T.name,T)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),D.priority?L._rules.unshift(T):L._rules.push(T),L}$_compile(E,T){return m.schema(this.$_root,E,T)}$_createError(E,T,D,O,L,I={}){const F=I.flags!==!1?this._flags:{},U=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new p.Report(E,T,D,F,U,O,L)}$_getFlag(E){return this._flags[E]}$_getRule(E){return this._singleRules.get(E)}$_mapLabels(E){return E=Array.isArray(E)?E:E.split("."),this._ids.labels(E)}$_match(E,T,D,O){(D=Object.assign({},D)).abortEarly=!0,D._externals=!1,T.snapshot();const L=!A.validate(E,this,T,D,O).errors;return T.restore(),L}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:T,name:D,path:O,key:L})=>{const I=this._definition[T][D]&&this._definition[T][D].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:L})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:T,key:D}={}){this._refs.register(E,T),this._ids.register(E,{key:D})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,T,D={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const O=this._definition.flags[E]||{};if(u(T,O.default)&&(T=void 0),u(T,this._flags[E]))return this;const L=D.clone!==!1?this.clone():this;return T!==void 0?(L._flags[E]=T,L.$_mutateRegister(T)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...T){return this[E][d.symbols.parent].call(this,...T)}$_validate(E,T,D){return A.validate(E,this,T,D)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const T in this.$_terms)E.$_terms[T]=this.$_terms[T]?this.$_terms[T].slice():null;E.$_super={};for(const T in this.$_super)E.$_super[T]=this._super[T].bind(E);return E}_bare(){const E=this.clone();E._reset();const T=E._definition.terms;for(const D in T){const O=T[D];E.$_terms[D]=O.init}return E.$_mutateRebuild()}_default(E,T,D={}){return d.assertOptions(D,"literal"),o(T!==void 0,"Missing",E,"value"),o(typeof T=="function"||!D.literal,"Only function value supports literal option"),typeof T=="function"&&D.literal&&(T={[d.symbols.literal]:!0,literal:T}),this.$_setFlag(E,T)}_generate(E,T,D){if(!this.$_terms.whens)return{schema:this};const O=[],L=[];for(let U=0;Uee)break}const I=L.join(", ");if(T.mainstay.tracer.debug(T,"rule","when",I),!I)return{schema:this};if(!T.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let F=this;this._definition.generate&&(F=this._definition.generate(this,E,T,D));for(const U of O)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...O]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,T,D={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const O=this.clone();return O.$_terms[E]&&!D.override||(O.$_terms[E]=[]),D.single?O.$_terms[E].push(T):O.$_terms[E].push(...T),O.$_temp.ruleset=!1,O}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,T={}){if(!this._singleRules.has(E))return this;const D=T.clone!==!1?this.clone():this;D._singleRules.delete(E);const O=[];for(let L=0;L{const o=a(375),c=a(8571),u=a(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),o(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,d){if(l!==null&&!f.supported.has(typeof l))return;let m=this._map.get(l);if(m)return m.value=d,void this._list.first(m);m=this._list.unshift({key:l,value:d}),this._map.set(l,m),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.value)}_compact(){if(this._map.size>this._max){const l=this._list.pop();this._map.delete(l.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(l){return l.next=null,l.prev=this.head,this.head&&(this.head.next=l),this.head=l,this.tail||(this.tail=l),l}first(l){l!==this.head&&(this._remove(l),this.unshift(l))}pop(){return this._remove(this.tail)}_remove(l){const{next:d,prev:m}=l;return d.prev=m,m&&(m.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,a)=>{const o=a(375),c=a(7916),u=a(5934);let f,l;const d={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=u.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(m,p,h="Options"){o(m&&typeof m=="object"&&!Array.isArray(m),"Options must be of type object");const y=Object.keys(m).filter(g=>!p.includes(g));o(y.length===0,`${h} contain unknown keys: ${y}`)},i.checkPreferences=function(m){l=l||a(3378);const p=l.preferences.validate(m);if(p.error)throw new c([p.error.details[0].message])},i.compare=function(m,p,h){switch(h){case"=":return m===p;case">":return m>p;case"<":return m=":return m>=p;case"<=":return m<=p}},i.default=function(m,p){return m===void 0?p:m},i.isIsoDate=function(m){return d.isoDate.test(m)},i.isNumber=function(m){return typeof m=="number"&&!isNaN(m)},i.isResolvable=function(m){return!!m&&(m[i.symbols.ref]||m[i.symbols.template])},i.isSchema=function(m,p={}){const h=m&&m[i.symbols.any];return!!h&&(o(p.legacy||h.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(m){return m[i.symbols.values]},i.limit=function(m){return Number.isSafeInteger(m)&&m>=0},i.preferences=function(m,p){f=f||a(6914),m=m||{},p=p||{};const h=Object.assign({},m,p);return p.errors&&m.errors&&(h.errors=Object.assign({},m.errors,p.errors),h.errors.wrap=Object.assign({},m.errors.wrap,p.errors.wrap)),p.messages&&(h.messages=f.compile(p.messages,m.messages)),delete h[i.symbols.prefs],h},i.tryWithPath=function(m,p,h={}){try{return m()}catch(y){throw y.path!==void 0?y.path=p+"."+y.path:y.path=p,h.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(m,p,{assert:h,message:y}){if(i.isSchema(h)){const g=h.validate(m);return g.error?g.error.message:void 0}if(!h(m))return p?`${p} ${y}`:y},i.verifyFlat=function(m,p){for(const h of m)o(!Array.isArray(h),"Method no longer accepts array arguments:",p)}},3292:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.schema=function(l,d,m={}){c.assertOptions(m,["appendPath","override"]);try{return f.schema(l,d,m)}catch(p){throw m.appendPath&&p.path!==void 0&&(p.message=`${p.message} (${p.path})`),p}},f.schema=function(l,d,m){o(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(o(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const p=(h,...y)=>m.override!==!1?h.valid(l.override,...y):h.valid(...y);if(f.simple(d))return p(l,d);if(typeof d=="function")return l.custom(d);if(o(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return p(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const h of d)if(!f.simple(h))return l.alternatives().try(...d);return p(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?p(l.date(),d):(o(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,m={}){c.assertOptions(m,["legacy"]);const p=d&&d[c.symbols.any];if(p)return o(m.legacy||p.version===c.version,"Cannot mix different versions of joi schemas:",p.version,c.version),d;if(typeof d!="object"||!m.legacy)return i.schema(l,d,{appendPath:!0});const h=f.walk(d);return h?h.compile(h.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const m of l){const p=f.walk(m);if(p)return p}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};o(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const m in l){const p=f.walk(l[m]);if(p)return p}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,m){if(m===void 0&&(o(d&&typeof d=="object","Missing options"),m=d,d=u.create(".")),Array.isArray(m)&&(m={switch:m}),c.assertOptions(m,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return o(m.is===void 0,'"is" can not be used with a schema condition'),o(m.not===void 0,'"not" can not be used with a schema condition'),o(m.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:m.then,otherwise:m.otherwise,break:m.break});if(o(u.isRef(d)||typeof d=="string","Invalid condition:",d),o(m.not===void 0||m.is===void 0,'Cannot combine "is" with "not"'),m.switch===void 0){let h=m;m.not!==void 0&&(h={is:m.not,then:m.otherwise,otherwise:m.then,break:m.break});let y=h.is!==void 0?l.$_compile(h.is):l.$_root.invalid(null,!1,0,"").required();return o(h.then!==void 0||h.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(h.break===void 0||h.then===void 0||h.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),m.is===void 0||u.isRef(m.is)||c.isSchema(m.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:h.then,otherwise:h.otherwise,break:h.break})}o(Array.isArray(m.switch),'"switch" must be an array'),o(m.is===void 0,'Cannot combine "switch" with "is"'),o(m.not===void 0,'Cannot combine "switch" with "not"'),o(m.then===void 0,'Cannot combine "switch" with "then"');const p={ref:i.ref(d),switch:[],break:m.break};for(let h=0;h{const o=a(5688),c=a(8160),u=a(3328);i.Report=class{constructor(f,l,d,m,p,h,y){if(this.code=f,this.flags=m,this.messages=p,this.path=h.path,this.prefs=y,this.state=h,this.value=l,this.message=null,this.template=null,this.local=d||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const g=this.path[this.path.length-1];typeof g!="object"&&(this.local.key=g)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const l=this._template(this.template,"root");l&&(this.local.label=l)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const l=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return l===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=l.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,l){return i.template(this.value,f,l||this.code,this.state,this.prefs)}},i.path=function(f){let l="";for(const d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,m,p){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let h=p.errors.language;if(c.isResolvable(h)&&(h=h.resolve(f,m,p)),h&&l[h]){if(l[h][d]!==void 0)return l[h][d];if(l[h]["*"]!==void 0)return l[h]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,m){if(!d.errors.label)return"";if(f.label)return f.label;let p=l.path;return d.errors.label==="key"&&l.path.length>1&&(p=l.path.slice(-1)),i.path(p)||i.template(null,d.messages,"root",l,d)||m&&i.template(null,m,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:m,message:p,details:h}=i.details(f);if(m)return m;if(d.errors.stack)return new i.ValidationError(p,h,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(p,h,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const m=[];for(const p of f){if(p instanceof Error){if(l.override!==!1)return{override:p};const y=p.toString();d.push(y),m.push({message:y,type:"override",context:{error:p}});continue}const h=p.toString();d.push(h),m.push({message:h,path:p.path.filter(y=>typeof y!="object"),type:p.code,context:p.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:m}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,this.details=l}static isError(f){return f instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=o.error},8901:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8160),f=a(6914),l={};i.type=function(d,m){const p=Object.getPrototypeOf(d),h=c(p),y=d._assign(Object.create(h)),g=Object.assign({},m);delete g.base,h._definition=g;const v=p._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const w=Object.assign({},v.terms);if(g.terms)for(const R in g.terms){const E=g.terms[R];o(y.$_terms[R]===void 0,"Invalid term override for",g.type,R),y.$_terms[R]=E.init,w[R]=E}g.terms=w,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const x=Object.assign({},v.rules);if(g.rules)for(const R in g.rules){const E=g.rules[R];o(typeof E=="object","Invalid rule definition for",g.type,R);let T=E.method;if(T===void 0&&(T=function(){return this.$_addRule(R)}),T&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=T),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const D=[].concat(E.alias);for(const O of D)h[O]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(D=>(typeof D=="string"&&(D={name:D}),o(!E.argsByName.has(D.name),"Duplicated argument name",D.name),u.isSchema(D.assert)&&(D.assert=D.assert.strict().label(D.name)),E.argsByName.set(D.name,D),D)))}g.rules=x;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const R in g.modifiers){o(!h[R],"Rule conflict in",g.type,R);const E=g.modifiers[R];o(typeof E=="function","Invalid modifier definition for",g.type,R);const T=function(D){return this.rule({[R]:D})};h[R]=T,A[R]=E}if(g.modifiers=A,g.overrides){h._super=p,y.$_super={};for(const R in g.overrides)o(p[R],"Cannot override missing",R),g.overrides[R][u.symbols.parent]=p[R],y.$_super[R]=p[R].bind(y);Object.assign(h,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const k=Object.assign({},v.manifest,g.manifest);return k.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=k,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,m){return d&&m?function(p,h){return m(d(p,h),h)}:d||m},l.coerce=function(d,m){return d&&m?{from:d.from&&m.from?[...new Set([...d.from,...m.from])]:null,method(p,h){let y;if((!m.from||m.from.includes(typeof p))&&(y=m.method(p,h),y)){if(y.errors||y.value===void 0)return y;p=y.value}if(!d.from||d.from.includes(typeof p)){const g=d.method(p,h);if(g)return g}return y}}:d||m},l.prepare=function(d,m){return d&&m?function(p,h){const y=d(p,h);if(y){if(y.errors||y.value===void 0)return y;p=y.value}return m(p,h)||y}:d||m},l.rebuild=function(d,m){return d&&m?function(p){m(p),d(p)}:d||m},l.validate=function(d,m){return d&&m?function(p,h){const y=m(p,h);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;p=y.value}return d(p,h)||y}:d||m}},5107:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8652),f=a(8160),l=a(3292),d=a(6354),m=a(8901),p=a(9708),h=a(6133),y=a(3328),g=a(1152);let v;const w={types:{alternatives:a(4946),any:a(8068),array:a(546),boolean:a(4937),date:a(7500),function:a(390),link:a(8785),number:a(3832),object:a(8966),string:a(7417),symbol:a(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const x={_types:new Set(Object.keys(w.types))};for(const A of x._types)x[A]=function(...k){return o(!k.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],k)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...k){return this.any()[A](...k)};Object.assign(x,w.methods);for(const A in w.aliases){const k=w.aliases[A];x[A]=x[k]}return x.x=x.expression,g.setup&&g.setup(x),x}};w.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(x,A,...k){w.assert(x,A,!0,k)},attempt:(x,A,...k)=>w.assert(x,A,!1,k),build(x){return o(typeof p.build=="function","Manifest functionality disabled"),p.build(this,x)},checkPreferences(x){f.checkPreferences(x)},compile(x,A){return l.compile(this,x,A)},defaults(x){o(typeof x=="function","modifier must be a function");const A=Object.assign({},this);for(const k of A._types){const R=x(A[k]());o(f.isSchema(R),"modifier must return a valid schema object"),A[k]=function(...E){return w.generate(this,R,E)}}return A},expression:(...x)=>new y(...x),extend(...x){f.verifyFlat(x,"extend"),v=v||a(3378),o(x.length,"You need to provide at least one extension"),this.assert(x,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let k of x){typeof k=="function"&&(k=k(A)),this.assert(k,v.extension);const R=w.expandExtension(k,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const T=E.base||this.any(),D=m.type(T,E);A._types.add(E.type),A[E.type]=function(...O){return w.generate(this,D,O)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:h.isRef,isSchema:f.isSchema,in:(...x)=>h.in(...x),override:f.symbols.override,ref:(...x)=>h.create(...x),types(){const x={};for(const A of this._types)x[A]=this[A]();for(const A in w.aliases)x[A]=this[A]();return x}},w.assert=function(x,A,k,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,T=E!==null?R[1]:R[0],D=A.validate(x,f.preferences({errors:{stack:!0}},T||{}));let O=D.error;if(!O)return D.value;if(E instanceof Error)throw E;const L=k&&typeof O.annotate=="function"?O.annotate():O.message;throw O instanceof d.ValidationError==0&&(O=c(O)),O.message=E?`${E} ${L}`:L,O},w.generate=function(x,A,k){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&k.length?A._definition.args(A,...k):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const k=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),k.push(E)}return k},s.exports=w.root()},6914:(s,i,a)=>{const o=a(375),c=a(8571),u=a(3328);i.compile=function(f,l){if(typeof f=="string")return o(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return o(!l,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const m=f[d];if(d==="root"||u.isTemplate(m)){l[d]=m;continue}if(typeof m=="string"){l[d]=new u(m);continue}o(typeof m=="object"&&!Array.isArray(m),"Invalid message for",d);const p=d;for(d in l[p]=l[p]||{},m){const h=m[d];d==="root"||u.isTemplate(h)?l[p][d]=h:(o(typeof h=="string","Invalid message for",d,"in",p),l[p][d]=new u(h))}}return l},i.decompile=function(f){const l={};for(let d in f){const m=f[d];if(d==="root"){l.root=m;continue}if(u.isTemplate(m)){l[d]=m.describe({compact:!0});continue}const p=d;for(d in l[p]={},m){const h=m[d];d!=="root"?l[p][d]=h.describe({compact:!0}):l[p].root=h}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let m in l){const p=l[m];if(m==="root"||u.isTemplate(p)){d[m]=p;continue}if(typeof p=="string"){d[m]=new u(p);continue}o(typeof p=="object"&&!Array.isArray(p),"Invalid message for",m);const h=m;for(m in d[h]=d[h]||{},p){const y=p[m];m==="root"||u.isTemplate(y)?d[h][m]=y:(o(typeof y=="string","Invalid message for",m,"in",h),d[h][m]=new u(y))}}return d}},2294:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[d,m]of l._byId.entries())o(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,m);for(const[d,m]of l._byKey.entries())o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,m)}fork(l,d,m){const p=this._collect(l);p.push({schema:m});const h=p.shift();let y={id:h.id,schema:d(h.schema)};o(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of p)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const m=l[0],p=this._get(m);if(!p)return[...d,...l].join(".");const h=l.slice(1);return d=[...d,p.schema._flags.label||m],h.length?p.schema._ids.labels(h,d):d.join(".")}reach(l,d=[]){const m=l[0],p=this._get(m);o(p,"Schema does not contain path",[...d,...l].join("."));const h=l.slice(1);return h.length?p.schema._ids.reach(h,[...d,m]):p.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const m=l._flags.id;if(m){const p=this._byId.get(m);o(!p||p.schema===l,"Cannot add different schemas with the same id:",m),o(!this._byKey.has(m),"Schema id conflicts with existing key:",m),this._byId.set(m,{schema:l,id:m})}d&&(o(!this._byKey.has(d),"Schema already contains key:",d),o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],m=[]){const p=l[0],h=this._get(p);o(h,"Schema does not contain path",[...d,...l].join(".")),m=[h,...m];const y=l.slice(1);return y.length?h.schema._ids._collect(y,[...d,p],m):m}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,m){const p=i.schema(l,{each:(h,{key:y})=>{if(d===(h._flags.id||y))return m},ref:!1});return p?p.$_mutateRebuild():l},i.schema=function(l,d){let m;for(const p in l._flags){if(p[0]==="_")continue;const h=f.scan(l._flags[p],{source:"flags",name:p},d);h!==void 0&&(m=m||l.clone(),m._flags[p]=h)}for(let p=0;p{const o=a(375),c=a(8571),u=a(9621),f=a(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(m,p={}){o(typeof m=="string","Invalid reference key:",m),f.assertOptions(p,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!p.prefix||typeof p.prefix=="object","options.prefix must be of type object");const h=Object.assign({},d.defaults,p);delete h.prefix;const y=h.separator,g=d.context(m,y,p.prefix);if(h.type=g.type,m=g.key,h.type==="value")if(g.root&&(o(!y||m[0]!==y,"Cannot specify relative path with root prefix"),h.ancestor="root",m||(m=null)),y&&y===m)m=null,h.ancestor=0;else if(h.ancestor!==void 0)o(!y||!m||m[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,w]=d.ancestor(m,y);w&&(m=m.slice(w))===""&&(m=null),h.ancestor=v}return h.path=y?m===null?[]:m.split(y):[m],new d.Ref(h)},i.in=function(m,p={}){return i.create(m,{...p,in:!0})},i.isRef=function(m){return!!m&&!!m[f.symbols.ref]},d.Ref=class{constructor(m){o(typeof m=="object","Invalid reference construction"),f.assertOptions(m,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(m.separator)||typeof m.separator=="string"&&m.separator.length===1,"Invalid separator"),o(!m.adjust||typeof m.adjust=="function","options.adjust must be a function"),o(!m.map||Array.isArray(m.map),"options.map must be an array"),o(!m.map||!m.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,m),o(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(m,p,h,y,g={}){return o(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(h.context,p,g):this.type==="local"?this._resolve(y,p,g):this.ancestor?this.ancestor==="root"?this._resolve(p.ancestors[p.ancestors.length-1],p,g):(o(this.ancestor<=p.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(p.ancestors[this.ancestor-1],p,g)):this._resolve(m,p,g)}_resolve(m,p,h){let y;if(this.type==="value"&&p.mainstay.shadow&&h.shadow!==!1&&(y=p.mainstay.shadow.get(this.absolute(p))),y===void 0&&(y=u(m,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return p.mainstay&&p.mainstay.tracer.resolve(p,this,y),y}toString(){return this.display}absolute(m){return[...m.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const m={path:this.path};this.type!=="value"&&(m.type=this.type),this.separator!=="."&&(m.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(m.ancestor=this.ancestor),this.map&&(m.map=[...this.map]);for(const p of["adjust","iterables","render"])this[p]!==null&&this[p]!==void 0&&(m[p]=this[p]);return this.in!==!1&&(m.in=!0),{ref:m}}updateDisplay(){const m=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${m}`);if(!this.separator)return void(this.display=`ref:${m}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${m}`);if(this.ancestor==="root")return void(this.display=`ref:root:${m}`);if(this.ancestor===1)return void(this.display=`ref:${m||".."}`);const p=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${p}${m||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(m){return(m=Object.assign({},d.defaults,m)).type==="value"&&m.ancestor===void 0&&(m.ancestor=1),new d.Ref(m)},d.context=function(m,p,h={}){if(m=m.trim(),h){const y=h.global===void 0?"$":h.global;if(y!==p&&m.startsWith(y))return{key:m.slice(y.length),type:"global"};const g=h.local===void 0?"#":h.local;if(g!==p&&m.startsWith(g))return{key:m.slice(g.length),type:"local"};const v=h.root===void 0?"/":h.root;if(v!==p&&m.startsWith(v))return{key:m.slice(v.length),type:"value",root:!0}}return{key:m,type:"value"}},d.ancestor=function(m,p){if(!p)return[1,0];if(m[0]!==p)return[1,0];if(m[1]!==p)return[0,1];let h=2;for(;m[h]===p;)++h;return[h-1,h]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(m,p){if(m)if(p=p===void 0?i.toParent:p,Array.isArray(m))for(const h of m)this.register(h,p);else if(f.isSchema(m))for(const h of m._refs.refs)h.ancestor-p>=0&&this.refs.push({ancestor:h.ancestor-p,root:h.root});else i.isRef(m)&&m.type==="value"&&m.ancestor-p>=0&&this.refs.push({ancestor:m.ancestor-p,root:m.root}),l=l||a(3328),l.isTemplate(m)&&this.register(m.refs(),p)}get length(){return this.refs.length}clone(){const m=new i.Manager;return m.refs=c(this.refs),m}reset(){this.refs=[]}roots(){return this.refs.filter(m=>!m.ancestor).map(m=>m.root)}}},3378:(s,i,a)=>{const o=a(5107),c={};c.wrap=o.string().min(1).max(2).allow(!1),i.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=o.object({alias:o.array().items(o.string().pattern(c.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(c.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),i.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(c.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(c.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(c.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(c.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(c.nameRx,c.rule),terms:o.object().pattern(c.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),i.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),c.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},c.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,o.link("/")]),c.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=o.object().pattern(/.+/,[o.string(),c.desc.template,o.object().pattern(/.+/,[o.string(),c.desc.template])]),i.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:c.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:o.boolean(),messages:c.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),c.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(s,i,a)=>{const o=a(8571),c=a(9621),u=a(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,m){this.path=l,this.ancestors=d,this.mainstay=m.mainstay,this.schemas=m.schemas,this.debug=null}localize(l,d=null,m=null){const p=new f.State(l,d,this);return m&&p.schemas&&(p.schemas=[f.schemas(m),...p.schemas]),p}nest(l,d){const m=new f.State(this.path,this.ancestors,this);return m.schemas=m.schemas&&[f.schemas(l),...m.schemas],m.debug=d,m}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,m){if(!l.length||m==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let p=this._values;for(let h=0;h{const o=a(375),c=a(8571),u=a(5277),f=a(1447),l=a(8160),d=a(6354),m=a(6133),p={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=p.Template=class{constructor(h,y){if(o(typeof h=="string","Template source must be a string"),o(!h.includes("\0")&&!h.includes(""),"Template source cannot contain reserved control characters"),this.source=h,this.rendered=h,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(o(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const h=p.encode(this.source),y=p.split(h);let g=!1;const v=[],w=y.shift();w&&v.push(w);for(const x of y){const A=x[0]!=="{",k=A?"}":"}}",R=x.indexOf(k);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const T=E[0]===":";T&&(E=E.slice(1));const D=this._ref(p.decode(E),{raw:A,wrapped:T});v.push(D),typeof D!="string"&&(g=!0);const O=x.slice(R+k.length);O&&v.push(p.decode(O))}g?this._template=v:this.rendered=v.join("")}static date(h,y){return p.dateFormat[y.dateFormat].call(h)}describe(h={}){if(!this._settings&&h.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(h){return new p.Template(h.template,h.options||h.functions?{...h.options,functions:h.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(h){return!!h&&!!h[l.symbols.template]}refs(){if(!this._template)return;const h=[];for(const y of this._template)typeof y!="string"&&h.push(...y.refs);return h}resolve(h,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],h,y,g,v,{}):this.render(h,y,g,v)}_part(h,...y){return h.ref?h.ref.resolve(...y):h.formula.evaluate(y)}render(h,y,g,v,w={}){if(!this.isDynamic())return this.rendered;const x=[];for(const A of this._template)if(typeof A=="string")x.push(A);else{const k=this._part(A,h,y,g,v,w),R=p.stringify(k,h,y,g,v,w);if(R!==void 0){const E=A.raw||(w.errors&&w.errors.escapeHtml)===!1?R:u(R);x.push(p.wrap(E,A.wrapped&&g.errors.wrap.label))}}return x.join("")}_ref(h,{raw:y,wrapped:g}){const v=[],w=A=>{const k=m.create(A,this._settings);return v.push(k),R=>{const E=k.resolve(...R);return E!==void 0?E:null}};try{const A=this._functions?{...p.functions,...this._functions}:p.functions;var x=new f.Parser(h,{reference:w,functions:A,constants:p.constants})}catch(A){throw A.message=`Invalid template variable "${h}" fails due to: ${A.message}`,A}if(x.single){if(x.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return p.stringify(x.single.value)}return{formula:x,raw:y,refs:v}}toString(){return this.source}},p.Template.prototype[l.symbols.template]=!0,p.Template.prototype.isImmutable=!0,p.encode=function(h){return h.replace(/\\(\{+)/g,(y,g)=>p.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>p.closes.slice(0,g.length))},p.decode=function(h){return h.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},p.split=function(h){const y=[];let g="";for(let v=0;v ${O.toString()}`);h=T}if(!Array.isArray(h))return h.toString();const E=[];for(const T of h)E.push(p.stringify(T,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&k.array)},p.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},p.functions={if:(h,y,g)=>h?y:g,length:h=>typeof h=="string"?h.length:h&&typeof h=="object"?Array.isArray(h)?h.length:Object.keys(h).length:null,msg(h){const[y,g,v,w,x]=this,A=x.messages;if(!A)return"";const k=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return k?k.render(y,g,v,w,x):""},number:h=>typeof h=="number"?h:typeof h=="string"?parseFloat(h):typeof h=="boolean"?h?1:0:h instanceof Date?h.getTime():null}},4946:(s,i,a)=>{const o=a(375),c=a(1687),u=a(8068),f=a(8160),l=a(3292),d=a(6354),m=a(6133),p={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:m.toSibling}},args:(h,...y)=>y.length===1&&Array.isArray(y[0])?h.try(...y[0]):h.try(...y),validate(h,y){const{schema:g,error:v,state:w,prefs:x}=y;if(g._flags.match){const k=[],R=[];for(let T=0;Td.details(T,{override:!1}))})};if(g._flags.match==="one")return k.length===1?{value:k[0]}:{errors:v("alternatives.one")};if(k.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(T=>d.details(T,{override:!1}))})};const E=T=>T.$_terms.matches.some(D=>D.schema.type==="object"||D.schema.type==="alternatives"&&E(D.schema));return E(g)?{value:k.reduce((T,D)=>c(T,D,{mergeArrays:!1}))}:{value:k[k.length-1]}}const A=[];for(let k=0;kg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(h):void 0,ref:!1})}},rebuild(h){h.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&h.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(h,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:w,is:x,not:A,then:k,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:k,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:k,otherwise:R})}return h}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),p.errors=function(h,{error:y,state:g}){if(!h.length)return{errors:y("alternatives.any")};if(h.length===1)return{errors:h[0].reports};const v=new Set,w=[];for(const{reports:x,schema:A}of h){if(x.length>1)return p.unmatched(h,y);const k=x[0];if(k instanceof d.Report==0)return p.unmatched(h,y);if(k.state.path.length!==g.path.length){w.push({type:A.type,report:k});continue}if(k.code==="any.only"){for(const T of k.local.valids)v.add(T);continue}const[R,E]=k.code.split(".");E!=="base"?w.push({type:A.type,report:k}):k.code==="object.base"?v.add(k.local.type):v.add(R)}return w.length?w.length===1?{errors:w[0].report}:p.unmatched(h,y):{errors:y("alternatives.types",{types:[...v]})}},p.unmatched=function(h,y){const g=[];for(const v of h)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,a)=>{const o=a(375),c=a(7629),u=a(8160),f=a(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,d){return o(typeof l=="function","Method must be a function"),o(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:m}){try{return m(l,d)}catch(p){return d.error("any.custom",{error:p})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){o(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return o(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:m,local:p})=>d.error(m,p),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const m in d){const p=d[m];if(["examples","externals","metas","notes","tags"].includes(m))for(const h of p)l=l[m.slice(0,-1)](h);else if(m!=="alterations")if(m!=="whens"){if(m==="shared")for(const h of p)l=l.shared(h)}else for(const h of p){const{ref:y,is:g,not:v,then:w,otherwise:x,concat:A}=h;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:w,otherwise:x,switch:h.switch,break:h.break}):l.when(g,{then:w,otherwise:x,break:h.break})}else{const h={};for(const{target:y,adjuster:g}of p)h[y]=g;l=l.alter(h)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,a)=>{const o=a(375),c=a(9474),u=a(9621),f=a(8068),l=a(8160),d=a(3292),m={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(p,{schema:h,state:y,prefs:g}){if(!Array.isArray(p))return;const v=h.$_getRule("sort");return v?m.sort(h,p,v.args.options,y,g):void 0}},validate(p,{schema:h,error:y}){if(!Array.isArray(p)){if(h._flags.single){const g=[p];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(h.$_getRule("items")||h.$_terms.externals)return{value:p.slice()}},rules:{has:{method(p){p=this.$_compile(p,{appendPath:!0});const h=this.$_addRule({name:"has",args:{schema:p}});return h.$_mutateRegister(p),h},validate(p,{state:h,prefs:y,error:g},{schema:v}){const w=[p,...h.ancestors];for(let A=0;Athis.$_compile(p[y]),y,{append:!0});h.$_terms.items.push(g)}return h.$_mutateRebuild()},validate(p,{schema:h,error:y,state:g,prefs:v,errorsArray:w}){const x=h.$_terms._requireds.slice(),A=h.$_terms.ordered.slice(),k=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let T=p.length;for(let D=0;D="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;ythis.$_compile(p[y]),y,{append:!0});m.validateSingle(g,h),h.$_mutateRegister(g),h.$_terms.ordered.push(g)}return h.$_mutateRebuild()}},single:{method(p){const h=p===void 0||!!p;return o(!h||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",h)}},sort:{method(p={}){l.assertOptions(p,["by","order"]);const h={order:p.order||"ascending"};return p.by&&(h.by=d.ref(p.by,{ancestor:0}),o(!h.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:h}})},validate(p,{error:h,state:y,prefs:g,schema:v},{options:w}){const{value:x,errors:A}=m.sort(v,p,w,y,g);if(A)return A;for(let k=0;knew Set(p)}},rebuild(p){p.$_terms._inclusions=[],p.$_terms._exclusions=[],p.$_terms._requireds=[];for(const h of p.$_terms.items)m.validateSingle(h,p),h._flags.presence==="required"?p.$_terms._requireds.push(h):h._flags.presence==="forbidden"?p.$_terms._exclusions.push(h):p.$_terms._inclusions.push(h);for(const h of p.$_terms.ordered)m.validateSingle(h,p)},manifest:{build:(p,h)=>(h.items&&(p=p.items(...h.items)),h.ordered&&(p=p.ordered(...h.ordered)),p)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),m.fillMissedErrors=function(p,h,y,g,v,w){const x=[];let A=0;for(const k of y){const R=k._flags.label;R?x.push(R):++A}x.length?A?h.push(p.$_createError("array.includesRequiredBoth",g,{knownMisses:x,unknownMisses:A},v,w)):h.push(p.$_createError("array.includesRequiredKnowns",g,{knownMisses:x},v,w)):h.push(p.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,w))},m.fillOrderedErrors=function(p,h,y,g,v,w){const x=[];for(const A of y)A._flags.presence==="required"&&x.push(A);x.length&&m.fillMissedErrors(p,h,x,g,v,w)},m.fillDefault=function(p,h,y,g){const v=[];let w=!0;for(let x=p.length-1;x>=0;--x){const A=p[x],k=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,k,A),g).value;if(w){if(R===void 0)continue;w=!1}v.unshift(R)}v.length&&h.push(...v)},m.fastSplice=function(p,h){let y=h;for(;y{let T=m.compare(R,E,x,A);if(T!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),T=m.compare(R,E,x,A),T!==null))return T;const D=typeof R;if(D!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(D!=="number"&&D!=="string")throw p.$_createError("array.sort.unsupported",h,{type:D},g,v);return D==="number"?(R-E)*w:R{const o=a(375),c=a(8068),u=a(8160),f=a(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:m}){if(typeof d!="boolean"){if(typeof d=="string"){const p=m._flags.sensitive?d:d.toLowerCase();d=p==="true"||p!=="false"&&d}return typeof d!="boolean"&&(d=m.$_terms.truthy&&m.$_terms.truthy.has(d,null,null,!m._flags.sensitive)||(!m.$_terms.falsy||!m.$_terms.falsy.has(d,null,null,!m._flags.sensitive))&&d),{value:d}}},validate(d,{error:m}){if(typeof d!="boolean")return{value:d,errors:m("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const m=this.clone();m.$_terms.truthy=m.$_terms.truthy||new f;for(let p=0;pd?1:0},string:{from:l.isBool,to:(d,m)=>d?"true":"false"}},manifest:{build:(d,m)=>(m.truthy&&(d=d.truthy(...m.truthy)),m.falsy&&(d=d.falsy(...m.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f=a(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:m})=>({value:l.parse(d,m._flags.format)||d})},validate(d,{schema:m,error:p,prefs:h}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=m._flags.format;return h.convert&&y&&typeof d=="string"?{value:d,errors:p("date.format",{format:y})}:{value:d,errors:p("date.base")}},rules:{compare:{method:!1,validate(d,m,{date:p},{name:h,operator:y,args:g}){const v=p==="now"?Date.now():p.getTime();return u.compare(d.getTime(),v,y)?d:m.error("date."+h,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return o(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return o(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,m)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:m})=>f.date(d,m)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(d,m){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(m==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const p=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),m){if(m==="javascript")return l.date(1*d);if(m==="unix")return l.date(1e3*d);if(typeof p=="string")return null}return l.date(d)},l.date=function(d){const m=new Date(d);return isNaN(m.getTime())?null:m}},390:(s,i,a)=>{const o=a(375),c=a(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return o(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u:f.error("function.maxArity",{n:l})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,a)=>{const o=a(978),c=a(375),u=a(8571),f=a(3652),l=a(8068),d=a(8160),m=a(3292),p=a(6354),h=a(6133),y=a(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,w)=>v.keys(w),validate(v,{schema:w,error:x,state:A,prefs:k}){if(!v||typeof v!==w.$_property("typeof")||Array.isArray(v))return{value:v,errors:x("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;v=g.clone(v,k);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,k,R))return{value:v,errors:R};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:v,errors:R};const E=new Set(Object.keys(v));if(w.$_terms.keys){const T=[v,...A.ancestors];for(const D of w.$_terms.keys){const O=D.key,L=v[O];E.delete(O);const I=A.localize([...A.path,O],T,D),F=D.schema.$_validate(L,I,k);if(F.errors){if(k.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[O]=F.value),R.push(...F.errors)}else D.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[O]:F.value!==void 0&&(v[O]=F.value)}}if(E.size||w._flags._hasPatternMatch){const T=g.unknown(w,v,E,R,A,k);if(T)return T}if(w.$_terms.dependencies)for(const T of w.$_terms.dependencies){if(T.key!==null&&g.isPresent(T.options)(T.key.resolve(v,A,k,null,{shadow:!1}))===!1)continue;const D=g.dependencies[T.rel](w,T,v,A,k);if(D){const O=w.$_createError(D.code,v,D.context,A,k);if(k.abortEarly)return{value:v,errors:O};R.push(O)}}return{value:v,errors:R}},rules:{and:{method(...v){return d.verifyFlat(v,"and"),g.dependency(this,"and",null,v)}},append:{method(v){return v==null||Object.keys(v).length===0?this:this.keys(v)}},assert:{method(v,w,x){y.isTemplate(v)||(v=m.ref(v)),c(x===void 0||typeof x=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:w,message:x}});return A.$_mutateRegister(v),A.$_mutateRegister(w),A},validate(v,{error:w,prefs:x,state:A},{subject:k,schema:R,message:E}){const T=k.resolve(v,A,x),D=h.isRef(k)?k.absolute(A):[];return R.$_match(T,A.localize(D,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:k,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,w){return c(typeof v=="function","constructor must be a function"),w=w||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:w}})},validate:(v,w,{constructor:x,name:A})=>v instanceof x?v:w.error("object.instance",{type:A,value:v}),args:["constructor","name"]},keys:{method(v){c(v===void 0||typeof v=="object","Object schema must be a valid object"),c(!d.isSchema(v),"Object schema cannot be a joi schema");const w=this.clone();if(v)if(Object.keys(v).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(x=>!v.hasOwnProperty(x.key)):new g.Keys;for(const x in v)d.tryWithPath(()=>w.$_terms.keys.push({key:x,schema:this.$_compile(v[x])}),x)}else w.$_terms.keys=new g.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,w,{limit:x},{name:A,operator:k,args:R})=>d.compare(Object.keys(v).length,x,k)?v:w.error("object."+A,{limit:R.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},nand:{method(...v){return d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,w,x={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(w!==void 0,"Invalid rule"),d.assertOptions(x,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const k=this.clone();k.$_terms.patterns=k.$_terms.patterns||[];const R={[A?"regex":"schema"]:v,rule:w};return x.matches&&(R.matches=this.$_compile(x.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),k.$_mutateRegister(R.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),k.$_terms.patterns.push(R),k.$_mutateRegister(w),k}},ref:{method(){return this.$_addRule("ref")},validate:(v,w)=>h.isRef(v)?v:w.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,w)=>v instanceof RegExp?v:w.error("object.regex",{value:v})},rename:{method(v,w,x={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof y,"Invalid rename to argument"),c(w!==v,"Cannot rename key to same name:",v),d.assertOptions(x,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const k of A.$_terms.renames)c(k.from!==v,"Cannot rename the same key multiple times");return w instanceof y&&A.$_mutateRegister(w),A.$_terms.renames.push({from:v,to:w,options:o(g.renameDefaults,x)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,w,{type:x})=>!d.isSchema(v)||x!=="any"&&v.type!==x?w.error("object.schema",{type:x}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,w,x={}){return g.dependency(this,"with",v,w,x)}},without:{method(v,w,x={}){return g.dependency(this,"without",v,w,x)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,w){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,w)}},rebuild(v){if(v.$_terms.keys){const w=new f.Sorter;for(const x of v.$_terms.keys)d.tryWithPath(()=>w.add(x,{after:x.schema.$_rootReferences(),group:x.key}),x.key);v.$_terms.keys=new g.Keys(...w.nodes)}},manifest:{build(v,w){if(w.keys&&(v=v.keys(w.keys)),w.dependencies)for(const{rel:x,key:A=null,peers:k,options:R}of w.dependencies)v=g.dependency(v,x,A,k,R);if(w.patterns)for(const{regex:x,schema:A,rule:k,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,k,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:k}of w.renames)v=v.rename(x,A,k);return v}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),g.clone=function(v,w){if(typeof v=="object"){if(w.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const x=function(...A){return v.apply(this,A)};return x.prototype=u(v.prototype),Object.defineProperty(x,"name",{value:v.name,writable:!1}),Object.defineProperty(x,"length",{value:v.length,writable:!1}),Object.assign(x,v),x},g.dependency=function(v,w,x,A,k){c(x===null||typeof x=="string",w,"key must be a strings"),k||(k=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(k,["separator","isPresent"]),A=[].concat(A);const R=d.default(k.separator,"."),E=[];for(const D of A)c(typeof D=="string",w,"peers must be strings"),E.push(m.ref(D,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const T=v.clone();return T.$_terms.dependencies=T.$_terms.dependencies||[],T.$_terms.dependencies.push(new g.Dependency(w,x,E,A,k)),T},g.dependencies={and(v,w,x,A,k){const R=[],E=[],T=w.peers.length,D=g.isPresent(w.options);for(const O of w.peers)D(O.resolve(x,A,k,null,{shadow:!1}))===!1?R.push(O.key):E.push(O.key);if(R.length!==T&&E.length!==T)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const O of w.peers)E(O.resolve(x,A,k,null,{shadow:!1}))&&R.push(O.key);if(R.length!==w.peers.length)return;const T=w.paths[0],D=w.paths.slice(1);return{code:"object.nand",context:{main:T,mainWithLabel:g.keysToLabels(v,T),peers:D,peersWithLabels:g.keysToLabels(v,D)}}},or(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(!R.length||R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:T}},with(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:T}:(T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:T})}},g.keysToLabels=function(v,w){return Array.isArray(w)?w.map(x=>v.$_mapLabels(x)):v.$_mapLabels(w)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:w=>w!==void 0},g.rename=function(v,w,x,A,k){const R={};for(const E of v.$_terms.renames){const T=[],D=typeof E.from!="string";if(D)for(const O in w){if(w[O]===void 0&&E.options.ignoreUndefined||O===E.to)continue;const L=E.from.exec(O);L&&T.push({from:O,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||T.push(E);for(const O of T){const L=O.from;let I=O.to;if(I instanceof y&&(I=I.render(w,x,A,O.match)),L!==I){if(!E.options.multiple&&R[I]&&(k.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(k.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly))return!1;w[L]===void 0?delete w[I]:w[I]=w[L],R[I]=!0,E.options.alias||delete w[L]}}}return!0},g.unknown=function(v,w,x,A,k,R){if(v.$_terms.patterns){let E=!1;const T=v.$_terms.patterns.map(O=>{if(O.matches)return E=!0,[]}),D=[w,...k.ancestors];for(const O of x){const L=w[O],I=[...k.path,O];for(let F=0;F{const o=a(375),c=a(8068),u=a(8160),f=a(3292),l=a(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(m,p)=>m.ref(p),validate(m,{schema:p,state:h,prefs:y}){o(p.$_terms.link,"Uninitialized link schema");const g=d.generate(p,m,h,y),v=p.$_terms.link[0].ref;return g.$_validate(m,h.nest(g,`link:${v.display}:${g.type}`),y)},generate:(m,p,h,y)=>d.generate(m,p,h,y),rules:{ref:{method(m){o(!this.$_terms.link,"Cannot reinitialize schema"),m=f.ref(m),o(m.type==="value"||m.type==="local","Invalid reference type:",m.type),o(m.type==="local"||m.ancestor==="root"||m.ancestor>0,"Link cannot reference itself");const p=this.clone();return p.$_terms.link=[{ref:m}],p}},relative:{method(m=!0){return this.$_setFlag("relative",m)}}},overrides:{concat(m){o(this.$_terms.link,"Uninitialized link schema"),o(u.isSchema(m),"Invalid schema object"),o(m.type!=="link","Cannot merge type link with another link");const p=this.clone();return p.$_terms.whens||(p.$_terms.whens=[]),p.$_terms.whens.push({concat:m}),p.$_mutateRebuild()}},manifest:{build:(m,p)=>(o(p.link,"Invalid link description missing link"),m.ref(p.link))}}),d.generate=function(m,p,h,y){let g=h.mainstay.links.get(m);if(g)return g._generate(p,h,y).schema;const v=m.$_terms.link[0].ref,{perspective:w,path:x}=d.perspective(v,h);d.assert(w,"which is outside of schema boundaries",v,m,h,y);try{g=x.length?w.$_reach(x):w}catch{d.assert(!1,"to non-existing schema",v,m,h,y)}return d.assert(g.type!=="link","which is another link",v,m,h,y),m._flags.relative||h.mainstay.links.set(m,g),g._generate(p,h,y).schema},d.perspective=function(m,p){if(m.type==="local"){for(const{schema:h,key:y}of p.schemas){if((h._flags.id||y)===m.path[0])return{perspective:h,path:m.path.slice(1)};if(h.$_terms.shared){for(const g of h.$_terms.shared)if(g._flags.id===m.path[0])return{perspective:g,path:m.path.slice(1)}}}return{perspective:null,path:null}}return m.ancestor==="root"?{perspective:p.schemas[p.schemas.length-1].schema,path:m.path}:{perspective:p.schemas[m.ancestor]&&p.schemas[m.ancestor].schema,path:m.path}},d.assert=function(m,p,h,y,g,v){m||o(!1,`"${l.label(y._flags,g,v)}" contains link reference "${h.display}" ${p}`)}},3832:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const d=l.toString(),m=d.indexOf("."),p=d.indexOf("e");return(m<0?0:(p<0?d.length:p)-m-1)+(p<0?0:Math.max(0,-parseInt(d.slice(p+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:m}){if(!l.match(f.numberRx))return;l=l.trim();const p={value:parseFloat(l)};if(p.value===0&&(p.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(p.value)))return p.errors=m("number.unsafe"),p}else{const h=p.value.toString();if(h.match(/e/i))return p;if(h!==f.normalizeDecimal(l))return p.errors=m("number.unsafe"),p}return p}},validate(l,{schema:d,error:m,prefs:p}){if(l===1/0||l===-1/0)return{value:l,errors:m("number.infinity")};if(!u.isNumber(l))return{value:l,errors:m("number.base")};const h={value:l};if(p.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);h.value=Math.round(h.value*g)/g}}return h.value===0&&(h.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,m,h)?l:d.error("number."+p,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.isNumber,message:"must be a number"}]},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{limit:l},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(l,d)=>Math.trunc(l)-l==0?l:d.error("number.integer")},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{limit:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{limit:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{limit:l},operator:">="})}},multiple:{method(l){const d=typeof l=="number"?f.decimalPlaces(l):null,m=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:m}})},validate:(l,d,{base:m,baseDecimalPlace:p,pfactor:h},y)=>f.decimalPlaces(l)>p?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(h*l)%Math.round(h*m)==0?l:d.error("number.multiple",{multiple:y.args.base,value:l}),args:[{name:"base",ref:!0,assert:l=>typeof l=="number"&&isFinite(l)&&l>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(l,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return o(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:m}){const p=l.toString().match(f.precisionRx);return Math.max((p[1]?p[1].length:0)-(p[2]?parseInt(p[2],10):0),0)<=m?l:d.error("number.precision",{limit:m,value:l})},convert:!0},sign:{method(l){return o(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:m})=>m==="negative"&&l<0||m==="positive"&&l>0?l:d.error(`number.${m}`)},unsafe:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>l.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(l){return l.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(l){return(l=l.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&l.endsWith("0")&&(l=l.replace(/0+$/,"")),l==="-0"?"0":l}},8966:(s,i,a)=>{const o=a(7824);s.exports=o.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,a)=>{const o=a(375),c=a(5380),u=a(1745),f=a(9959),l=a(6064),d=a(9926),m=a(5752),p=a(8068),h=a(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:w,prefs:x}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const k=v.$_getRule("case");k&&(g=k.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const R=v.$_getRule("trim");if(R&&R.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const T of v.$_terms.replacements)g=g.replace(T.pattern,T.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const T=y.isoDate(g);T&&(g=T)}if(v._flags.truncate){const T=v.$_getRule("max");if(T){let D=T.args.limit;if(h.isResolvable(D)&&(D=D.resolve(g,w,x),!h.limit(D)))return{value:g,errors:v.$_createError("any.ref",D,{ref:T.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,D)}}return{value:g}}},validate(g,{schema:v,error:w}){if(typeof g!="string")return{value:g,errors:w("string.base")};if(g===""){const x=v.$_getRule("min");return x&&x.args.limit===0?void 0:{value:g,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return h.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:w})=>y.base64Regex[w.paddingRequired][w.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return o(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:w})=>w==="lower"&&g===g.toLocaleLowerCase()||w==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let w=g.length,x=0,A=1;for(;w--;){const k=g.charAt(w)*A;x+=k-9*(k>9),A^=3}return x>0&&x%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return h.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:w}){const x=g.match(y.dataUriRegex);return x&&(!x[2]||x[2]!=="base64"||y.base64Regex[w.paddingRequired].false.test(x[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&h.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,w,{address:x})=>c.isValid(g,x)?g:v.error("string.domain")},email:{method(g={}){h.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),w=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:w,address:v})},validate(g,v,{options:w},{regex:x,address:A}){const k=w.multiple?g.split(x):[g],R=[];for(const E of k)u.isValid(E,A)||R.push(E);return R.length?v.error("string.email",{value:g,invalids:R}):g}},guid:{alias:"uuid",method(g={}){h.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);o(A.length>=1,"version must have at least 1 valid version specified");const k=new Set;for(let R=0;R(w.prefix==="optional"?y.hexRegex.withOptionalPrefix:w.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?w.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){h.assertOptions(g,["cidr","version"]);const{cidr:v,versions:w,regex:x}=f.regex(g),A=g.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:x})},validate:(g,v,{options:w},{regex:x})=>x.test(g)?g:w.version?v.error("string.ipVersion",{value:g,cidr:w.cidr,version:w.version}):v.error("string.ip",{value:g,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(g,{error:v})=>y.isoDate(g)?g:v("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(g,v)=>y.isoDurationRegex.test(g)?g:v.error("string.isoDuration")},length:{method(g,v){return y.length(this,"length",g,"=",v)},validate(g,v,{limit:w,encoding:x},{name:A,operator:k,args:R}){const E=!x&&g.length;return h.compare(E,w,k)?g:v.error("string."+A,{limit:R.limit,value:g,encoding:x})},args:[{name:"limit",ref:!0,assert:h.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return o(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:w})=>g===g.normalize(w)?g:v("string.normalize",{value:g,form:w}),convert:!0},pattern:{alias:"regex",method(g,v={}){o(g instanceof RegExp,"regex must be a RegExp"),o(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),h.assertOptions(v,["invert","name"]);const w=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:w})},validate:(g,v,{regex:w,options:x},{errorCode:A})=>w.test(g)^x.invert?g:v.error(A,{name:x.name,regex:w,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),o(g instanceof RegExp,"pattern must be a RegExp"),o(typeof v=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:g,replacement:v}),w}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:w})=>w&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){h.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&h.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:w}=m.regex(g),x=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:x,scheme:w})},validate(g,v,{options:w},{regex:x,domain:A,scheme:k}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let R=x.exec(g);if(!R&&v.prefs.convert&&w.encodeUri){const E=encodeURI(g);R=x.exec(E),R&&(g=E)}if(R){const E=R[1]||R[2];return!A||w.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return w.relativeOnly?v.error("string.uriRelativeOnly"):w.scheme?v.error("string.uriCustomScheme",{scheme:k,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:w,replacement:x}of v.replacements)g=g.replace(w,x);return g}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),y.addressOptions=function(g){if(!g)return y.tlds||g;if(o(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);o(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),o(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const w=g.tlds.allow;return w?w===!0?(o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(w)&&(g=Object.assign({},g,{tlds:{allow:new Set(w)}})),o(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const w of g)o(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!h.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,w,x,A){return o(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:w,encoding:A},operator:x})}},8826:(s,i,a)=>{const o=a(375),c=a(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const m=l.$_terms.map.get(f);return m&&(f=m),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("symbol.map",{map:l.$_terms.map})}:{value:f}}},validate(f,{error:l}){if(typeof f!="symbol")return{value:f,errors:l("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const m of f){o(m&&m[Symbol.iterator],"Entry must be an iterable");const[p,h]=m;o(typeof p!="object"&&typeof p!="function"&&typeof p!="symbol","Key must not be of type object, function, or Symbol"),o(typeof h=="symbol","Value must be a Symbol"),l.$_terms.map.set(p,h),d.push(h)}return l.valid(...d)}}},manifest:{build:(f,l)=>(l.map&&(f=f.map(l.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,a)=>{const o=a(375),c=a(8571),u=a(738),f=a(9621),l=a(8160),d=a(6354),m=a(493),p={result:Symbol("result")};i.entry=function(h,y,g){let v=l.defaults;g&&(o(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const w=p.entry(h,y,v);o(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const x={value:w.value};return w.error&&(x.error=w.error),w.mainstay.warnings.length&&(x.warning=d.details(w.mainstay.warnings)),w.mainstay.debug&&(x.debug=w.mainstay.debug),w.mainstay.artifacts&&(x.artifacts=w.mainstay.artifacts),x},i.entryAsync=async function(h,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const w=p.entry(h,y,v),x=w.mainstay;if(w.error)throw x.debug&&(w.error.debug=x.debug),w.error;if(x.externals.length){let k=w.value;const R=[];for(const E of x.externals){const T=E.state.path,D=E.schema.type==="link"?x.links.get(E.schema):null;let O,L,I=k;const F=T.length?[k]:[],U=T.length?f(h,T):h;if(T.length){O=T[T.length-1];let Y=k;for(const V of T.slice(0,-1))Y=Y[V],F.unshift(Y);L=F[0],I=L[O]}try{const Y=(H,ee)=>(D||E.schema).$_createError(H,I,ee,E.state,v),V=await E.method(I,{schema:E.schema,linked:D,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((D||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(D||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(V===void 0||V===I)continue;if(V instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...V),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,V,"external"),L[O]=V):(x.tracer.value(E.state,"rule",k,V,"external"),k=V)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=k,R.length)throw w.error=d.process(R,h,v),x.debug&&(w.error.debug=x.debug),w.error}if(!v.warnings&&!v.debug&&!v.artifacts)return w.value;const A={value:w.value};return x.warnings.length&&(A.warning=d.details(x.warnings)),x.debug&&(A.debug=x.debug),x.artifacts&&(A.artifacts=x.artifacts),A},p.Mainstay=class{constructor(h,y,g){this.externals=[],this.warnings=[],this.tracer=h,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const h=this._snapshots.pop();this.externals=h.externals,this.warnings=h.warnings}commit(){this._snapshots.pop()}},p.entry=function(h,y,g){const{tracer:v,cleanup:w}=p.tracer(y,g),x=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,k=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:k,schemas:R}),T=i.validate(h,y,E,g);w&&y.$_root.untrace();const D=d.process(T.errors,h,g);return{value:T.value,error:D,mainstay:k}},p.tracer=function(h,y){return h.$_root._tracer?{tracer:h.$_root._tracer._register(h)}:y.debug?(o(h.$_root.trace,"Debug mode not supported"),{tracer:h.$_root.trace()._register(h),cleanup:!0}):{tracer:p.ignore}},i.validate=function(h,y,g,v,w={}){if(y.$_terms.whens&&(y=y._generate(h,g,v).schema),y._preferences&&(v=p.prefs(y,v)),y._cache&&v.cache){const D=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!D),D)return D}const x=(D,O,L)=>y.$_createError(D,h,O,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(D,O,L)=>g.mainstay.warnings.push(x(D,O,L)),message:(D,O)=>y.$_createError("custom",h,O,g,v,{messages:D})};g.mainstay.tracer.entry(y,g);const k=y._definition;if(k.prepare&&h!==void 0&&v.convert){const D=k.prepare(h,A);if(D){if(g.mainstay.tracer.value(g,"prepare",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}if(k.coerce&&h!==void 0&&v.convert&&(!k.coerce.from||k.coerce.from.includes(typeof h))){const D=k.coerce.method(h,A);if(D){if(g.mainstay.tracer.value(g,"coerced",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}const R=y._flags.empty;R&&R.$_match(p.trim(h,y),g.nest(R),l.defaults)&&(g.mainstay.tracer.value(g,"empty",h,void 0),h=void 0);const E=w.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(h===void 0){if(E==="forbidden")return p.finalize(h,null,A);if(E==="required")return p.finalize(h,[y.$_createError("any.required",h,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return p.finalize(h,null,A);g.mainstay.tracer.value(g,"default",h,{}),h={}}}else if(E==="forbidden")return p.finalize(h,[y.$_createError("any.unknown",h,null,g,v)],A);const T=[];if(y._valids){const D=y._valids.get(h,g,v,y._flags.insensitive);if(D)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,D.value),h=D.value),g.mainstay.tracer.filter(y,g,"valid",D),p.finalize(h,null,A);if(y._flags.only){const O=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);T.push(O)}}if(y._invalids){const D=y._invalids.get(h,g,v,y._flags.insensitive);if(D){g.mainstay.tracer.filter(y,g,"invalid",D);const O=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);T.push(O)}}if(k.validate){const D=k.validate(h,A);if(D&&(g.mainstay.tracer.value(g,"base",h,D.value),h=D.value,D.errors)){if(!Array.isArray(D.errors))return T.push(D.errors),p.finalize(h,T,A);if(D.errors.length)return T.push(...D.errors),p.finalize(h,T,A)}}return y._rules.length?p.rules(h,T,A):p.finalize(h,T,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const k=v._definition.rules[A.method];if(k.convert&&x.convert){w.mainstay.tracer.log(v,w,"rule",A.name,"full");continue}let R,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const D of A._resolve){const O=k.argsByName.get(D),L=E[D].resolve(h,w,x),I=O.normalize?O.normalize(L):L,F=l.validateArg(I,null,O);if(F){R=v.$_createError("any.ref",L,{arg:D,ref:E[D],reason:F},w,x);break}E[D]=I}}R=R||k.validate(h,g,E,A);const T=p.rule(R,A);if(T.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...T.errors);continue}if(x.abortEarly)return p.finalize(h,T.errors,g);y.push(...T.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,T.value,A.name),h=T.value}return p.finalize(h,y,g)},p.rule=function(h,y){return h instanceof d.Report?(p.error(h,y),{errors:[h],value:null}):Array.isArray(h)&&h[l.symbols.errors]?(h.forEach(g=>p.error(g,y)),{errors:h,value:null}):{errors:null,value:h}},p.error=function(h,y){return y.message&&h._setTemplate(y.message),h},p.finalize=function(h,y,g){y=y||[];const{schema:v,state:w,prefs:x}=g;if(y.length){const k=p.default("failover",void 0,y,g);k!==void 0&&(w.mainstay.tracer.value(w,"failover",h,k),h=k,y=[])}if(y.length&&v._flags.error)if(typeof v._flags.error=="function"){y=v._flags.error(y),Array.isArray(y)||(y=[y]);for(const k of y)o(k instanceof Error||k instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const k=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,k),h=k}if(v._flags.cast&&h!==void 0){const k=v._definition.cast[v._flags.cast];if(k.from(h)){const R=k.to(h,g);w.mainstay.tracer.value(w,"cast",h,R,v._flags.cast),h=R}}if(v.$_terms.externals&&x.externals&&x._externals!==!1)for(const{method:k}of v.$_terms.externals)w.mainstay.externals.push({method:k,schema:v,state:w,label:d.label(v._flags,w,x)});const A={value:h,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,w.mainstay.tracer.value(w,v._flags.result,h,A.value),w.shadow(h,v._flags.result)),v._cache&&x.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),h===void 0||A.errors||v._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(v._flags.artifact)||w.mainstay.artifacts.set(v._flags.artifact,[]),w.mainstay.artifacts.get(v._flags.artifact).push(w.path)),A},p.prefs=function(h,y){const g=y===l.defaults;return g&&h._preferences[l.symbols.prefs]?h._preferences[l.symbols.prefs]:(y=l.preferences(y,h._preferences),g&&(h._preferences[l.symbols.prefs]=y),y)},p.default=function(h,y,g,v){const{schema:w,state:x,prefs:A}=v,k=w._flags[h];if(A.noDefaults||k===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!k)return k;if(typeof k=="function"){const R=k.length?[c(x.ancestors[0]),v]:[];try{return k(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof k!="object"?k:k[l.symbols.literal]?k.literal:l.isResolvable(k)?k.resolve(y,x,A):c(k)},p.trim=function(h,y){if(typeof h!="string")return h;const g=y.$_getRule("trim");return g&&g.args.enabled?h.trim():h},p.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},p.errorsArray=function(){const h=[];return h[l.symbols.errors]=!0,h}},2036:(s,i,a)=>{const o=a(375),c=a(9474),u=a(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,m){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const p of[...d._values,...d._refs])l.add(p)}if(m)for(const p of[...m._values,...m._refs])l.remove(p);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,m,p){return!!this.get(l,d,m,p)}get(l,d,m,p){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&p){const h=this._lowercase.get(l.toLowerCase());if(h)return{value:h}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const h of this._values)if(c(h,l))return{value:h}}if(d)for(const h of this._refs){const y=h.resolve(l,d,m,null,{in:!0});if(y===void 0)continue;const g=h.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(p&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:h}}else if(c(v,l))return{value:v,ref:h}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const m of[...this._values,...this._refs])m!==void 0&&d.push(m);return d}return Array.from([...this._values,...this._refs])}clone(){const l=new f.Values(this._values,this._refs);return l._override=this._override,l}concat(l){o(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const m of l)typeof m=="string"&&d.set(m.toLowerCase(),m);return d}},978:(s,i,a)=>{const o=a(375),c=a(8571),u=a(1687),f=a(9621),l={};s.exports=function(d,m,p={}){if(o(d&&typeof d=="object","Invalid defaults value: must be an object"),o(!m||m===!0||typeof m=="object","Invalid source value: must be true, falsy or an object"),o(typeof p=="object","Invalid options: must be an object"),!m)return null;if(p.shallow)return l.applyToDefaultsWithShallow(d,m,p);const h=c(d);if(m===!0)return h;const y=p.nullOverride!==void 0&&p.nullOverride;return u(h,m,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,m,p){const h=p.shallow;o(Array.isArray(h),"Invalid keys");const y=new Map,g=m===!0?null:new Set;for(let x of h){x=Array.isArray(x)?x:x.split(".");const A=f(d,x);A&&typeof A=="object"?y.set(A,g&&f(m,x)||A):g&&g.add(x)}const v=c(d,{},y);if(!g)return v;for(const x of g)l.reachCopy(v,m,x);const w=p.nullOverride!==void 0&&p.nullOverride;return u(v,m,{nullOverride:w,mergeArrays:!1})},l.reachCopy=function(d,m,p){for(const g of p){if(!(g in m))return;const v=m[g];if(typeof v!="object"||v===null)return;m=v}const h=m;let y=d;for(let g=0;g{const o=a(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new o(u)}},8571:(s,i,a)=>{const o=a(9621),c=a(4277),u=a(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},m=null){if(typeof l!="object"||l===null)return l;let p=f.clone,h=m;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);p=w=>w}else if(h){const w=h.get(l);if(w)return w}else h=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,d);if(g===l)return l;if(h&&h.set(l,g),y===c.set)for(const w of l)g.add(p(w,d,h));else if(y===c.map)for(const[w,x]of l)g.set(w,p(x,d,h));const v=u.keys(l,d);for(const w of v){if(w==="__proto__")continue;if(y===c.array&&w==="length"){g.length=l.length;continue}const x=Object.getOwnPropertyDescriptor(l,w);x?x.get||x.set?Object.defineProperty(g,w,x):x.enumerable?g[w]=p(l[w],d,h):Object.defineProperty(g,w,{enumerable:!1,writable:!0,configurable:!0,value:p(l[w],d,h)}):Object.defineProperty(g,w,{enumerable:!0,writable:!0,configurable:!0,value:p(l[w],d,h)})}return g},f.cloneWithShallow=function(l,d){const m=d.shallow;(d=Object.assign({},d)).shallow=!1;const p=new Map;for(const h of m){const y=o(l,h);typeof y!="object"&&typeof y!="function"||p.set(y,y)}return f.clone(l,d,p)},f.base=function(l,d,m){if(m.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const p=Object.getPrototypeOf(l);if(p&&p.isImmutable)return l;if(d===c.array){const h=[];return p!==d&&Object.setPrototypeOf(h,p),h}if(f.needsProtoHack.has(d)){const h=new p.constructor;return p!==d&&Object.setPrototypeOf(h,p),h}return Object.create(p)}},9474:(s,i,a)=>{const o=a(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const m=typeof u;if(m!==typeof f||u===null||f===null)return!1;if(m==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(m!=="object")return u!=u&&f!=f;const p=c.getSharedType(u,f,!!l.prototype);switch(p){case o.buffer:return!1;case o.promise:return u===f;case o.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let h=d.length-1;h>=0;--h)if(d[h].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(p,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:o.getInternalProto(u);const d=o.getInternalProto(u);return d!==o.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,m){const{isDeepEqual:p,valueOf:h,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===o.array){if(!d.part){if(f.length!==l.length)return!1;for(let R=0;R{const o=a(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:o(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(a){if(!a)return"";let o="";for(let c=0;c=256?"&#"+a+";":`&#x${a.toString(16).padStart(2,"0")};`)},i.isSafe=function(a){return i.safeCharCodes.has(a)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const a=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&a.add(o);return a}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,a)=>{const o=a(375),c=a(8571),u=a(7043),f={};s.exports=f.merge=function(l,d,m){if(o(l&&typeof l=="object","Invalid target value: must be an object"),o(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(m=Object.assign({nullOverride:!0,mergeArrays:!0},m),Array.isArray(d)){o(Array.isArray(l),"Cannot merge array onto an object"),m.mergeArrays||(l.length=0);for(let h=0;h{const o=a(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);o(!d||!l.separator,"Separator option is not valid for array-based chain");const m=d?f:f.split(l.separator||".");let p=u;for(let h=0;h{s.exports=function(...i){try{return JSON.stringify(...i)}catch(a){return"[Cannot display object: "+a.message+"]"}}},4277:(s,i)=>{const a={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},a.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(o){if(Array.isArray(o))return i.array;if(o instanceof Date)return i.date;if(o instanceof RegExp)return i.regex;if(o instanceof Error)return i.error;const c=Object.prototype.toString.call(o);return a.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(a,o={}){return o.symbols!==!1?Reflect.ownKeys(a):Object.getOwnPropertyNames(a)}},3652:(s,i,a)=>{const o=a(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),m=f.group||"?",p=f.sort||0;o(!l.includes(m),`Item cannot come before itself: ${m}`),o(!l.includes("?"),"Item cannot come before unassociated items"),o(!d.includes(m),`Item cannot come after itself: ${m}`),o(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const h of u){const y={seq:this._items.length,sort:p,before:l,after:d,group:m,node:h};this._items.push(y)}if(!f.manual){const h=this._sort();o(h,"item",m!=="?"?`added into group ${m}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const o=a(443),c=a(2178),u={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:o.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,m=f.split(".");if(m.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const p=l.tlds;if(p){const h=m[m.length-1].toLowerCase();if(p.deny&&p.deny.has(h)||p.allow&&!p.allow.has(h))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let h=0;h63)return c.code("DOMAIN_LONG_SEGMENT");if(h{const o=a(9848),c=a(5380),u=a(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const m=!f.nonAsciiRx.test(l);if(!m){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const p=l.split("@");if(p.length!==2)return p.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[h,y]=p;if(!h)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(h).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(h,m)||c.analyze(y,d)},f.local=function(l,d){const m=l.split(".");for(const p of m){if(!p.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(p))return u.code("INVALID_LOCAL_CHARS")}else for(const h of p){if(f.atextRx.test(h))continue;const y=f.binary(h);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(a){return{code:a,error:i.codes[a]}}},9959:(s,i,a)=>{const o=a(375),c=a(5752);i.regex=function(u={}){o(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),o(l.length>=1,"options.version must have at least 1 version specified");for(let p=0;p{if(f==="forbidden")return c.ip[p];const h=`\\/${p==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[p]}${h}`:`${c.ip[p]}(?:${h})?`}).join("|")})`,m=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:m,raw:d}}},5752:(s,i,a)=>{const o=a(375),c=a(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",m="\\w-\\.~",p="!\\$&'\\(\\)\\*\\+,;=",h="%"+l,y=m+h+p+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const w=d+"{1,4}",x="(?:"+w+":"+w+"|"+f.ipv4address+")",A="(?:"+w+":){6}"+x,k="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,T="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,D="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,O="(?:(?:"+w+":){0,4}"+w+")?::"+x,L="(?:(?:"+w+":){0,5}"+w+")?::"+w,I="(?:(?:"+w+":){0,6}"+w+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+A+"|"+k+"|"+R+"|"+E+"|"+T+"|"+D+"|"+O+"|"+L+"|"+I+")",f.ipvFuture="v"+d+"+\\.["+m+p+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const F="["+m+h+p+":]*",U="["+m+h+p+"]{1,255}",Y="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",V="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",q="\\/(?:"+re+X+")?",K=re+X,Z="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+q+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+q+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",m=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(m+d);let p="";if(f.scheme){o(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);o(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let w=0;w{const a={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(o,c={}){if(!c[a.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[a.settings]?c:Object.assign({[a.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(o)}_parse(o){let c=[],u="",f=0,l=!1;const d=p=>{if(f)throw new Error("Formula missing closing parenthesis");const h=c.length?c[c.length-1]:null;if(l||u||p){if(h&&h.type==="reference"&&p===")")return h.type="function",h.value=this._subFormula(u,h.value),void(u="");if(p===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(a.operatorCharacters.includes(u))h&&h.type==="operator"&&a.operators.includes(h.value+u)?h.value+=u:c.push({type:"operator",value:u});else if(u.match(a.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(a.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const p of o)l?p===l?(d(),l=!1):u+=p:f?p==="("?(u+=p,++f):p===")"?(--f,f?u+=p:d(p)):u+=p:p in a.literals?l=a.literals[p]:p==="("?(d(),++f):a.operatorCharacters.includes(p)?(d(),u=p,d()):p!==" "?u+=p:d();d(),c=c.map((p,h)=>p.type!=="operator"||p.value!=="-"||h&&c[h-1].type!=="operator"?p:{type:"operator",value:"n"});let m=!1;for(const p of c){if(p.type==="operator"){if(a.operatorsPrefix.includes(p.value))continue;if(!m)throw new Error("Formula contains an operator in invalid position");if(!a.operators.includes(p.value))throw new Error(`Formula contains an unknown operator ${p.value}`)}else if(m)throw new Error("Formula missing expected operator");m=!m}if(!m)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(p=>{if(p.type==="operator")return a.operatorsPrefix.includes(p.value)?p:p.value;if(p.type!=="reference")return p.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(p.value))throw new Error(`Formula contains invalid reference ${p.value}`);return this.settings.reference?this.settings.reference(p.value):a.reference(p.value)})}_subFormula(o,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(o){let l="",d=0,m=!1;const p=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${o}`);f.push(l),l=""};for(let h=0;hnew i.Parser(l,this.settings)),function(l){const d=[];for(const m of f)d.push(m.evaluate(l));return u.call(l,...d)}}evaluate(o){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=a.evaluate(l,o);c[u]=a.single(f.value,d)}}return a.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},a.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var a=r[i];if(a!==void 0)return a.exports;var o=r[i]={exports:{}};return n[i](o,o.exports,s),o.exports}(5107);var n,r})})(EQ);var HOe=EQ.exports;const dr=Dd(HOe);class _a{constructor(e){He(this,"_object");He(this,"_error");He(this,"isSuccess");He(this,"isFailure");const{isSuccess:n,error:r,object:s}=e;if(n&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!n&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error message");this.isSuccess=n,this.isFailure=!n,this._error=r,this._object=s,Object.freeze(this)}get object(){if(this.isFailure)throw new Error("Result is not successful");return this._object}get error(){if(this.isSuccess)throw new Error("Result is not error");return this._error}static ok(e){return new _a({isSuccess:!0,object:e})}static fail(e){return new _a({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return _a.ok()}}class Zl{static validate(e,n,r={}){if(!dr.isSchema(e))throw new VOe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?_a.fail(i.error):_a.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}He(Zl,"RULE_NOT_NULL_OR_UNDEFINED",dr.any().required().invalid(null)),He(Zl,"RULE_ALLOW_NULL_OR_UNDEFINED",dr.any().optional().valid(null)),He(Zl,"RULE_ALLOW_NULL",dr.any().valid(null)),He(Zl,"RULE_ALLOW_EMPTY",dr.any().optional().valid(null,"")),He(Zl,"RULE_IS_TYPE_STRING",dr.string()),He(Zl,"RULE_IS_TYPE_NUMBER",dr.number());class VOe extends Error{}class P$ extends Error{constructor(n,r,s={}){super(r);He(this,"code");He(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,P$.prototype)}}const XC=class XC extends P${static create(e,n,r){return new XC(e,n,r)}};He(XC,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let i0=XC;function CQ(t,e="",n){return i0.create(t,e,n)}var AQ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Object.prototype.hasOwnProperty;t.is=function(n,r){return n===r?n!==0||r!==0||1/n===1/r:n!==n&&r!==r},t.shallowEqual=function(n,r,s){if(n===r)return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=s&&typeof s.customEqual=="function"?s.customEqual:t.is,c=0;cthis.props===null)}}class xUe extends dr.ValidationError{}class SUe extends dr.ValidationError{}class EUe extends dr.ValidationError{}class CUe extends dr.ValidationError{}class AUe extends dr.ValidationError{}const XT={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"€",name:"Euro",symbol_native:"€",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},BTC:{symbol:"BTC",name:"Bitcoin",symbol_native:"฿",decimal_digits:8,rounding:0,code:"BTC",name_plural:"Bitcoins"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"د.إ.‏",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"؋",decimal_digits:2,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:2,rounding:0,code:"ALL",name_plural:"Albanian lekë"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"դր.",decimal_digits:2,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"ман.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"৳",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"лв.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"د.ب.‏",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN¥",name:"Chinese Yuan",symbol_native:"CN¥",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"₡",name:"Costa Rican Colón",symbol_native:"₡",decimal_digits:2,rounding:0,code:"CRC",name_plural:"Costa Rican colóns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"Kč",name:"Czech Republic Koruna",symbol_native:"Kč",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"د.ج.‏",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"ج.م.‏",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"£",name:"British Pound Sterling",symbol_native:"£",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH₵",name:"Ghanaian Cedi",symbol_native:"GH₵",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:2,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:2,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"₪",name:"Israeli New Sheqel",symbol_native:"₪",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbol_native:"টকা",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"د.ع.‏",decimal_digits:3,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"﷼",decimal_digits:2,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Króna",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic krónur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"د.أ.‏",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"¥",name:"Japanese Yen",symbol_native:"¥",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"៛",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"₩",name:"South Korean Won",symbol_native:"₩",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"د.ك.‏",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"тңг.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LAK:{symbol:"₭",name:"Lao kip",symbol_native:"ກີບ",decimal_digits:2,rounding:0,code:"LAK",name_plural:"Lao kips"},LBP:{symbol:"LB£",name:"Lebanese Pound",symbol_native:"ل.ل.‏",decimal_digits:2,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"د.ل.‏",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"د.م.‏",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:2,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:2,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:2,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"₦",name:"Nigerian Naira",symbol_native:"₦",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan Córdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan córdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"नेरू",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"ر.ع.‏",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"₱",name:"Philippine Peso",symbol_native:"₱",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"₨",decimal_digits:2,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"zł",name:"Polish Zloty",symbol_native:"zł",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"₲",name:"Paraguayan Guarani",symbol_native:"₲",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"ر.ق.‏",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"дин.",decimal_digits:2,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"₽",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"ر.س.‏",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:2,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY£",name:"Syrian Pound",symbol_native:"ل.س.‏",decimal_digits:2,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"฿",name:"Thai Baht",symbol_native:"฿",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"د.ت.‏",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Paʻanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan paʻanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:2,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"₴",name:"Ukrainian Hryvnia",symbol_native:"₴",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:2,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bolívar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bolívars"},VND:{symbol:"₫",name:"Vietnamese Dong",symbol_native:"₫",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"ر.ي.‏",decimal_digits:2,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},Au=class Au extends WOe{constructor(){super(...arguments);He(this,"toString",()=>this.code)}get symbol(){return this.props?String(this.props.symbol_native):""}get code(){return this.props?String(this.props.code):""}static validate(n,r){const s=dr.alternatives(Zl.RULE_ALLOW_EMPTY.default(""),dr.string().uppercase().valid(...Object.keys(XT)).label(String(r.label)));return Zl.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=Au.validate(n,s);return i.isFailure?_a.fail(CQ(i0.INVALID_INPUT_DATA,i.error.message,s)):_a.ok(new Au(XT[i.object]))}static createDefaultCode(){return Au.createFromCode(Au.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};He(Au,"DEFAULT_CURRENCY_CODE","EUR"),He(Au,"CURRENCIES",XT);let kC=Au;class RUe extends dr.ValidationError{}var GOe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},qOe={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function vb(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vb=function(e){return typeof e}:vb=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vb(t)}function w4(t){return KOe(t)||YOe(t)||XOe(t)||QOe()}function KOe(t){if(Array.isArray(t))return t}function YOe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function XOe(t,e){if(t){if(typeof t=="string")return _4(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _4(t,e)}}function _4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0}function eMe(t){return t.length>0&&t.every(function(e){return e>=0})&&t.some(function(e){return e>0})}function x4(t){return t%2===0}function S4(t){return PQ(t)&&!Number.isInteger(t)}function tMe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=t.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var n=e.split(".")[1];return n?n.length:0}function Ay(t){return Math.abs(t)%1===.5}function nMe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var s=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){s.readyState===4&&(s.status>=200&&s.status<400?n(JSON.parse(s.responseText)):r(new Error(s.statusText)))},onerror:function(){r(new Error("Network error"))}});s.open("GET",t,!0),rMe(s,e.headers),s.send()})}function rMe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in e)t.setRequestHeader(n,e[n]);return t}function Uy(t){return typeof t>"u"}function TQ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(t).forEach(function(r){if(vb(r[1])==="object"){var s=TQ(r[1]);Object.entries(s).forEach(function(i){n[r[0]+e+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function sMe(t){return!!t&&(vb(t)==="object"||typeof t=="function")&&typeof t.then=="function"}function kQ(){var t=function(r,s){var i=function(c){return Math.pow(10,tMe(c))},a=Math.max(i(r),i(s));return Math.round(r*a)*Math.round(s*a)/(a*a)},e={HALF_ODD:function(r){var s=Math.round(r);return Ay(r)&&x4(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return Ay(r)?x4(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Ay(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Ay(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Ay(r)?Math.sign(r)*Math.ceil(Math.abs(r)):Math.round(r)},DOWN:function(r){return Math.floor(r)}};return{add:function(r,s){return r+s},subtract:function(r,s){return r-s},multiply:function(r,s){return S4(r)||S4(s)?t(r,s):r*s},divide:function(r,s){return r/s},modulo:function(r,s){return r%s},round:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[s](r)}}}var iMe=kQ();function oMe(t){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return e!==null?e.slice(1).filter(function(r){return!Uy(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return Uy(this.getMatches().find(r))?0:this.getMatches()[iMe.add(this.getMatches().findIndex(r),1)].split("").length},getCurrencyDisplay:function(){var r={USD:"code",dollar:"name",$:"symbol"};return r[this.getMatches().find(function(s){return s==="USD"||s==="dollar"||s==="$"})]},getStyle:function(){return Uy(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Uy(this.getMatches().find(function(r){return r===","}))}}}function aMe(t){var e=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;for(var a in i)s=s.replace("{{".concat(a,"}}"),i[a]);return s},n=function(s,i){return nMe(e(t.endpoint,{from:s,to:i}),{headers:t.headers})};return{getExchangeRate:function(s,i){return(sMe(t.endpoint)?t.endpoint:n(s,i)).then(function(a){return TQ(a)[e(t.propertyPath,{from:s,to:i})]})}}}function o0(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!t)throw new n(e)}function lMe(t){o0(JOe(t),"You must provide a numeric value between 0 and 100.",RangeError)}function cMe(t){o0(eMe(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function QT(t){o0(Number.isInteger(t),"You must provide an integer.",TypeError)}var Fn=kQ(),uMe=function t(e){var n=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},e),r=n.amount,s=n.currency,i=n.precision;QT(r),QT(i);var a=t.globalLocale,o=t.globalFormat,c=t.globalRoundingMode,u=t.globalFormatRoundingMode,f=Object.assign({},t.globalExchangeRatesApi),l=function(p){var h=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},p),Object.assign({},{locale:this.locale},p));return Object.assign(t({amount:h.amount,currency:h.currency,precision:h.precision}),{locale:h.locale})},d=function(p){o0(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return s},getLocale:function(){return this.locale||a},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return i},convertPrecision:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;QT(p);var y=this.getPrecision(),g=p>y,v=g?Fn.multiply:Fn.divide,w=g?[p,y]:[y,p],x=Math.pow(10,Fn.subtract.apply(Fn,w));return l.call(this,{amount:Fn.round(v(this.getAmount(),x),h),precision:p})},add:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return l.call(this,{amount:Fn.add(h[0].getAmount(),h[1].getAmount()),precision:h[0].getPrecision()})},subtract:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return l.call(this,{amount:Fn.subtract(h[0].getAmount(),h[1].getAmount()),precision:h[0].getPrecision()})},multiply:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Fn.round(Fn.multiply(this.getAmount(),p),h)})},divide:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Fn.round(Fn.divide(this.getAmount(),p),h)})},percentage:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return lMe(p),this.multiply(Fn.divide(p,100),h)},allocate:function(p){var h=this;cMe(p);for(var y=p.reduce(function(x,A){return Fn.add(x,A)}),g=this.getAmount(),v=p.map(function(x){var A=Math.floor(Fn.divide(Fn.multiply(h.getAmount(),x),y));return g=Fn.subtract(g,A),l.call(h,{amount:A})}),w=0;g>0;)p[w]>0&&(v[w]=v[w].add(l.call(this,{amount:1})),g=Fn.subtract(g,1)),w+=1;return v},convert:function(p){var h=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=y.endpoint,v=g===void 0?f.endpoint:g,w=y.propertyPath,x=w===void 0?f.propertyPath||"rates.{{to}}":w,A=y.headers,k=A===void 0?f.headers:A,R=y.roundingMode,E=R===void 0?c:R,T=Object.assign({},{endpoint:v,propertyPath:x,headers:k,roundingMode:E});return aMe(T).getExchangeRate(this.getCurrency(),p).then(function(D){return o0(!Uy(D),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(h,{amount:Fn.round(Fn.multiply(h.getAmount(),parseFloat(D)),T.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()h[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()>=h[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Fn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return Fn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var h=t.normalizePrecision([this,p]);return h[0].getAmount()===h[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=oMe(p);return this.toRoundedUnit(y.getMinimumFractionDigits(),h).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Fn.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,p);return Fn.divide(Fn.round(Fn.multiply(this.toUnit(),y),h),y)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},yS=Object.assign(uMe,GOe,qOe,ZOe),DC={exports:{}};/** + */function r0(){return r0=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[s]=t[s]);return n}function nOe(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function rOe(t,e){return t.button===0&&(!e||e==="_self")&&!nOe(t)}function TN(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function sOe(t,e){let n=TN(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const iOe=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],oOe="6";try{window.__reactRouterVersion=oOe}catch{}function aOe(t,e){return vNe({basename:e==null?void 0:e.basename,future:r0({},e==null?void 0:e.future,{v7_prependBasename:!0}),history:BDe({window:e==null?void 0:e.window}),hydrationData:(e==null?void 0:e.hydrationData)||lOe(),routes:t,mapRouteProperties:eOe,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window}).initialize()}function lOe(){var t;let e=(t=window)==null?void 0:t.__staticRouterHydrationData;return e&&e.errors&&(e=r0({},e,{errors:cOe(e.errors)})),e}function cOe(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,s]of e)if(s&&s.__type==="RouteErrorResponse")n[r]=new AC(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let a=new i(s.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(s.message);i.stack="",n[r]=i}}else n[r]=s;return n}const uOe=_.createContext({isTransitioning:!1}),dOe=_.createContext(new Map),fOe="startTransition",l4=Yw[fOe],hOe="flushSync",c4=Yue[hOe];function pOe(t){l4?l4(t):t()}function Ey(t){c4?c4(t):t()}class mOe{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function gOe(t){let{fallbackElement:e,router:n,future:r}=t,[s,i]=_.useState(n.state),[a,o]=_.useState(),[c,u]=_.useState({isTransitioning:!1}),[f,l]=_.useState(),[d,m]=_.useState(),[p,h]=_.useState(),y=_.useRef(new Map),{v7_startTransition:g}=r||{},v=_.useCallback(E=>{g?pOe(E):E()},[g]),w=_.useCallback((E,T)=>{let{deletedFetchers:D,flushSync:O,viewTransitionOpts:L}=T;E.fetchers.forEach((F,U)=>{F.data!==void 0&&y.current.set(U,F.data)}),D.forEach(F=>y.current.delete(F));let I=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||I){O?Ey(()=>i(E)):v(()=>i(E));return}if(O){Ey(()=>{d&&(f&&f.resolve(),d.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let F=n.window.document.startViewTransition(()=>{Ey(()=>i(E))});F.finished.finally(()=>{Ey(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})})}),Ey(()=>m(F));return}d?(f&&f.resolve(),d.skipTransition(),h({state:E,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,d,f,y,v]);_.useLayoutEffect(()=>n.subscribe(w),[n,w]),_.useEffect(()=>{c.isTransitioning&&!c.flushSync&&l(new mOe)},[c]),_.useEffect(()=>{if(f&&a&&n.window){let E=a,T=f.promise,D=n.window.document.startViewTransition(async()=>{v(()=>i(E)),await T});D.finished.finally(()=>{l(void 0),m(void 0),o(void 0),u({isTransitioning:!1})}),m(D)}},[v,a,f,n.window]),_.useEffect(()=>{f&&a&&s.location.key===a.location.key&&f.resolve()},[f,d,s.location,a]),_.useEffect(()=>{!c.isTransitioning&&p&&(o(p.state),u({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),h(void 0))},[c.isTransitioning,p]),_.useEffect(()=>{},[]);let x=_.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,T,D)=>n.navigate(E,{state:T,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(E,T,D)=>n.navigate(E,{replace:!0,state:T,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[n]),A=n.basename||"/",k=_.useMemo(()=>({router:n,navigator:x,static:!1,basename:A}),[n,x,A]),R=_.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return _.useEffect(()=>ZNe(r,n.future),[r,n.future]),_.createElement(_.Fragment,null,_.createElement(LA.Provider,{value:k},_.createElement(mQ.Provider,{value:s},_.createElement(dOe.Provider,{value:y.current},_.createElement(uOe.Provider,{value:c},_.createElement(JNe,{basename:A,location:s.location,navigationType:s.historyAction,navigator:x,future:R},s.initialized||n.future.v7_partialHydration?_.createElement(vOe,{routes:n.routes,future:n.future,state:s}):e))))),null)}const vOe=_.memo(yOe);function yOe(t){let{routes:e,future:n,state:r}=t;return BNe(e,void 0,r,n)}const bOe=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wOe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gf=_.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:o,target:c,to:u,preventScrollReset:f,viewTransition:l}=e,d=tOe(e,iOe),{basename:m}=_.useContext(Bd),p,h=!1;if(typeof u=="string"&&wOe.test(u)&&(p=u,bOe))try{let w=new URL(window.location.href),x=u.startsWith("//")?new URL(w.protocol+u):new URL(u),A=Rd(x.pathname,m);x.origin===w.origin&&A!=null?u=A+x.search+x.hash:h=!0}catch{}let y=$Ne(u,{relative:s}),g=_Oe(u,{replace:a,state:o,target:c,preventScrollReset:f,relative:s,viewTransition:l});function v(w){r&&r(w),w.defaultPrevented||g(w)}return _.createElement("a",r0({},d,{href:p||y,onClick:h||i?r:v,ref:n,target:c}))});var u4;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(u4||(u4={}));var d4;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(d4||(d4={}));function _Oe(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,c=Lv(),u=Ud(),f=yQ(t,{relative:a});return _.useCallback(l=>{if(rOe(l,n)){l.preventDefault();let d=r!==void 0?r:Jh(u)===Jh(f);c(t,{replace:d,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,c,f,r,s,n,t,i,a,o])}function xOe(t){let e=_.useRef(TN(t)),n=_.useRef(!1),r=Ud(),s=_.useMemo(()=>sOe(r.search,n.current?null:e.current),[r.search]),i=Lv(),a=_.useCallback((o,c)=>{const u=TN(typeof o=="function"?o(s):o);n.current=!0,i("?"+u,c)},[i,s]);return[s,a]}const CQ=({isOpen:t,onCancel:e,onConfirm:n,title:r,description:s,cancelLabel:i,confirmLabel:a})=>P.jsx(aW,{open:t,children:P.jsxs(PL,{children:[P.jsxs(TL,{children:[P.jsx(DL,{children:r}),P.jsx(NL,{children:s})]}),P.jsxs(kL,{children:[P.jsx(ML,{children:P.jsx(gf,{to:"#",onClick:e,children:i})}),P.jsx(OL,{children:P.jsx(gf,{to:"#",onClick:n,children:a})})]})]})}),pt=t=>typeof t=="string",Cy=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},f4=t=>t==null?"":""+t,SOe=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},EOe=/###/g,h4=t=>t&&t.indexOf("###")>-1?t.replace(EOe,"."):t,p4=t=>!t||pt(t),gb=(t,e,n)=>{const r=pt(e)?e.split("."):e;let s=0;for(;s{const{obj:r,k:s}=gb(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],a=e.slice(0,e.length-1),o=gb(t,a,Object);for(;o.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),o=gb(t,a,Object),o&&o.obj&&typeof o.obj[`${o.k}.${i}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${i}`]=n},COe=(t,e,n,r)=>{const{obj:s,k:i}=gb(t,e,Object);s[i]=s[i]||[],s[i].push(n)},RC=(t,e)=>{const{obj:n,k:r}=gb(t,e);if(n)return n[r]},AOe=(t,e,n)=>{const r=RC(t,n);return r!==void 0?r:RC(e,n)},AQ=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?pt(t[r])||t[r]instanceof String||pt(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):AQ(t[r],e[r],n):t[r]=e[r]);return t},Gp=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ROe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const POe=t=>pt(t)?t.replace(/[&<>"'\/]/g,e=>ROe[e]):t;class TOe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const kOe=[" ",",","?","!",";"],DOe=new TOe(20),NOe=(t,e,n)=>{e=e||"",n=n||"";const r=kOe.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=DOe.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!s.test(t);if(!i){const a=t.indexOf(n);a>0&&!s.test(t.substring(0,a))&&(i=!0)}return i},kN=function(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let s=t;for(let i=0;i-1&&ct&&t.replace("_","-"),OOe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class TC{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||OOe,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{let[o,c]=a;for(let u=0;u{let[o,c]=a;for(let u=0;u1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,n],r&&(Array.isArray(r)?o.push(...r):pt(r)&&i?o.push(...r.split(i)):o.push(r)));const c=RC(this.data,o);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=o[0],n=o[1],r=o.slice(2).join(".")),c||!a||!pt(r)?c:kN(this.data&&this.data[e]&&this.data[e][n],r,i)}addResource(e,n,r,s){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let o=[e,n];r&&(o=o.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(o=e.split("."),s=n,n=o[1]),this.addNamespaces(n),m4(this.data,o,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(pt(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),s=r,r=n,n=o[1]),this.addNamespaces(n);let c=RC(this.data,o)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?AQ(c,r,i):c={...c,...r},m4(this.data,o,c),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var RQ={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,r,s))}),e}};const v4={};class kC extends IA{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),SOe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=hl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!NOe(e,r,s);if(a&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:pt(i)?[i]:i};const u=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(s)}return{key:e,namespaces:pt(i)?[i]:i}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const s=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:o}=this.extractFromKey(e[e.length-1],n),c=o[o.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(f){const x=n.nsSeparator||this.options.nsSeparator;return s?{res:`${c}${x}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:`${c}${x}${a}`}return s?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(n)}:a}const l=this.resolve(e,n);let d=l&&l.res;const m=l&&l.usedKey||a,p=l&&l.exactUsedKey||a,h=Object.prototype.toString.apply(d),y=["[object Number]","[object Function]","[object RegExp]"],g=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!pt(d)&&typeof d!="boolean"&&typeof d!="number";if(v&&d&&w&&y.indexOf(h)<0&&!(pt(g)&&Array.isArray(d))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const x=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,d,{...n,ns:o}):`key '${a} (${this.language})' returned an object instead of string.`;return s?(l.res=x,l.usedParams=this.getUsedParamsDetails(n),l):x}if(i){const x=Array.isArray(d),A=x?[]:{},k=x?p:m;for(const R in d)if(Object.prototype.hasOwnProperty.call(d,R)){const E=`${k}${i}${R}`;A[R]=this.translate(E,{...n,joinArrays:!1,ns:o}),A[R]===E&&(A[R]=d[R])}d=A}}else if(v&&pt(g)&&Array.isArray(d))d=d.join(g),d&&(d=this.extendTranslation(d,e,n,r));else{let x=!1,A=!1;const k=n.count!==void 0&&!pt(n.count),R=kC.hasDefaultValue(n),E=k?this.pluralResolver.getSuffix(u,n.count,n):"",T=n.ordinal&&k?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",D=k&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),O=D&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${E}`]||n[`defaultValue${T}`]||n.defaultValue;!this.isValidLookup(d)&&R&&(x=!0,d=O),this.isValidLookup(d)||(A=!0,d=a);const I=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:d,F=R&&O!==d&&this.options.updateMissing;if(A||x||F){if(this.logger.log(F?"updateKey":"missingKey",u,c,a,F?O:d),i){const H=this.resolve(a,{...n,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Y&&Y[0])for(let H=0;H{const X=R&&re!==d?re:I;this.options.missingKeyHandler?this.options.missingKeyHandler(H,c,ee,X,F,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(H,c,ee,X,F,n),this.emit("missingKey",H,c,ee,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?U.forEach(H=>{const ee=this.pluralResolver.getSuffixes(H,n);D&&n[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(re=>{V([H],a+re,n[`defaultValue${re}`]||O)})}):V(U,a,O))}d=this.extendTranslation(d,e,n,l,r),A&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${c}:${a}`),(A||x)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${a}`:a,x?d:void 0):d=this.options.parseMissingKeyHandler(d))}return s?(l.res=d,l.usedParams=this.getUsedParamsDetails(n),l):d}extendTranslation(e,n,r,s,i){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=pt(e)&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const d=e.match(this.interpolator.nestingRegexp);f=d&&d.length}let l=r.replace&&!pt(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,r.lng||this.language||s.usedLng,r),u){const d=e.match(this.interpolator.nestingRegexp),m=d&&d.length;f1&&arguments[1]!==void 0?arguments[1]:{},r,s,i,a,o;return pt(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),f=u.key;s=f;let l=u.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=n.count!==void 0&&!pt(n.count),m=d&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(pt(n.context)||typeof n.context=="number")&&n.context!=="",h=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);l.forEach(y=>{this.isValidLookup(r)||(o=y,!v4[`${h[0]}-${y}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(v4[`${h[0]}-${y}`]=!0,this.logger.warn(`key "${s}" for languages "${h.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach(g=>{if(this.isValidLookup(r))return;a=g;const v=[f];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,f,g,y,n);else{let x;d&&(x=this.pluralResolver.getSuffix(g,n.count,n));const A=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(v.push(f+x),n.ordinal&&x.indexOf(k)===0&&v.push(f+x.replace(k,this.options.pluralSeparator)),m&&v.push(f+A)),p){const R=`${f}${this.options.contextSeparator}${n.context}`;v.push(R),d&&(v.push(R+x),n.ordinal&&x.indexOf(k)===0&&v.push(R+x.replace(k,this.options.pluralSeparator)),m&&v.push(R+A))}}let w;for(;w=v.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(g,y,w,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!pt(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}const YT=t=>t.charAt(0).toUpperCase()+t.slice(1);class y4{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hl.create("languageUtils")}getScriptPartFromCode(e){if(e=PC(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=PC(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(pt(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let s=Intl.getCanonicalLocales(e)[0];if(s&&this.options.lowerCaseLng&&(s=s.toLowerCase()),s)return s}catch{}const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(s=>s.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=YT(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=YT(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=YT(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),pt(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),s=[],i=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return pt(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):pt(e)&&i(this.formatLanguageCode(e)),r.forEach(a=>{s.indexOf(a)<0&&i(this.formatLanguageCode(a))}),s}}let MOe=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],LOe={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const IOe=["v1","v2","v3"],$Oe=["v4"],b4={zero:0,one:1,two:2,few:3,many:4,other:5},FOe=()=>{const t={};return MOe.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:LOe[e.fc]}})}),t};class jOe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=hl.create("pluralResolver"),(!this.options.compatibilityJSON||$Oe.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=FOe(),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const r=PC(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!e.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(c,n)}return this.pluralRulesCache[i]=a,a}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((s,i)=>b4[s]-b4[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):r.numbers.map(s=>this.getSuffix(e,s,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=this.getRule(e,r);return s?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:this.getSuffixRetroCompatible(s,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let s=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));const i=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?`_plural_${s.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!IOe.includes(this.options.compatibilityJSON)}}const w4=function(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=AOe(t,e,n);return!i&&s&&pt(n)&&(i=kN(t,n,r),i===void 0&&(i=kN(e,n,r))),i},XT=t=>t.replace(/\$/g,"$$$$");class zOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=hl.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:a,suffix:o,suffixEscaped:c,formatSeparator:u,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:h,nestingOptionsSeparator:y,maxReplaces:g,alwaysFormat:v}=e.interpolation;this.escape=n!==void 0?n:POe,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Gp(i):a||"{{",this.suffix=o?Gp(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Gp(d):m||Gp("$t("),this.nestingSuffix=p?Gp(p):h||Gp(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=g||1e3,this.alwaysFormat=v!==void 0?v:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,s){let i,a,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=m=>{if(m.indexOf(this.formatSeparator)<0){const g=w4(n,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...s,...n,interpolationkey:m}):g}const p=m.split(this.formatSeparator),h=p.shift().trim(),y=p.join(this.formatSeparator).trim();return this.format(w4(n,c,h,this.options.keySeparator,this.options.ignoreJSONStructure),y,r,{...s,...n,interpolationkey:h})};this.resetRegExp();const f=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,l=s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>XT(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?XT(this.escape(m)):XT(m)}].forEach(m=>{for(o=0;i=m.regex.exec(e);){const p=i[1].trim();if(a=u(p),a===void 0)if(typeof f=="function"){const y=f(e,i,s);a=pt(y)?y:""}else if(s&&Object.prototype.hasOwnProperty.call(s,p))a="";else if(l){a=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),a="";else!pt(a)&&!this.useRawValueToEscape&&(a=f4(a));const h=m.safeValue(a);if(e=e.replace(i[0],h),l?(m.regex.lastIndex+=a.length,m.regex.lastIndex-=i[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,i,a;const o=(c,u)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const l=c.split(new RegExp(`${f}[ ]*{`));let d=`{${l[1]}`;c=l[0],d=this.interpolate(d,a);const m=d.match(/'/g),p=d.match(/"/g);(m&&m.length%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(h){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,h),`${c}${f}${d}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];a={...r},a=a.replace&&!pt(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(l=>l.trim());s[1]=f.shift(),c=f,u=!0}if(i=n(o.call(this,s[1].trim(),a),a),i&&s[0]===e&&!pt(i))return i;pt(i)||(i=f4(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),u&&(i=c.reduce((f,l)=>this.format(f,l,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const BOe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[o,...c]=a.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();n[f]||(n[f]=u),u==="false"&&(n[f]=!1),u==="true"&&(n[f]=!0),isNaN(u)||(n[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},qp=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const a=r+JSON.stringify(i);let o=e[a];return o||(o=t(PC(r),s),e[a]=o),o(n)}};class UOe{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=hl.create("formatter"),this.options=e,this.formats={number:qp((n,r)=>{const s=new Intl.NumberFormat(n,{...r});return i=>s.format(i)}),currency:qp((n,r)=>{const s=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>s.format(i)}),datetime:qp((n,r)=>{const s=new Intl.DateTimeFormat(n,{...r});return i=>s.format(i)}),relativetime:qp((n,r)=>{const s=new Intl.RelativeTimeFormat(n,{...r});return i=>s.format(i,r.range||"day")}),list:qp((n,r)=>{const s=new Intl.ListFormat(n,{...r});return i=>s.format(i)})},this.init(e)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=n.interpolation.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=qp(n)}format(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(o=>o.indexOf(")")>-1)){const o=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,o)].join(this.formatSeparator)}return i.reduce((o,c)=>{const{formatName:u,formatOptions:f}=BOe(c);if(this.formats[u]){let l=o;try{const d=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},m=d.locale||d.lng||s.locale||s.lng||r;l=this.formats[u](o,m,{...f,...s,...d})}catch(d){this.logger.warn(d)}return l}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const HOe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class VOe extends IA{constructor(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=hl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,s.backend,s)}queueLoad(e,n,r,s){const i={},a={},o={},c={};return e.forEach(u=>{let f=!0;n.forEach(l=>{const d=`${u}|${l}`;!r.reload&&this.store.hasResourceBundle(u,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),i[d]===void 0&&(i[d]=!0),c[l]===void 0&&(c[l]=!0)))}),f||(o[u]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const s=e.split("|"),i=s[0],a=s[1];n&&this.emit("failedLoading",i,a,n),!n&&r&&this.store.addResourceBundle(i,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const o={};this.queue.forEach(c=>{COe(c.loaded,[i],a),HOe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{o[u]||(o[u]={});const f=c.loaded[u];f.length&&f.forEach(l=>{o[u][l]===void 0&&(o[u][l]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(u&&f&&s{this.read.call(this,e,n,r,s+1,i*2,a)},i);return}a(u,f)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return c(e,n,o)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();pt(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pt(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,a),!a&&o&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,o),this.loaded(e,a,o)})}saveMissing(e,n,r,s,i){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},o=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const c={...a,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,n,r,s,c):f=u(e,n,r,s),f&&typeof f.then=="function"?f.then(l=>o(null,l)).catch(o):o(null,f)}catch(f){o(f)}else u(e,n,r,s,o,c)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const _4=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),pt(t[1])&&(e.defaultValue=t[1]),pt(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),x4=t=>(pt(t.ns)&&(t.ns=[t.ns]),pt(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),pt(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),yS=()=>{},WOe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class s0 extends IA{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=x4(e),this.services={},this.logger=hl,this.modules={external:[]},WOe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(pt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=_4();this.options={...s,...this.options,...x4(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const i=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?hl.init(i(this.modules.logger),this.options):hl.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:typeof Intl<"u"&&(f=UOe);const l=new y4(this.options);this.store=new g4(this.options.resources,this.options);const d=this.services;d.logger=hl,d.resourceStore=this.store,d.languageUtils=l,d.pluralResolver=new jOe(l,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),f&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(d.formatter=i(f),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new zOe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new VOe(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(m){for(var p=arguments.length,h=new Array(p>1?p-1:0),y=1;y1?p-1:0),y=1;y{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,r||(r=yS),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=function(){return e.store[f](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=function(){return e.store[f](...arguments),e}});const c=Cy(),u=()=>{const f=(l,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(d),r(l,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),c}loadResources(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yS;const s=pt(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s&&s.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const i=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&i.indexOf(u)<0&&i.push(u)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>a(c)),this.options.preload&&this.options.preload.forEach(o=>a(o)),this.services.backendConnector.load(i,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(o)})}else r(null)}reloadResources(e,n,r){const s=Cy();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=yS),this.services.backendConnector.reload(e,n,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&RQ.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const s=Cy();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},a=(c,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,s.resolve(function(){return r.t(...arguments)}),n&&n(c,function(){return r.t(...arguments)})},o=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const u=pt(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,f=>{a(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),s}getFixedT(e,n,r){var s=this;const i=function(a,o){let c;if(typeof o!="object"){for(var u=arguments.length,f=new Array(u>2?u-2:0),l=2;l`${c.keyPrefix}${d}${p}`):m=c.keyPrefix?`${c.keyPrefix}${d}${a}`:a,s.t(m,c)};return pt(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(o,c)=>{const u=this.services.backendConnector.state[`${o}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!s||a(i,e)))}loadNamespaces(e,n){const r=Cy();return this.options.ns?(pt(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Cy();pt(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=s.concat(i),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new y4(_4());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new s0(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yS;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new s0(s);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new g4(this.store.data,s),i.services.resourceStore=i.store),i.translator=new kC(i.services,s),i.translator.on("*",function(o){for(var c=arguments.length,u=new Array(c>1?c-1:0),f=1;f{const[e,n]=_.useState(!1),[r,s]=_.useState({title:"Título",description:"Descripción",cancelLabel:tr("common.no"),confirmLabel:tr("common.yes"),onCancel:()=>{},onConfirm:()=>{},...t}),i=(u,f)=>{u==null||u.preventDefault(),f&&s(f),n(!0)},a=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onCancel(u)},o=u=>{u==null||u.preventDefault(),n(!1),r==null||r.onConfirm(u)},c=r?P.jsx(CQ,{isOpen:e,onCancel:a,onConfirm:o,title:r.title,description:r.description,cancelLabel:r.cancelLabel,confirmLabel:r.confirmLabel}):P.jsx(P.Fragment,{});return{openDialog:i,cancelDialog:a,confirmDialog:o,DialogComponent:c}};var PQ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,a)=>{const o=a(375),c=a(8571),u=a(9474),f=a(1687),l=a(8652),d=a(8160),m=a(3292),p=a(6354),h=a(8901),y=a(9708),g=a(6914),v=a(2294),w=a(6133),x=a(1152),A=a(8863),k=a(2036),R={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return o(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){o(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const T=this.clone();T.$_terms.alterations=T.$_terms.alterations||[];for(const D in E){const O=E[D];o(typeof O=="function","Alteration adjuster for",D,"must be a function"),T.$_terms.alterations.push({target:D,adjuster:O})}return T.$_temp.ruleset=!1,T}artifact(E){return o(E!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return o(E===!1||typeof E=="string","Invalid to value"),o(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,T){return this._default("default",E,T)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const T=this.clone();return E!==void 0&&(E=T.$_compile(E,{override:!1})),T.$_setFlag("empty",E,{clone:!1})}error(E){return o(E,"Missing error"),o(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,T={}){return o(E!==void 0,"Missing example"),d.assertOptions(T,["override"]),this._inner("examples",E,{single:!0,override:T.override})}external(E,T){return typeof E=="object"&&(o(!T,"Cannot combine options with description"),T=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(T===void 0||T&&typeof T=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:T},{single:!0})}failover(E,T){return this._default("failover",E,T)}forbidden(){return this.presence("forbidden")}id(E){return E?(o(typeof E=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return o(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return o(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){o(E.length,"Missing notes");for(const T of E)o(T&&typeof T=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return o(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){o(E,"Missing preferences"),o(E.context===void 0,"Cannot override context"),o(E.externals===void 0,"Cannot override externals"),o(E.warnings===void 0,"Cannot override warnings"),o(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const T=this.clone();return T._preferences=d.preferences(T._preferences,E),T}presence(E){return o(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return o(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const T=this.clone(),D=E!==void 0&&!E;return T._preferences=d.preferences(T._preferences,{convert:D}),T}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const T of E)o(T&&typeof T=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return o(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const T=this.allow(...E);return T.$_setFlag("only",!!T._valids,{clone:!1}),T}when(E,T){const D=this.clone();D.$_terms.whens||(D.$_terms.whens=[]);const O=m.when(D,E,T);if(!["any","link"].includes(D.type)){const L=O.is?[O]:O.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===D.type,"Cannot combine",D.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===D.type,"Cannot combine",D.type,"with",I.otherwise&&I.otherwise.type)}return D.$_terms.whens.push(O),D.$_mutateRebuild()}cache(E){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const T=this.clone();return T._cache=E||l.provider.provision(),T.$_temp.ruleset=!1,T}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){o(d.isSchema(E),"Invalid schema object"),o(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let T=this.clone();if(this.type==="any"&&E.type!=="any"){const D=E.clone();for(const O of Object.keys(T))O!=="type"&&(D[O]=T[O]);T=D}T._ids.concat(E._ids),T._refs.register(E,w.toSibling),T._preferences=T._preferences?d.preferences(T._preferences,E._preferences):E._preferences,T._valids=k.merge(T._valids,E._valids,E._invalids),T._invalids=k.merge(T._invalids,E._invalids,E._valids);for(const D of E._singleRules.keys())T._singleRules.has(D)&&(T._rules=T._rules.filter(O=>O.keep||O.name!==D),T._singleRules.delete(D));for(const D of E._rules)E._definition.rules[D.method].multi||T._singleRules.set(D.name,D),T._rules.push(D);if(T._flags.empty&&E._flags.empty){T._flags.empty=T._flags.empty.concat(E._flags.empty);const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else if(E._flags.empty){T._flags.empty=E._flags.empty;const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else f(T._flags,E._flags);for(const D in E.$_terms){const O=E.$_terms[D];O?T.$_terms[D]?T.$_terms[D]=T.$_terms[D].concat(O):T.$_terms[D]=O.slice():T.$_terms[D]||(T.$_terms[D]=O)}return this.$_root._tracer&&this.$_root._tracer._combine(T,[this,E]),T.$_mutateRebuild()}extend(E){return o(!E.base,"Cannot extend type with another base"),h.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,T){o(!this._inRuleset(),"Cannot fork inside a ruleset");let D=this;for(let O of[].concat(E))O=Array.isArray(O)?O:O.split("."),D=D._ids.fork(O,T,D);return D.$_temp.ruleset=!1,D}rule(E){const T=this._definition;d.assertOptions(E,Object.keys(T.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const D=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(D>=0&&DD.tailor(E),ref:!1}),T.$_temp.ruleset=!1,T.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,T){return A.entry(E,this,T)}validateAsync(E,T){return A.entryAsync(E,this,T)}$_addRule(E){typeof E=="string"&&(E={name:E}),o(E&&typeof E=="object","Invalid options"),o(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)o(I[0]!=="_","Cannot set private rule properties");const T=Object.assign({},E);T._resolve=[],T.method=T.method||T.name;const D=this._definition.rules[T.method],O=T.args;o(D,"Unknown rule",T.method);const L=this.clone();if(O){o(Object.keys(O).length===1||Object.keys(O).length===this._definition.rules[T.name].args.length,"Invalid rule definition for",this.type,T.name);for(const I in O){let F=O[I];if(D.argsByName){const U=D.argsByName.get(I);if(U.ref&&d.isResolvable(F))T._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),O[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?O[I]=F:delete O[I]}}return D.multi||(L._ruleRemove(T.name,{clone:!1}),L._singleRules.set(T.name,T)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),D.priority?L._rules.unshift(T):L._rules.push(T),L}$_compile(E,T){return m.schema(this.$_root,E,T)}$_createError(E,T,D,O,L,I={}){const F=I.flags!==!1?this._flags:{},U=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new p.Report(E,T,D,F,U,O,L)}$_getFlag(E){return this._flags[E]}$_getRule(E){return this._singleRules.get(E)}$_mapLabels(E){return E=Array.isArray(E)?E:E.split("."),this._ids.labels(E)}$_match(E,T,D,O){(D=Object.assign({},D)).abortEarly=!0,D._externals=!1,T.snapshot();const L=!A.validate(E,this,T,D,O).errors;return T.restore(),L}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:T,name:D,path:O,key:L})=>{const I=this._definition[T][D]&&this._definition[T][D].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:L})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:T,key:D}={}){this._refs.register(E,T),this._ids.register(E,{key:D})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,T,D={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const O=this._definition.flags[E]||{};if(u(T,O.default)&&(T=void 0),u(T,this._flags[E]))return this;const L=D.clone!==!1?this.clone():this;return T!==void 0?(L._flags[E]=T,L.$_mutateRegister(T)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...T){return this[E][d.symbols.parent].call(this,...T)}$_validate(E,T,D){return A.validate(E,this,T,D)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const T in this.$_terms)E.$_terms[T]=this.$_terms[T]?this.$_terms[T].slice():null;E.$_super={};for(const T in this.$_super)E.$_super[T]=this._super[T].bind(E);return E}_bare(){const E=this.clone();E._reset();const T=E._definition.terms;for(const D in T){const O=T[D];E.$_terms[D]=O.init}return E.$_mutateRebuild()}_default(E,T,D={}){return d.assertOptions(D,"literal"),o(T!==void 0,"Missing",E,"value"),o(typeof T=="function"||!D.literal,"Only function value supports literal option"),typeof T=="function"&&D.literal&&(T={[d.symbols.literal]:!0,literal:T}),this.$_setFlag(E,T)}_generate(E,T,D){if(!this.$_terms.whens)return{schema:this};const O=[],L=[];for(let U=0;Uee)break}const I=L.join(", ");if(T.mainstay.tracer.debug(T,"rule","when",I),!I)return{schema:this};if(!T.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let F=this;this._definition.generate&&(F=this._definition.generate(this,E,T,D));for(const U of O)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...O]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,T,D={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const O=this.clone();return O.$_terms[E]&&!D.override||(O.$_terms[E]=[]),D.single?O.$_terms[E].push(T):O.$_terms[E].push(...T),O.$_temp.ruleset=!1,O}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,T={}){if(!this._singleRules.has(E))return this;const D=T.clone!==!1?this.clone():this;D._singleRules.delete(E);const O=[];for(let L=0;L{const o=a(375),c=a(8571),u=a(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),o(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,d){if(l!==null&&!f.supported.has(typeof l))return;let m=this._map.get(l);if(m)return m.value=d,void this._list.first(m);m=this._list.unshift({key:l,value:d}),this._map.set(l,m),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.value)}_compact(){if(this._map.size>this._max){const l=this._list.pop();this._map.delete(l.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(l){return l.next=null,l.prev=this.head,this.head&&(this.head.next=l),this.head=l,this.tail||(this.tail=l),l}first(l){l!==this.head&&(this._remove(l),this.unshift(l))}pop(){return this._remove(this.tail)}_remove(l){const{next:d,prev:m}=l;return d.prev=m,m&&(m.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,a)=>{const o=a(375),c=a(7916),u=a(5934);let f,l;const d={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=u.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(m,p,h="Options"){o(m&&typeof m=="object"&&!Array.isArray(m),"Options must be of type object");const y=Object.keys(m).filter(g=>!p.includes(g));o(y.length===0,`${h} contain unknown keys: ${y}`)},i.checkPreferences=function(m){l=l||a(3378);const p=l.preferences.validate(m);if(p.error)throw new c([p.error.details[0].message])},i.compare=function(m,p,h){switch(h){case"=":return m===p;case">":return m>p;case"<":return m=":return m>=p;case"<=":return m<=p}},i.default=function(m,p){return m===void 0?p:m},i.isIsoDate=function(m){return d.isoDate.test(m)},i.isNumber=function(m){return typeof m=="number"&&!isNaN(m)},i.isResolvable=function(m){return!!m&&(m[i.symbols.ref]||m[i.symbols.template])},i.isSchema=function(m,p={}){const h=m&&m[i.symbols.any];return!!h&&(o(p.legacy||h.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(m){return m[i.symbols.values]},i.limit=function(m){return Number.isSafeInteger(m)&&m>=0},i.preferences=function(m,p){f=f||a(6914),m=m||{},p=p||{};const h=Object.assign({},m,p);return p.errors&&m.errors&&(h.errors=Object.assign({},m.errors,p.errors),h.errors.wrap=Object.assign({},m.errors.wrap,p.errors.wrap)),p.messages&&(h.messages=f.compile(p.messages,m.messages)),delete h[i.symbols.prefs],h},i.tryWithPath=function(m,p,h={}){try{return m()}catch(y){throw y.path!==void 0?y.path=p+"."+y.path:y.path=p,h.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(m,p,{assert:h,message:y}){if(i.isSchema(h)){const g=h.validate(m);return g.error?g.error.message:void 0}if(!h(m))return p?`${p} ${y}`:y},i.verifyFlat=function(m,p){for(const h of m)o(!Array.isArray(h),"Method no longer accepts array arguments:",p)}},3292:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.schema=function(l,d,m={}){c.assertOptions(m,["appendPath","override"]);try{return f.schema(l,d,m)}catch(p){throw m.appendPath&&p.path!==void 0&&(p.message=`${p.message} (${p.path})`),p}},f.schema=function(l,d,m){o(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(o(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const p=(h,...y)=>m.override!==!1?h.valid(l.override,...y):h.valid(...y);if(f.simple(d))return p(l,d);if(typeof d=="function")return l.custom(d);if(o(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return p(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const h of d)if(!f.simple(h))return l.alternatives().try(...d);return p(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?p(l.date(),d):(o(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,m={}){c.assertOptions(m,["legacy"]);const p=d&&d[c.symbols.any];if(p)return o(m.legacy||p.version===c.version,"Cannot mix different versions of joi schemas:",p.version,c.version),d;if(typeof d!="object"||!m.legacy)return i.schema(l,d,{appendPath:!0});const h=f.walk(d);return h?h.compile(h.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const m of l){const p=f.walk(m);if(p)return p}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};o(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const m in l){const p=f.walk(l[m]);if(p)return p}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,m){if(m===void 0&&(o(d&&typeof d=="object","Missing options"),m=d,d=u.create(".")),Array.isArray(m)&&(m={switch:m}),c.assertOptions(m,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return o(m.is===void 0,'"is" can not be used with a schema condition'),o(m.not===void 0,'"not" can not be used with a schema condition'),o(m.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:m.then,otherwise:m.otherwise,break:m.break});if(o(u.isRef(d)||typeof d=="string","Invalid condition:",d),o(m.not===void 0||m.is===void 0,'Cannot combine "is" with "not"'),m.switch===void 0){let h=m;m.not!==void 0&&(h={is:m.not,then:m.otherwise,otherwise:m.then,break:m.break});let y=h.is!==void 0?l.$_compile(h.is):l.$_root.invalid(null,!1,0,"").required();return o(h.then!==void 0||h.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(h.break===void 0||h.then===void 0||h.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),m.is===void 0||u.isRef(m.is)||c.isSchema(m.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:h.then,otherwise:h.otherwise,break:h.break})}o(Array.isArray(m.switch),'"switch" must be an array'),o(m.is===void 0,'Cannot combine "switch" with "is"'),o(m.not===void 0,'Cannot combine "switch" with "not"'),o(m.then===void 0,'Cannot combine "switch" with "then"');const p={ref:i.ref(d),switch:[],break:m.break};for(let h=0;h{const o=a(5688),c=a(8160),u=a(3328);i.Report=class{constructor(f,l,d,m,p,h,y){if(this.code=f,this.flags=m,this.messages=p,this.path=h.path,this.prefs=y,this.state=h,this.value=l,this.message=null,this.template=null,this.local=d||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const g=this.path[this.path.length-1];typeof g!="object"&&(this.local.key=g)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const l=this._template(this.template,"root");l&&(this.local.label=l)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const l=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return l===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=l.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,l){return i.template(this.value,f,l||this.code,this.state,this.prefs)}},i.path=function(f){let l="";for(const d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,m,p){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let h=p.errors.language;if(c.isResolvable(h)&&(h=h.resolve(f,m,p)),h&&l[h]){if(l[h][d]!==void 0)return l[h][d];if(l[h]["*"]!==void 0)return l[h]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,m){if(!d.errors.label)return"";if(f.label)return f.label;let p=l.path;return d.errors.label==="key"&&l.path.length>1&&(p=l.path.slice(-1)),i.path(p)||i.template(null,d.messages,"root",l,d)||m&&i.template(null,m,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:m,message:p,details:h}=i.details(f);if(m)return m;if(d.errors.stack)return new i.ValidationError(p,h,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(p,h,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const m=[];for(const p of f){if(p instanceof Error){if(l.override!==!1)return{override:p};const y=p.toString();d.push(y),m.push({message:y,type:"override",context:{error:p}});continue}const h=p.toString();d.push(h),m.push({message:h,path:p.path.filter(y=>typeof y!="object"),type:p.code,context:p.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:m}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,this.details=l}static isError(f){return f instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=o.error},8901:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8160),f=a(6914),l={};i.type=function(d,m){const p=Object.getPrototypeOf(d),h=c(p),y=d._assign(Object.create(h)),g=Object.assign({},m);delete g.base,h._definition=g;const v=p._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const w=Object.assign({},v.terms);if(g.terms)for(const R in g.terms){const E=g.terms[R];o(y.$_terms[R]===void 0,"Invalid term override for",g.type,R),y.$_terms[R]=E.init,w[R]=E}g.terms=w,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const x=Object.assign({},v.rules);if(g.rules)for(const R in g.rules){const E=g.rules[R];o(typeof E=="object","Invalid rule definition for",g.type,R);let T=E.method;if(T===void 0&&(T=function(){return this.$_addRule(R)}),T&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=T),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const D=[].concat(E.alias);for(const O of D)h[O]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(D=>(typeof D=="string"&&(D={name:D}),o(!E.argsByName.has(D.name),"Duplicated argument name",D.name),u.isSchema(D.assert)&&(D.assert=D.assert.strict().label(D.name)),E.argsByName.set(D.name,D),D)))}g.rules=x;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const R in g.modifiers){o(!h[R],"Rule conflict in",g.type,R);const E=g.modifiers[R];o(typeof E=="function","Invalid modifier definition for",g.type,R);const T=function(D){return this.rule({[R]:D})};h[R]=T,A[R]=E}if(g.modifiers=A,g.overrides){h._super=p,y.$_super={};for(const R in g.overrides)o(p[R],"Cannot override missing",R),g.overrides[R][u.symbols.parent]=p[R],y.$_super[R]=p[R].bind(y);Object.assign(h,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const k=Object.assign({},v.manifest,g.manifest);return k.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=k,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,m){return d&&m?function(p,h){return m(d(p,h),h)}:d||m},l.coerce=function(d,m){return d&&m?{from:d.from&&m.from?[...new Set([...d.from,...m.from])]:null,method(p,h){let y;if((!m.from||m.from.includes(typeof p))&&(y=m.method(p,h),y)){if(y.errors||y.value===void 0)return y;p=y.value}if(!d.from||d.from.includes(typeof p)){const g=d.method(p,h);if(g)return g}return y}}:d||m},l.prepare=function(d,m){return d&&m?function(p,h){const y=d(p,h);if(y){if(y.errors||y.value===void 0)return y;p=y.value}return m(p,h)||y}:d||m},l.rebuild=function(d,m){return d&&m?function(p){m(p),d(p)}:d||m},l.validate=function(d,m){return d&&m?function(p,h){const y=m(p,h);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;p=y.value}return d(p,h)||y}:d||m}},5107:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8652),f=a(8160),l=a(3292),d=a(6354),m=a(8901),p=a(9708),h=a(6133),y=a(3328),g=a(1152);let v;const w={types:{alternatives:a(4946),any:a(8068),array:a(546),boolean:a(4937),date:a(7500),function:a(390),link:a(8785),number:a(3832),object:a(8966),string:a(7417),symbol:a(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const x={_types:new Set(Object.keys(w.types))};for(const A of x._types)x[A]=function(...k){return o(!k.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],k)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...k){return this.any()[A](...k)};Object.assign(x,w.methods);for(const A in w.aliases){const k=w.aliases[A];x[A]=x[k]}return x.x=x.expression,g.setup&&g.setup(x),x}};w.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(x,A,...k){w.assert(x,A,!0,k)},attempt:(x,A,...k)=>w.assert(x,A,!1,k),build(x){return o(typeof p.build=="function","Manifest functionality disabled"),p.build(this,x)},checkPreferences(x){f.checkPreferences(x)},compile(x,A){return l.compile(this,x,A)},defaults(x){o(typeof x=="function","modifier must be a function");const A=Object.assign({},this);for(const k of A._types){const R=x(A[k]());o(f.isSchema(R),"modifier must return a valid schema object"),A[k]=function(...E){return w.generate(this,R,E)}}return A},expression:(...x)=>new y(...x),extend(...x){f.verifyFlat(x,"extend"),v=v||a(3378),o(x.length,"You need to provide at least one extension"),this.assert(x,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let k of x){typeof k=="function"&&(k=k(A)),this.assert(k,v.extension);const R=w.expandExtension(k,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const T=E.base||this.any(),D=m.type(T,E);A._types.add(E.type),A[E.type]=function(...O){return w.generate(this,D,O)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:h.isRef,isSchema:f.isSchema,in:(...x)=>h.in(...x),override:f.symbols.override,ref:(...x)=>h.create(...x),types(){const x={};for(const A of this._types)x[A]=this[A]();for(const A in w.aliases)x[A]=this[A]();return x}},w.assert=function(x,A,k,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,T=E!==null?R[1]:R[0],D=A.validate(x,f.preferences({errors:{stack:!0}},T||{}));let O=D.error;if(!O)return D.value;if(E instanceof Error)throw E;const L=k&&typeof O.annotate=="function"?O.annotate():O.message;throw O instanceof d.ValidationError==0&&(O=c(O)),O.message=E?`${E} ${L}`:L,O},w.generate=function(x,A,k){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&k.length?A._definition.args(A,...k):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const k=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),k.push(E)}return k},s.exports=w.root()},6914:(s,i,a)=>{const o=a(375),c=a(8571),u=a(3328);i.compile=function(f,l){if(typeof f=="string")return o(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return o(!l,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const m=f[d];if(d==="root"||u.isTemplate(m)){l[d]=m;continue}if(typeof m=="string"){l[d]=new u(m);continue}o(typeof m=="object"&&!Array.isArray(m),"Invalid message for",d);const p=d;for(d in l[p]=l[p]||{},m){const h=m[d];d==="root"||u.isTemplate(h)?l[p][d]=h:(o(typeof h=="string","Invalid message for",d,"in",p),l[p][d]=new u(h))}}return l},i.decompile=function(f){const l={};for(let d in f){const m=f[d];if(d==="root"){l.root=m;continue}if(u.isTemplate(m)){l[d]=m.describe({compact:!0});continue}const p=d;for(d in l[p]={},m){const h=m[d];d!=="root"?l[p][d]=h.describe({compact:!0}):l[p].root=h}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let m in l){const p=l[m];if(m==="root"||u.isTemplate(p)){d[m]=p;continue}if(typeof p=="string"){d[m]=new u(p);continue}o(typeof p=="object"&&!Array.isArray(p),"Invalid message for",m);const h=m;for(m in d[h]=d[h]||{},p){const y=p[m];m==="root"||u.isTemplate(y)?d[h][m]=y:(o(typeof y=="string","Invalid message for",m,"in",h),d[h][m]=new u(y))}}return d}},2294:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[d,m]of l._byId.entries())o(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,m);for(const[d,m]of l._byKey.entries())o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,m)}fork(l,d,m){const p=this._collect(l);p.push({schema:m});const h=p.shift();let y={id:h.id,schema:d(h.schema)};o(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of p)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const m=l[0],p=this._get(m);if(!p)return[...d,...l].join(".");const h=l.slice(1);return d=[...d,p.schema._flags.label||m],h.length?p.schema._ids.labels(h,d):d.join(".")}reach(l,d=[]){const m=l[0],p=this._get(m);o(p,"Schema does not contain path",[...d,...l].join("."));const h=l.slice(1);return h.length?p.schema._ids.reach(h,[...d,m]):p.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const m=l._flags.id;if(m){const p=this._byId.get(m);o(!p||p.schema===l,"Cannot add different schemas with the same id:",m),o(!this._byKey.has(m),"Schema id conflicts with existing key:",m),this._byId.set(m,{schema:l,id:m})}d&&(o(!this._byKey.has(d),"Schema already contains key:",d),o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],m=[]){const p=l[0],h=this._get(p);o(h,"Schema does not contain path",[...d,...l].join(".")),m=[h,...m];const y=l.slice(1);return y.length?h.schema._ids._collect(y,[...d,p],m):m}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,m){const p=i.schema(l,{each:(h,{key:y})=>{if(d===(h._flags.id||y))return m},ref:!1});return p?p.$_mutateRebuild():l},i.schema=function(l,d){let m;for(const p in l._flags){if(p[0]==="_")continue;const h=f.scan(l._flags[p],{source:"flags",name:p},d);h!==void 0&&(m=m||l.clone(),m._flags[p]=h)}for(let p=0;p{const o=a(375),c=a(8571),u=a(9621),f=a(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(m,p={}){o(typeof m=="string","Invalid reference key:",m),f.assertOptions(p,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!p.prefix||typeof p.prefix=="object","options.prefix must be of type object");const h=Object.assign({},d.defaults,p);delete h.prefix;const y=h.separator,g=d.context(m,y,p.prefix);if(h.type=g.type,m=g.key,h.type==="value")if(g.root&&(o(!y||m[0]!==y,"Cannot specify relative path with root prefix"),h.ancestor="root",m||(m=null)),y&&y===m)m=null,h.ancestor=0;else if(h.ancestor!==void 0)o(!y||!m||m[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,w]=d.ancestor(m,y);w&&(m=m.slice(w))===""&&(m=null),h.ancestor=v}return h.path=y?m===null?[]:m.split(y):[m],new d.Ref(h)},i.in=function(m,p={}){return i.create(m,{...p,in:!0})},i.isRef=function(m){return!!m&&!!m[f.symbols.ref]},d.Ref=class{constructor(m){o(typeof m=="object","Invalid reference construction"),f.assertOptions(m,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(m.separator)||typeof m.separator=="string"&&m.separator.length===1,"Invalid separator"),o(!m.adjust||typeof m.adjust=="function","options.adjust must be a function"),o(!m.map||Array.isArray(m.map),"options.map must be an array"),o(!m.map||!m.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,m),o(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(m,p,h,y,g={}){return o(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(h.context,p,g):this.type==="local"?this._resolve(y,p,g):this.ancestor?this.ancestor==="root"?this._resolve(p.ancestors[p.ancestors.length-1],p,g):(o(this.ancestor<=p.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(p.ancestors[this.ancestor-1],p,g)):this._resolve(m,p,g)}_resolve(m,p,h){let y;if(this.type==="value"&&p.mainstay.shadow&&h.shadow!==!1&&(y=p.mainstay.shadow.get(this.absolute(p))),y===void 0&&(y=u(m,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return p.mainstay&&p.mainstay.tracer.resolve(p,this,y),y}toString(){return this.display}absolute(m){return[...m.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const m={path:this.path};this.type!=="value"&&(m.type=this.type),this.separator!=="."&&(m.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(m.ancestor=this.ancestor),this.map&&(m.map=[...this.map]);for(const p of["adjust","iterables","render"])this[p]!==null&&this[p]!==void 0&&(m[p]=this[p]);return this.in!==!1&&(m.in=!0),{ref:m}}updateDisplay(){const m=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${m}`);if(!this.separator)return void(this.display=`ref:${m}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${m}`);if(this.ancestor==="root")return void(this.display=`ref:root:${m}`);if(this.ancestor===1)return void(this.display=`ref:${m||".."}`);const p=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${p}${m||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(m){return(m=Object.assign({},d.defaults,m)).type==="value"&&m.ancestor===void 0&&(m.ancestor=1),new d.Ref(m)},d.context=function(m,p,h={}){if(m=m.trim(),h){const y=h.global===void 0?"$":h.global;if(y!==p&&m.startsWith(y))return{key:m.slice(y.length),type:"global"};const g=h.local===void 0?"#":h.local;if(g!==p&&m.startsWith(g))return{key:m.slice(g.length),type:"local"};const v=h.root===void 0?"/":h.root;if(v!==p&&m.startsWith(v))return{key:m.slice(v.length),type:"value",root:!0}}return{key:m,type:"value"}},d.ancestor=function(m,p){if(!p)return[1,0];if(m[0]!==p)return[1,0];if(m[1]!==p)return[0,1];let h=2;for(;m[h]===p;)++h;return[h-1,h]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(m,p){if(m)if(p=p===void 0?i.toParent:p,Array.isArray(m))for(const h of m)this.register(h,p);else if(f.isSchema(m))for(const h of m._refs.refs)h.ancestor-p>=0&&this.refs.push({ancestor:h.ancestor-p,root:h.root});else i.isRef(m)&&m.type==="value"&&m.ancestor-p>=0&&this.refs.push({ancestor:m.ancestor-p,root:m.root}),l=l||a(3328),l.isTemplate(m)&&this.register(m.refs(),p)}get length(){return this.refs.length}clone(){const m=new i.Manager;return m.refs=c(this.refs),m}reset(){this.refs=[]}roots(){return this.refs.filter(m=>!m.ancestor).map(m=>m.root)}}},3378:(s,i,a)=>{const o=a(5107),c={};c.wrap=o.string().min(1).max(2).allow(!1),i.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=o.object({alias:o.array().items(o.string().pattern(c.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(c.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),i.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(c.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(c.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(c.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(c.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(c.nameRx,c.rule),terms:o.object().pattern(c.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),i.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),c.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},c.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,o.link("/")]),c.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=o.object().pattern(/.+/,[o.string(),c.desc.template,o.object().pattern(/.+/,[o.string(),c.desc.template])]),i.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:c.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:o.boolean(),messages:c.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),c.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(s,i,a)=>{const o=a(8571),c=a(9621),u=a(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,m){this.path=l,this.ancestors=d,this.mainstay=m.mainstay,this.schemas=m.schemas,this.debug=null}localize(l,d=null,m=null){const p=new f.State(l,d,this);return m&&p.schemas&&(p.schemas=[f.schemas(m),...p.schemas]),p}nest(l,d){const m=new f.State(this.path,this.ancestors,this);return m.schemas=m.schemas&&[f.schemas(l),...m.schemas],m.debug=d,m}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,m){if(!l.length||m==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let p=this._values;for(let h=0;h{const o=a(375),c=a(8571),u=a(5277),f=a(1447),l=a(8160),d=a(6354),m=a(6133),p={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=p.Template=class{constructor(h,y){if(o(typeof h=="string","Template source must be a string"),o(!h.includes("\0")&&!h.includes(""),"Template source cannot contain reserved control characters"),this.source=h,this.rendered=h,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(o(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const h=p.encode(this.source),y=p.split(h);let g=!1;const v=[],w=y.shift();w&&v.push(w);for(const x of y){const A=x[0]!=="{",k=A?"}":"}}",R=x.indexOf(k);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const T=E[0]===":";T&&(E=E.slice(1));const D=this._ref(p.decode(E),{raw:A,wrapped:T});v.push(D),typeof D!="string"&&(g=!0);const O=x.slice(R+k.length);O&&v.push(p.decode(O))}g?this._template=v:this.rendered=v.join("")}static date(h,y){return p.dateFormat[y.dateFormat].call(h)}describe(h={}){if(!this._settings&&h.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(h){return new p.Template(h.template,h.options||h.functions?{...h.options,functions:h.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(h){return!!h&&!!h[l.symbols.template]}refs(){if(!this._template)return;const h=[];for(const y of this._template)typeof y!="string"&&h.push(...y.refs);return h}resolve(h,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],h,y,g,v,{}):this.render(h,y,g,v)}_part(h,...y){return h.ref?h.ref.resolve(...y):h.formula.evaluate(y)}render(h,y,g,v,w={}){if(!this.isDynamic())return this.rendered;const x=[];for(const A of this._template)if(typeof A=="string")x.push(A);else{const k=this._part(A,h,y,g,v,w),R=p.stringify(k,h,y,g,v,w);if(R!==void 0){const E=A.raw||(w.errors&&w.errors.escapeHtml)===!1?R:u(R);x.push(p.wrap(E,A.wrapped&&g.errors.wrap.label))}}return x.join("")}_ref(h,{raw:y,wrapped:g}){const v=[],w=A=>{const k=m.create(A,this._settings);return v.push(k),R=>{const E=k.resolve(...R);return E!==void 0?E:null}};try{const A=this._functions?{...p.functions,...this._functions}:p.functions;var x=new f.Parser(h,{reference:w,functions:A,constants:p.constants})}catch(A){throw A.message=`Invalid template variable "${h}" fails due to: ${A.message}`,A}if(x.single){if(x.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return p.stringify(x.single.value)}return{formula:x,raw:y,refs:v}}toString(){return this.source}},p.Template.prototype[l.symbols.template]=!0,p.Template.prototype.isImmutable=!0,p.encode=function(h){return h.replace(/\\(\{+)/g,(y,g)=>p.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>p.closes.slice(0,g.length))},p.decode=function(h){return h.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},p.split=function(h){const y=[];let g="";for(let v=0;v ${O.toString()}`);h=T}if(!Array.isArray(h))return h.toString();const E=[];for(const T of h)E.push(p.stringify(T,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&k.array)},p.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},p.functions={if:(h,y,g)=>h?y:g,length:h=>typeof h=="string"?h.length:h&&typeof h=="object"?Array.isArray(h)?h.length:Object.keys(h).length:null,msg(h){const[y,g,v,w,x]=this,A=x.messages;if(!A)return"";const k=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return k?k.render(y,g,v,w,x):""},number:h=>typeof h=="number"?h:typeof h=="string"?parseFloat(h):typeof h=="boolean"?h?1:0:h instanceof Date?h.getTime():null}},4946:(s,i,a)=>{const o=a(375),c=a(1687),u=a(8068),f=a(8160),l=a(3292),d=a(6354),m=a(6133),p={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:m.toSibling}},args:(h,...y)=>y.length===1&&Array.isArray(y[0])?h.try(...y[0]):h.try(...y),validate(h,y){const{schema:g,error:v,state:w,prefs:x}=y;if(g._flags.match){const k=[],R=[];for(let T=0;Td.details(T,{override:!1}))})};if(g._flags.match==="one")return k.length===1?{value:k[0]}:{errors:v("alternatives.one")};if(k.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(T=>d.details(T,{override:!1}))})};const E=T=>T.$_terms.matches.some(D=>D.schema.type==="object"||D.schema.type==="alternatives"&&E(D.schema));return E(g)?{value:k.reduce((T,D)=>c(T,D,{mergeArrays:!1}))}:{value:k[k.length-1]}}const A=[];for(let k=0;kg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(h):void 0,ref:!1})}},rebuild(h){h.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&h.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(h,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:w,is:x,not:A,then:k,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:k,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:k,otherwise:R})}return h}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),p.errors=function(h,{error:y,state:g}){if(!h.length)return{errors:y("alternatives.any")};if(h.length===1)return{errors:h[0].reports};const v=new Set,w=[];for(const{reports:x,schema:A}of h){if(x.length>1)return p.unmatched(h,y);const k=x[0];if(k instanceof d.Report==0)return p.unmatched(h,y);if(k.state.path.length!==g.path.length){w.push({type:A.type,report:k});continue}if(k.code==="any.only"){for(const T of k.local.valids)v.add(T);continue}const[R,E]=k.code.split(".");E!=="base"?w.push({type:A.type,report:k}):k.code==="object.base"?v.add(k.local.type):v.add(R)}return w.length?w.length===1?{errors:w[0].report}:p.unmatched(h,y):{errors:y("alternatives.types",{types:[...v]})}},p.unmatched=function(h,y){const g=[];for(const v of h)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,a)=>{const o=a(375),c=a(7629),u=a(8160),f=a(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,d){return o(typeof l=="function","Method must be a function"),o(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:m}){try{return m(l,d)}catch(p){return d.error("any.custom",{error:p})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){o(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return o(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:m,local:p})=>d.error(m,p),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const m in d){const p=d[m];if(["examples","externals","metas","notes","tags"].includes(m))for(const h of p)l=l[m.slice(0,-1)](h);else if(m!=="alterations")if(m!=="whens"){if(m==="shared")for(const h of p)l=l.shared(h)}else for(const h of p){const{ref:y,is:g,not:v,then:w,otherwise:x,concat:A}=h;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:w,otherwise:x,switch:h.switch,break:h.break}):l.when(g,{then:w,otherwise:x,break:h.break})}else{const h={};for(const{target:y,adjuster:g}of p)h[y]=g;l=l.alter(h)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,a)=>{const o=a(375),c=a(9474),u=a(9621),f=a(8068),l=a(8160),d=a(3292),m={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(p,{schema:h,state:y,prefs:g}){if(!Array.isArray(p))return;const v=h.$_getRule("sort");return v?m.sort(h,p,v.args.options,y,g):void 0}},validate(p,{schema:h,error:y}){if(!Array.isArray(p)){if(h._flags.single){const g=[p];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(h.$_getRule("items")||h.$_terms.externals)return{value:p.slice()}},rules:{has:{method(p){p=this.$_compile(p,{appendPath:!0});const h=this.$_addRule({name:"has",args:{schema:p}});return h.$_mutateRegister(p),h},validate(p,{state:h,prefs:y,error:g},{schema:v}){const w=[p,...h.ancestors];for(let A=0;Athis.$_compile(p[y]),y,{append:!0});h.$_terms.items.push(g)}return h.$_mutateRebuild()},validate(p,{schema:h,error:y,state:g,prefs:v,errorsArray:w}){const x=h.$_terms._requireds.slice(),A=h.$_terms.ordered.slice(),k=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let T=p.length;for(let D=0;D="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;ythis.$_compile(p[y]),y,{append:!0});m.validateSingle(g,h),h.$_mutateRegister(g),h.$_terms.ordered.push(g)}return h.$_mutateRebuild()}},single:{method(p){const h=p===void 0||!!p;return o(!h||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",h)}},sort:{method(p={}){l.assertOptions(p,["by","order"]);const h={order:p.order||"ascending"};return p.by&&(h.by=d.ref(p.by,{ancestor:0}),o(!h.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:h}})},validate(p,{error:h,state:y,prefs:g,schema:v},{options:w}){const{value:x,errors:A}=m.sort(v,p,w,y,g);if(A)return A;for(let k=0;knew Set(p)}},rebuild(p){p.$_terms._inclusions=[],p.$_terms._exclusions=[],p.$_terms._requireds=[];for(const h of p.$_terms.items)m.validateSingle(h,p),h._flags.presence==="required"?p.$_terms._requireds.push(h):h._flags.presence==="forbidden"?p.$_terms._exclusions.push(h):p.$_terms._inclusions.push(h);for(const h of p.$_terms.ordered)m.validateSingle(h,p)},manifest:{build:(p,h)=>(h.items&&(p=p.items(...h.items)),h.ordered&&(p=p.ordered(...h.ordered)),p)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),m.fillMissedErrors=function(p,h,y,g,v,w){const x=[];let A=0;for(const k of y){const R=k._flags.label;R?x.push(R):++A}x.length?A?h.push(p.$_createError("array.includesRequiredBoth",g,{knownMisses:x,unknownMisses:A},v,w)):h.push(p.$_createError("array.includesRequiredKnowns",g,{knownMisses:x},v,w)):h.push(p.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,w))},m.fillOrderedErrors=function(p,h,y,g,v,w){const x=[];for(const A of y)A._flags.presence==="required"&&x.push(A);x.length&&m.fillMissedErrors(p,h,x,g,v,w)},m.fillDefault=function(p,h,y,g){const v=[];let w=!0;for(let x=p.length-1;x>=0;--x){const A=p[x],k=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,k,A),g).value;if(w){if(R===void 0)continue;w=!1}v.unshift(R)}v.length&&h.push(...v)},m.fastSplice=function(p,h){let y=h;for(;y{let T=m.compare(R,E,x,A);if(T!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),T=m.compare(R,E,x,A),T!==null))return T;const D=typeof R;if(D!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(D!=="number"&&D!=="string")throw p.$_createError("array.sort.unsupported",h,{type:D},g,v);return D==="number"?(R-E)*w:R{const o=a(375),c=a(8068),u=a(8160),f=a(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:m}){if(typeof d!="boolean"){if(typeof d=="string"){const p=m._flags.sensitive?d:d.toLowerCase();d=p==="true"||p!=="false"&&d}return typeof d!="boolean"&&(d=m.$_terms.truthy&&m.$_terms.truthy.has(d,null,null,!m._flags.sensitive)||(!m.$_terms.falsy||!m.$_terms.falsy.has(d,null,null,!m._flags.sensitive))&&d),{value:d}}},validate(d,{error:m}){if(typeof d!="boolean")return{value:d,errors:m("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const m=this.clone();m.$_terms.truthy=m.$_terms.truthy||new f;for(let p=0;pd?1:0},string:{from:l.isBool,to:(d,m)=>d?"true":"false"}},manifest:{build:(d,m)=>(m.truthy&&(d=d.truthy(...m.truthy)),m.falsy&&(d=d.falsy(...m.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f=a(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:m})=>({value:l.parse(d,m._flags.format)||d})},validate(d,{schema:m,error:p,prefs:h}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=m._flags.format;return h.convert&&y&&typeof d=="string"?{value:d,errors:p("date.format",{format:y})}:{value:d,errors:p("date.base")}},rules:{compare:{method:!1,validate(d,m,{date:p},{name:h,operator:y,args:g}){const v=p==="now"?Date.now():p.getTime();return u.compare(d.getTime(),v,y)?d:m.error("date."+h,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return o(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return o(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,m)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:m})=>f.date(d,m)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(d,m){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(m==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const p=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),m){if(m==="javascript")return l.date(1*d);if(m==="unix")return l.date(1e3*d);if(typeof p=="string")return null}return l.date(d)},l.date=function(d){const m=new Date(d);return isNaN(m.getTime())?null:m}},390:(s,i,a)=>{const o=a(375),c=a(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return o(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u:f.error("function.maxArity",{n:l})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,a)=>{const o=a(978),c=a(375),u=a(8571),f=a(3652),l=a(8068),d=a(8160),m=a(3292),p=a(6354),h=a(6133),y=a(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,w)=>v.keys(w),validate(v,{schema:w,error:x,state:A,prefs:k}){if(!v||typeof v!==w.$_property("typeof")||Array.isArray(v))return{value:v,errors:x("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;v=g.clone(v,k);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,k,R))return{value:v,errors:R};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:v,errors:R};const E=new Set(Object.keys(v));if(w.$_terms.keys){const T=[v,...A.ancestors];for(const D of w.$_terms.keys){const O=D.key,L=v[O];E.delete(O);const I=A.localize([...A.path,O],T,D),F=D.schema.$_validate(L,I,k);if(F.errors){if(k.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[O]=F.value),R.push(...F.errors)}else D.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[O]:F.value!==void 0&&(v[O]=F.value)}}if(E.size||w._flags._hasPatternMatch){const T=g.unknown(w,v,E,R,A,k);if(T)return T}if(w.$_terms.dependencies)for(const T of w.$_terms.dependencies){if(T.key!==null&&g.isPresent(T.options)(T.key.resolve(v,A,k,null,{shadow:!1}))===!1)continue;const D=g.dependencies[T.rel](w,T,v,A,k);if(D){const O=w.$_createError(D.code,v,D.context,A,k);if(k.abortEarly)return{value:v,errors:O};R.push(O)}}return{value:v,errors:R}},rules:{and:{method(...v){return d.verifyFlat(v,"and"),g.dependency(this,"and",null,v)}},append:{method(v){return v==null||Object.keys(v).length===0?this:this.keys(v)}},assert:{method(v,w,x){y.isTemplate(v)||(v=m.ref(v)),c(x===void 0||typeof x=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:w,message:x}});return A.$_mutateRegister(v),A.$_mutateRegister(w),A},validate(v,{error:w,prefs:x,state:A},{subject:k,schema:R,message:E}){const T=k.resolve(v,A,x),D=h.isRef(k)?k.absolute(A):[];return R.$_match(T,A.localize(D,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:k,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,w){return c(typeof v=="function","constructor must be a function"),w=w||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:w}})},validate:(v,w,{constructor:x,name:A})=>v instanceof x?v:w.error("object.instance",{type:A,value:v}),args:["constructor","name"]},keys:{method(v){c(v===void 0||typeof v=="object","Object schema must be a valid object"),c(!d.isSchema(v),"Object schema cannot be a joi schema");const w=this.clone();if(v)if(Object.keys(v).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(x=>!v.hasOwnProperty(x.key)):new g.Keys;for(const x in v)d.tryWithPath(()=>w.$_terms.keys.push({key:x,schema:this.$_compile(v[x])}),x)}else w.$_terms.keys=new g.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,w,{limit:x},{name:A,operator:k,args:R})=>d.compare(Object.keys(v).length,x,k)?v:w.error("object."+A,{limit:R.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},nand:{method(...v){return d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,w,x={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(w!==void 0,"Invalid rule"),d.assertOptions(x,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const k=this.clone();k.$_terms.patterns=k.$_terms.patterns||[];const R={[A?"regex":"schema"]:v,rule:w};return x.matches&&(R.matches=this.$_compile(x.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),k.$_mutateRegister(R.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),k.$_terms.patterns.push(R),k.$_mutateRegister(w),k}},ref:{method(){return this.$_addRule("ref")},validate:(v,w)=>h.isRef(v)?v:w.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,w)=>v instanceof RegExp?v:w.error("object.regex",{value:v})},rename:{method(v,w,x={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof y,"Invalid rename to argument"),c(w!==v,"Cannot rename key to same name:",v),d.assertOptions(x,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const k of A.$_terms.renames)c(k.from!==v,"Cannot rename the same key multiple times");return w instanceof y&&A.$_mutateRegister(w),A.$_terms.renames.push({from:v,to:w,options:o(g.renameDefaults,x)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,w,{type:x})=>!d.isSchema(v)||x!=="any"&&v.type!==x?w.error("object.schema",{type:x}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,w,x={}){return g.dependency(this,"with",v,w,x)}},without:{method(v,w,x={}){return g.dependency(this,"without",v,w,x)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,w){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,w)}},rebuild(v){if(v.$_terms.keys){const w=new f.Sorter;for(const x of v.$_terms.keys)d.tryWithPath(()=>w.add(x,{after:x.schema.$_rootReferences(),group:x.key}),x.key);v.$_terms.keys=new g.Keys(...w.nodes)}},manifest:{build(v,w){if(w.keys&&(v=v.keys(w.keys)),w.dependencies)for(const{rel:x,key:A=null,peers:k,options:R}of w.dependencies)v=g.dependency(v,x,A,k,R);if(w.patterns)for(const{regex:x,schema:A,rule:k,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,k,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:k}of w.renames)v=v.rename(x,A,k);return v}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),g.clone=function(v,w){if(typeof v=="object"){if(w.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const x=function(...A){return v.apply(this,A)};return x.prototype=u(v.prototype),Object.defineProperty(x,"name",{value:v.name,writable:!1}),Object.defineProperty(x,"length",{value:v.length,writable:!1}),Object.assign(x,v),x},g.dependency=function(v,w,x,A,k){c(x===null||typeof x=="string",w,"key must be a strings"),k||(k=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(k,["separator","isPresent"]),A=[].concat(A);const R=d.default(k.separator,"."),E=[];for(const D of A)c(typeof D=="string",w,"peers must be strings"),E.push(m.ref(D,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const T=v.clone();return T.$_terms.dependencies=T.$_terms.dependencies||[],T.$_terms.dependencies.push(new g.Dependency(w,x,E,A,k)),T},g.dependencies={and(v,w,x,A,k){const R=[],E=[],T=w.peers.length,D=g.isPresent(w.options);for(const O of w.peers)D(O.resolve(x,A,k,null,{shadow:!1}))===!1?R.push(O.key):E.push(O.key);if(R.length!==T&&E.length!==T)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const O of w.peers)E(O.resolve(x,A,k,null,{shadow:!1}))&&R.push(O.key);if(R.length!==w.peers.length)return;const T=w.paths[0],D=w.paths.slice(1);return{code:"object.nand",context:{main:T,mainWithLabel:g.keysToLabels(v,T),peers:D,peersWithLabels:g.keysToLabels(v,D)}}},or(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(!R.length||R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:T}},with(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:T}:(T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:T})}},g.keysToLabels=function(v,w){return Array.isArray(w)?w.map(x=>v.$_mapLabels(x)):v.$_mapLabels(w)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:w=>w!==void 0},g.rename=function(v,w,x,A,k){const R={};for(const E of v.$_terms.renames){const T=[],D=typeof E.from!="string";if(D)for(const O in w){if(w[O]===void 0&&E.options.ignoreUndefined||O===E.to)continue;const L=E.from.exec(O);L&&T.push({from:O,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||T.push(E);for(const O of T){const L=O.from;let I=O.to;if(I instanceof y&&(I=I.render(w,x,A,O.match)),L!==I){if(!E.options.multiple&&R[I]&&(k.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(k.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly))return!1;w[L]===void 0?delete w[I]:w[I]=w[L],R[I]=!0,E.options.alias||delete w[L]}}}return!0},g.unknown=function(v,w,x,A,k,R){if(v.$_terms.patterns){let E=!1;const T=v.$_terms.patterns.map(O=>{if(O.matches)return E=!0,[]}),D=[w,...k.ancestors];for(const O of x){const L=w[O],I=[...k.path,O];for(let F=0;F{const o=a(375),c=a(8068),u=a(8160),f=a(3292),l=a(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(m,p)=>m.ref(p),validate(m,{schema:p,state:h,prefs:y}){o(p.$_terms.link,"Uninitialized link schema");const g=d.generate(p,m,h,y),v=p.$_terms.link[0].ref;return g.$_validate(m,h.nest(g,`link:${v.display}:${g.type}`),y)},generate:(m,p,h,y)=>d.generate(m,p,h,y),rules:{ref:{method(m){o(!this.$_terms.link,"Cannot reinitialize schema"),m=f.ref(m),o(m.type==="value"||m.type==="local","Invalid reference type:",m.type),o(m.type==="local"||m.ancestor==="root"||m.ancestor>0,"Link cannot reference itself");const p=this.clone();return p.$_terms.link=[{ref:m}],p}},relative:{method(m=!0){return this.$_setFlag("relative",m)}}},overrides:{concat(m){o(this.$_terms.link,"Uninitialized link schema"),o(u.isSchema(m),"Invalid schema object"),o(m.type!=="link","Cannot merge type link with another link");const p=this.clone();return p.$_terms.whens||(p.$_terms.whens=[]),p.$_terms.whens.push({concat:m}),p.$_mutateRebuild()}},manifest:{build:(m,p)=>(o(p.link,"Invalid link description missing link"),m.ref(p.link))}}),d.generate=function(m,p,h,y){let g=h.mainstay.links.get(m);if(g)return g._generate(p,h,y).schema;const v=m.$_terms.link[0].ref,{perspective:w,path:x}=d.perspective(v,h);d.assert(w,"which is outside of schema boundaries",v,m,h,y);try{g=x.length?w.$_reach(x):w}catch{d.assert(!1,"to non-existing schema",v,m,h,y)}return d.assert(g.type!=="link","which is another link",v,m,h,y),m._flags.relative||h.mainstay.links.set(m,g),g._generate(p,h,y).schema},d.perspective=function(m,p){if(m.type==="local"){for(const{schema:h,key:y}of p.schemas){if((h._flags.id||y)===m.path[0])return{perspective:h,path:m.path.slice(1)};if(h.$_terms.shared){for(const g of h.$_terms.shared)if(g._flags.id===m.path[0])return{perspective:g,path:m.path.slice(1)}}}return{perspective:null,path:null}}return m.ancestor==="root"?{perspective:p.schemas[p.schemas.length-1].schema,path:m.path}:{perspective:p.schemas[m.ancestor]&&p.schemas[m.ancestor].schema,path:m.path}},d.assert=function(m,p,h,y,g,v){m||o(!1,`"${l.label(y._flags,g,v)}" contains link reference "${h.display}" ${p}`)}},3832:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const d=l.toString(),m=d.indexOf("."),p=d.indexOf("e");return(m<0?0:(p<0?d.length:p)-m-1)+(p<0?0:Math.max(0,-parseInt(d.slice(p+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:m}){if(!l.match(f.numberRx))return;l=l.trim();const p={value:parseFloat(l)};if(p.value===0&&(p.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(p.value)))return p.errors=m("number.unsafe"),p}else{const h=p.value.toString();if(h.match(/e/i))return p;if(h!==f.normalizeDecimal(l))return p.errors=m("number.unsafe"),p}return p}},validate(l,{schema:d,error:m,prefs:p}){if(l===1/0||l===-1/0)return{value:l,errors:m("number.infinity")};if(!u.isNumber(l))return{value:l,errors:m("number.base")};const h={value:l};if(p.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);h.value=Math.round(h.value*g)/g}}return h.value===0&&(h.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,m,h)?l:d.error("number."+p,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.isNumber,message:"must be a number"}]},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{limit:l},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(l,d)=>Math.trunc(l)-l==0?l:d.error("number.integer")},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{limit:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{limit:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{limit:l},operator:">="})}},multiple:{method(l){const d=typeof l=="number"?f.decimalPlaces(l):null,m=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:m}})},validate:(l,d,{base:m,baseDecimalPlace:p,pfactor:h},y)=>f.decimalPlaces(l)>p?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(h*l)%Math.round(h*m)==0?l:d.error("number.multiple",{multiple:y.args.base,value:l}),args:[{name:"base",ref:!0,assert:l=>typeof l=="number"&&isFinite(l)&&l>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(l,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return o(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:m}){const p=l.toString().match(f.precisionRx);return Math.max((p[1]?p[1].length:0)-(p[2]?parseInt(p[2],10):0),0)<=m?l:d.error("number.precision",{limit:m,value:l})},convert:!0},sign:{method(l){return o(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:m})=>m==="negative"&&l<0||m==="positive"&&l>0?l:d.error(`number.${m}`)},unsafe:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>l.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(l){return l.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(l){return(l=l.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&l.endsWith("0")&&(l=l.replace(/0+$/,"")),l==="-0"?"0":l}},8966:(s,i,a)=>{const o=a(7824);s.exports=o.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,a)=>{const o=a(375),c=a(5380),u=a(1745),f=a(9959),l=a(6064),d=a(9926),m=a(5752),p=a(8068),h=a(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:w,prefs:x}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const k=v.$_getRule("case");k&&(g=k.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const R=v.$_getRule("trim");if(R&&R.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const T of v.$_terms.replacements)g=g.replace(T.pattern,T.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const T=y.isoDate(g);T&&(g=T)}if(v._flags.truncate){const T=v.$_getRule("max");if(T){let D=T.args.limit;if(h.isResolvable(D)&&(D=D.resolve(g,w,x),!h.limit(D)))return{value:g,errors:v.$_createError("any.ref",D,{ref:T.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,D)}}return{value:g}}},validate(g,{schema:v,error:w}){if(typeof g!="string")return{value:g,errors:w("string.base")};if(g===""){const x=v.$_getRule("min");return x&&x.args.limit===0?void 0:{value:g,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return h.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:w})=>y.base64Regex[w.paddingRequired][w.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return o(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:w})=>w==="lower"&&g===g.toLocaleLowerCase()||w==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let w=g.length,x=0,A=1;for(;w--;){const k=g.charAt(w)*A;x+=k-9*(k>9),A^=3}return x>0&&x%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return h.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:w}){const x=g.match(y.dataUriRegex);return x&&(!x[2]||x[2]!=="base64"||y.base64Regex[w.paddingRequired].false.test(x[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&h.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,w,{address:x})=>c.isValid(g,x)?g:v.error("string.domain")},email:{method(g={}){h.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),w=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:w,address:v})},validate(g,v,{options:w},{regex:x,address:A}){const k=w.multiple?g.split(x):[g],R=[];for(const E of k)u.isValid(E,A)||R.push(E);return R.length?v.error("string.email",{value:g,invalids:R}):g}},guid:{alias:"uuid",method(g={}){h.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);o(A.length>=1,"version must have at least 1 valid version specified");const k=new Set;for(let R=0;R(w.prefix==="optional"?y.hexRegex.withOptionalPrefix:w.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?w.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){h.assertOptions(g,["cidr","version"]);const{cidr:v,versions:w,regex:x}=f.regex(g),A=g.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:x})},validate:(g,v,{options:w},{regex:x})=>x.test(g)?g:w.version?v.error("string.ipVersion",{value:g,cidr:w.cidr,version:w.version}):v.error("string.ip",{value:g,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(g,{error:v})=>y.isoDate(g)?g:v("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(g,v)=>y.isoDurationRegex.test(g)?g:v.error("string.isoDuration")},length:{method(g,v){return y.length(this,"length",g,"=",v)},validate(g,v,{limit:w,encoding:x},{name:A,operator:k,args:R}){const E=!x&&g.length;return h.compare(E,w,k)?g:v.error("string."+A,{limit:R.limit,value:g,encoding:x})},args:[{name:"limit",ref:!0,assert:h.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return o(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:w})=>g===g.normalize(w)?g:v("string.normalize",{value:g,form:w}),convert:!0},pattern:{alias:"regex",method(g,v={}){o(g instanceof RegExp,"regex must be a RegExp"),o(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),h.assertOptions(v,["invert","name"]);const w=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:w})},validate:(g,v,{regex:w,options:x},{errorCode:A})=>w.test(g)^x.invert?g:v.error(A,{name:x.name,regex:w,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),o(g instanceof RegExp,"pattern must be a RegExp"),o(typeof v=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:g,replacement:v}),w}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:w})=>w&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){h.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&h.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:w}=m.regex(g),x=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:x,scheme:w})},validate(g,v,{options:w},{regex:x,domain:A,scheme:k}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let R=x.exec(g);if(!R&&v.prefs.convert&&w.encodeUri){const E=encodeURI(g);R=x.exec(E),R&&(g=E)}if(R){const E=R[1]||R[2];return!A||w.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return w.relativeOnly?v.error("string.uriRelativeOnly"):w.scheme?v.error("string.uriCustomScheme",{scheme:k,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:w,replacement:x}of v.replacements)g=g.replace(w,x);return g}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),y.addressOptions=function(g){if(!g)return y.tlds||g;if(o(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);o(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),o(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const w=g.tlds.allow;return w?w===!0?(o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(w)&&(g=Object.assign({},g,{tlds:{allow:new Set(w)}})),o(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const w of g)o(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!h.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,w,x,A){return o(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:w,encoding:A},operator:x})}},8826:(s,i,a)=>{const o=a(375),c=a(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const m=l.$_terms.map.get(f);return m&&(f=m),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("symbol.map",{map:l.$_terms.map})}:{value:f}}},validate(f,{error:l}){if(typeof f!="symbol")return{value:f,errors:l("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const m of f){o(m&&m[Symbol.iterator],"Entry must be an iterable");const[p,h]=m;o(typeof p!="object"&&typeof p!="function"&&typeof p!="symbol","Key must not be of type object, function, or Symbol"),o(typeof h=="symbol","Value must be a Symbol"),l.$_terms.map.set(p,h),d.push(h)}return l.valid(...d)}}},manifest:{build:(f,l)=>(l.map&&(f=f.map(l.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,a)=>{const o=a(375),c=a(8571),u=a(738),f=a(9621),l=a(8160),d=a(6354),m=a(493),p={result:Symbol("result")};i.entry=function(h,y,g){let v=l.defaults;g&&(o(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const w=p.entry(h,y,v);o(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const x={value:w.value};return w.error&&(x.error=w.error),w.mainstay.warnings.length&&(x.warning=d.details(w.mainstay.warnings)),w.mainstay.debug&&(x.debug=w.mainstay.debug),w.mainstay.artifacts&&(x.artifacts=w.mainstay.artifacts),x},i.entryAsync=async function(h,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const w=p.entry(h,y,v),x=w.mainstay;if(w.error)throw x.debug&&(w.error.debug=x.debug),w.error;if(x.externals.length){let k=w.value;const R=[];for(const E of x.externals){const T=E.state.path,D=E.schema.type==="link"?x.links.get(E.schema):null;let O,L,I=k;const F=T.length?[k]:[],U=T.length?f(h,T):h;if(T.length){O=T[T.length-1];let Y=k;for(const V of T.slice(0,-1))Y=Y[V],F.unshift(Y);L=F[0],I=L[O]}try{const Y=(H,ee)=>(D||E.schema).$_createError(H,I,ee,E.state,v),V=await E.method(I,{schema:E.schema,linked:D,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((D||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(D||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(V===void 0||V===I)continue;if(V instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...V),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,V,"external"),L[O]=V):(x.tracer.value(E.state,"rule",k,V,"external"),k=V)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=k,R.length)throw w.error=d.process(R,h,v),x.debug&&(w.error.debug=x.debug),w.error}if(!v.warnings&&!v.debug&&!v.artifacts)return w.value;const A={value:w.value};return x.warnings.length&&(A.warning=d.details(x.warnings)),x.debug&&(A.debug=x.debug),x.artifacts&&(A.artifacts=x.artifacts),A},p.Mainstay=class{constructor(h,y,g){this.externals=[],this.warnings=[],this.tracer=h,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const h=this._snapshots.pop();this.externals=h.externals,this.warnings=h.warnings}commit(){this._snapshots.pop()}},p.entry=function(h,y,g){const{tracer:v,cleanup:w}=p.tracer(y,g),x=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,k=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:k,schemas:R}),T=i.validate(h,y,E,g);w&&y.$_root.untrace();const D=d.process(T.errors,h,g);return{value:T.value,error:D,mainstay:k}},p.tracer=function(h,y){return h.$_root._tracer?{tracer:h.$_root._tracer._register(h)}:y.debug?(o(h.$_root.trace,"Debug mode not supported"),{tracer:h.$_root.trace()._register(h),cleanup:!0}):{tracer:p.ignore}},i.validate=function(h,y,g,v,w={}){if(y.$_terms.whens&&(y=y._generate(h,g,v).schema),y._preferences&&(v=p.prefs(y,v)),y._cache&&v.cache){const D=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!D),D)return D}const x=(D,O,L)=>y.$_createError(D,h,O,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(D,O,L)=>g.mainstay.warnings.push(x(D,O,L)),message:(D,O)=>y.$_createError("custom",h,O,g,v,{messages:D})};g.mainstay.tracer.entry(y,g);const k=y._definition;if(k.prepare&&h!==void 0&&v.convert){const D=k.prepare(h,A);if(D){if(g.mainstay.tracer.value(g,"prepare",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}if(k.coerce&&h!==void 0&&v.convert&&(!k.coerce.from||k.coerce.from.includes(typeof h))){const D=k.coerce.method(h,A);if(D){if(g.mainstay.tracer.value(g,"coerced",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}const R=y._flags.empty;R&&R.$_match(p.trim(h,y),g.nest(R),l.defaults)&&(g.mainstay.tracer.value(g,"empty",h,void 0),h=void 0);const E=w.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(h===void 0){if(E==="forbidden")return p.finalize(h,null,A);if(E==="required")return p.finalize(h,[y.$_createError("any.required",h,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return p.finalize(h,null,A);g.mainstay.tracer.value(g,"default",h,{}),h={}}}else if(E==="forbidden")return p.finalize(h,[y.$_createError("any.unknown",h,null,g,v)],A);const T=[];if(y._valids){const D=y._valids.get(h,g,v,y._flags.insensitive);if(D)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,D.value),h=D.value),g.mainstay.tracer.filter(y,g,"valid",D),p.finalize(h,null,A);if(y._flags.only){const O=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);T.push(O)}}if(y._invalids){const D=y._invalids.get(h,g,v,y._flags.insensitive);if(D){g.mainstay.tracer.filter(y,g,"invalid",D);const O=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);T.push(O)}}if(k.validate){const D=k.validate(h,A);if(D&&(g.mainstay.tracer.value(g,"base",h,D.value),h=D.value,D.errors)){if(!Array.isArray(D.errors))return T.push(D.errors),p.finalize(h,T,A);if(D.errors.length)return T.push(...D.errors),p.finalize(h,T,A)}}return y._rules.length?p.rules(h,T,A):p.finalize(h,T,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const k=v._definition.rules[A.method];if(k.convert&&x.convert){w.mainstay.tracer.log(v,w,"rule",A.name,"full");continue}let R,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const D of A._resolve){const O=k.argsByName.get(D),L=E[D].resolve(h,w,x),I=O.normalize?O.normalize(L):L,F=l.validateArg(I,null,O);if(F){R=v.$_createError("any.ref",L,{arg:D,ref:E[D],reason:F},w,x);break}E[D]=I}}R=R||k.validate(h,g,E,A);const T=p.rule(R,A);if(T.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...T.errors);continue}if(x.abortEarly)return p.finalize(h,T.errors,g);y.push(...T.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,T.value,A.name),h=T.value}return p.finalize(h,y,g)},p.rule=function(h,y){return h instanceof d.Report?(p.error(h,y),{errors:[h],value:null}):Array.isArray(h)&&h[l.symbols.errors]?(h.forEach(g=>p.error(g,y)),{errors:h,value:null}):{errors:null,value:h}},p.error=function(h,y){return y.message&&h._setTemplate(y.message),h},p.finalize=function(h,y,g){y=y||[];const{schema:v,state:w,prefs:x}=g;if(y.length){const k=p.default("failover",void 0,y,g);k!==void 0&&(w.mainstay.tracer.value(w,"failover",h,k),h=k,y=[])}if(y.length&&v._flags.error)if(typeof v._flags.error=="function"){y=v._flags.error(y),Array.isArray(y)||(y=[y]);for(const k of y)o(k instanceof Error||k instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const k=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,k),h=k}if(v._flags.cast&&h!==void 0){const k=v._definition.cast[v._flags.cast];if(k.from(h)){const R=k.to(h,g);w.mainstay.tracer.value(w,"cast",h,R,v._flags.cast),h=R}}if(v.$_terms.externals&&x.externals&&x._externals!==!1)for(const{method:k}of v.$_terms.externals)w.mainstay.externals.push({method:k,schema:v,state:w,label:d.label(v._flags,w,x)});const A={value:h,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,w.mainstay.tracer.value(w,v._flags.result,h,A.value),w.shadow(h,v._flags.result)),v._cache&&x.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),h===void 0||A.errors||v._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(v._flags.artifact)||w.mainstay.artifacts.set(v._flags.artifact,[]),w.mainstay.artifacts.get(v._flags.artifact).push(w.path)),A},p.prefs=function(h,y){const g=y===l.defaults;return g&&h._preferences[l.symbols.prefs]?h._preferences[l.symbols.prefs]:(y=l.preferences(y,h._preferences),g&&(h._preferences[l.symbols.prefs]=y),y)},p.default=function(h,y,g,v){const{schema:w,state:x,prefs:A}=v,k=w._flags[h];if(A.noDefaults||k===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!k)return k;if(typeof k=="function"){const R=k.length?[c(x.ancestors[0]),v]:[];try{return k(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof k!="object"?k:k[l.symbols.literal]?k.literal:l.isResolvable(k)?k.resolve(y,x,A):c(k)},p.trim=function(h,y){if(typeof h!="string")return h;const g=y.$_getRule("trim");return g&&g.args.enabled?h.trim():h},p.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},p.errorsArray=function(){const h=[];return h[l.symbols.errors]=!0,h}},2036:(s,i,a)=>{const o=a(375),c=a(9474),u=a(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,m){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const p of[...d._values,...d._refs])l.add(p)}if(m)for(const p of[...m._values,...m._refs])l.remove(p);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,m,p){return!!this.get(l,d,m,p)}get(l,d,m,p){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&p){const h=this._lowercase.get(l.toLowerCase());if(h)return{value:h}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const h of this._values)if(c(h,l))return{value:h}}if(d)for(const h of this._refs){const y=h.resolve(l,d,m,null,{in:!0});if(y===void 0)continue;const g=h.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(p&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:h}}else if(c(v,l))return{value:v,ref:h}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const m of[...this._values,...this._refs])m!==void 0&&d.push(m);return d}return Array.from([...this._values,...this._refs])}clone(){const l=new f.Values(this._values,this._refs);return l._override=this._override,l}concat(l){o(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const m of l)typeof m=="string"&&d.set(m.toLowerCase(),m);return d}},978:(s,i,a)=>{const o=a(375),c=a(8571),u=a(1687),f=a(9621),l={};s.exports=function(d,m,p={}){if(o(d&&typeof d=="object","Invalid defaults value: must be an object"),o(!m||m===!0||typeof m=="object","Invalid source value: must be true, falsy or an object"),o(typeof p=="object","Invalid options: must be an object"),!m)return null;if(p.shallow)return l.applyToDefaultsWithShallow(d,m,p);const h=c(d);if(m===!0)return h;const y=p.nullOverride!==void 0&&p.nullOverride;return u(h,m,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,m,p){const h=p.shallow;o(Array.isArray(h),"Invalid keys");const y=new Map,g=m===!0?null:new Set;for(let x of h){x=Array.isArray(x)?x:x.split(".");const A=f(d,x);A&&typeof A=="object"?y.set(A,g&&f(m,x)||A):g&&g.add(x)}const v=c(d,{},y);if(!g)return v;for(const x of g)l.reachCopy(v,m,x);const w=p.nullOverride!==void 0&&p.nullOverride;return u(v,m,{nullOverride:w,mergeArrays:!1})},l.reachCopy=function(d,m,p){for(const g of p){if(!(g in m))return;const v=m[g];if(typeof v!="object"||v===null)return;m=v}const h=m;let y=d;for(let g=0;g{const o=a(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new o(u)}},8571:(s,i,a)=>{const o=a(9621),c=a(4277),u=a(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},m=null){if(typeof l!="object"||l===null)return l;let p=f.clone,h=m;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);p=w=>w}else if(h){const w=h.get(l);if(w)return w}else h=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,d);if(g===l)return l;if(h&&h.set(l,g),y===c.set)for(const w of l)g.add(p(w,d,h));else if(y===c.map)for(const[w,x]of l)g.set(w,p(x,d,h));const v=u.keys(l,d);for(const w of v){if(w==="__proto__")continue;if(y===c.array&&w==="length"){g.length=l.length;continue}const x=Object.getOwnPropertyDescriptor(l,w);x?x.get||x.set?Object.defineProperty(g,w,x):x.enumerable?g[w]=p(l[w],d,h):Object.defineProperty(g,w,{enumerable:!1,writable:!0,configurable:!0,value:p(l[w],d,h)}):Object.defineProperty(g,w,{enumerable:!0,writable:!0,configurable:!0,value:p(l[w],d,h)})}return g},f.cloneWithShallow=function(l,d){const m=d.shallow;(d=Object.assign({},d)).shallow=!1;const p=new Map;for(const h of m){const y=o(l,h);typeof y!="object"&&typeof y!="function"||p.set(y,y)}return f.clone(l,d,p)},f.base=function(l,d,m){if(m.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const p=Object.getPrototypeOf(l);if(p&&p.isImmutable)return l;if(d===c.array){const h=[];return p!==d&&Object.setPrototypeOf(h,p),h}if(f.needsProtoHack.has(d)){const h=new p.constructor;return p!==d&&Object.setPrototypeOf(h,p),h}return Object.create(p)}},9474:(s,i,a)=>{const o=a(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const m=typeof u;if(m!==typeof f||u===null||f===null)return!1;if(m==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(m!=="object")return u!=u&&f!=f;const p=c.getSharedType(u,f,!!l.prototype);switch(p){case o.buffer:return!1;case o.promise:return u===f;case o.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let h=d.length-1;h>=0;--h)if(d[h].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(p,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:o.getInternalProto(u);const d=o.getInternalProto(u);return d!==o.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,m){const{isDeepEqual:p,valueOf:h,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===o.array){if(!d.part){if(f.length!==l.length)return!1;for(let R=0;R{const o=a(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:o(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(a){if(!a)return"";let o="";for(let c=0;c=256?"&#"+a+";":`&#x${a.toString(16).padStart(2,"0")};`)},i.isSafe=function(a){return i.safeCharCodes.has(a)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const a=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&a.add(o);return a}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,a)=>{const o=a(375),c=a(8571),u=a(7043),f={};s.exports=f.merge=function(l,d,m){if(o(l&&typeof l=="object","Invalid target value: must be an object"),o(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(m=Object.assign({nullOverride:!0,mergeArrays:!0},m),Array.isArray(d)){o(Array.isArray(l),"Cannot merge array onto an object"),m.mergeArrays||(l.length=0);for(let h=0;h{const o=a(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);o(!d||!l.separator,"Separator option is not valid for array-based chain");const m=d?f:f.split(l.separator||".");let p=u;for(let h=0;h{s.exports=function(...i){try{return JSON.stringify(...i)}catch(a){return"[Cannot display object: "+a.message+"]"}}},4277:(s,i)=>{const a={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},a.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(o){if(Array.isArray(o))return i.array;if(o instanceof Date)return i.date;if(o instanceof RegExp)return i.regex;if(o instanceof Error)return i.error;const c=Object.prototype.toString.call(o);return a.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(a,o={}){return o.symbols!==!1?Reflect.ownKeys(a):Object.getOwnPropertyNames(a)}},3652:(s,i,a)=>{const o=a(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),m=f.group||"?",p=f.sort||0;o(!l.includes(m),`Item cannot come before itself: ${m}`),o(!l.includes("?"),"Item cannot come before unassociated items"),o(!d.includes(m),`Item cannot come after itself: ${m}`),o(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const h of u){const y={seq:this._items.length,sort:p,before:l,after:d,group:m,node:h};this._items.push(y)}if(!f.manual){const h=this._sort();o(h,"item",m!=="?"?`added into group ${m}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const o=a(443),c=a(2178),u={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:o.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,m=f.split(".");if(m.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const p=l.tlds;if(p){const h=m[m.length-1].toLowerCase();if(p.deny&&p.deny.has(h)||p.allow&&!p.allow.has(h))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let h=0;h63)return c.code("DOMAIN_LONG_SEGMENT");if(h{const o=a(9848),c=a(5380),u=a(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const m=!f.nonAsciiRx.test(l);if(!m){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const p=l.split("@");if(p.length!==2)return p.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[h,y]=p;if(!h)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(h).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(h,m)||c.analyze(y,d)},f.local=function(l,d){const m=l.split(".");for(const p of m){if(!p.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(p))return u.code("INVALID_LOCAL_CHARS")}else for(const h of p){if(f.atextRx.test(h))continue;const y=f.binary(h);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(a){return{code:a,error:i.codes[a]}}},9959:(s,i,a)=>{const o=a(375),c=a(5752);i.regex=function(u={}){o(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),o(l.length>=1,"options.version must have at least 1 version specified");for(let p=0;p{if(f==="forbidden")return c.ip[p];const h=`\\/${p==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[p]}${h}`:`${c.ip[p]}(?:${h})?`}).join("|")})`,m=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:m,raw:d}}},5752:(s,i,a)=>{const o=a(375),c=a(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",m="\\w-\\.~",p="!\\$&'\\(\\)\\*\\+,;=",h="%"+l,y=m+h+p+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const w=d+"{1,4}",x="(?:"+w+":"+w+"|"+f.ipv4address+")",A="(?:"+w+":){6}"+x,k="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,T="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,D="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,O="(?:(?:"+w+":){0,4}"+w+")?::"+x,L="(?:(?:"+w+":){0,5}"+w+")?::"+w,I="(?:(?:"+w+":){0,6}"+w+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+A+"|"+k+"|"+R+"|"+E+"|"+T+"|"+D+"|"+O+"|"+L+"|"+I+")",f.ipvFuture="v"+d+"+\\.["+m+p+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const F="["+m+h+p+":]*",U="["+m+h+p+"]{1,255}",Y="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",V="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",q="\\/(?:"+re+X+")?",K=re+X,Z="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+q+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+q+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",m=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(m+d);let p="";if(f.scheme){o(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);o(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let w=0;w{const a={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(o,c={}){if(!c[a.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[a.settings]?c:Object.assign({[a.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(o)}_parse(o){let c=[],u="",f=0,l=!1;const d=p=>{if(f)throw new Error("Formula missing closing parenthesis");const h=c.length?c[c.length-1]:null;if(l||u||p){if(h&&h.type==="reference"&&p===")")return h.type="function",h.value=this._subFormula(u,h.value),void(u="");if(p===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(a.operatorCharacters.includes(u))h&&h.type==="operator"&&a.operators.includes(h.value+u)?h.value+=u:c.push({type:"operator",value:u});else if(u.match(a.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(a.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const p of o)l?p===l?(d(),l=!1):u+=p:f?p==="("?(u+=p,++f):p===")"?(--f,f?u+=p:d(p)):u+=p:p in a.literals?l=a.literals[p]:p==="("?(d(),++f):a.operatorCharacters.includes(p)?(d(),u=p,d()):p!==" "?u+=p:d();d(),c=c.map((p,h)=>p.type!=="operator"||p.value!=="-"||h&&c[h-1].type!=="operator"?p:{type:"operator",value:"n"});let m=!1;for(const p of c){if(p.type==="operator"){if(a.operatorsPrefix.includes(p.value))continue;if(!m)throw new Error("Formula contains an operator in invalid position");if(!a.operators.includes(p.value))throw new Error(`Formula contains an unknown operator ${p.value}`)}else if(m)throw new Error("Formula missing expected operator");m=!m}if(!m)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(p=>{if(p.type==="operator")return a.operatorsPrefix.includes(p.value)?p:p.value;if(p.type!=="reference")return p.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(p.value))throw new Error(`Formula contains invalid reference ${p.value}`);return this.settings.reference?this.settings.reference(p.value):a.reference(p.value)})}_subFormula(o,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(o){let l="",d=0,m=!1;const p=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${o}`);f.push(l),l=""};for(let h=0;hnew i.Parser(l,this.settings)),function(l){const d=[];for(const m of f)d.push(m.evaluate(l));return u.call(l,...d)}}evaluate(o){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=a.evaluate(l,o);c[u]=a.single(f.value,d)}}return a.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},a.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var a=r[i];if(a!==void 0)return a.exports;var o=r[i]={exports:{}};return n[i](o,o.exports,s),o.exports}(5107);var n,r})})(PQ);var qOe=PQ.exports;const dr=Dd(qOe);class xa{constructor(e){He(this,"_object");He(this,"_error");He(this,"isSuccess");He(this,"isFailure");const{isSuccess:n,error:r,object:s}=e;if(n&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!n&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error message");this.isSuccess=n,this.isFailure=!n,this._error=r,this._object=s,Object.freeze(this)}get object(){if(this.isFailure)throw new Error("Result is not successful");return this._object}get error(){if(this.isSuccess)throw new Error("Result is not error");return this._error}static ok(e){return new xa({isSuccess:!0,object:e})}static fail(e){return new xa({isSuccess:!1,error:e})}static combine(e){for(const n of e)if(n.isFailure)return n;return xa.ok()}}class Jl{static validate(e,n,r={}){if(!dr.isSchema(e))throw new KOe("Rule provided is not a valid Joi schema!");const s={abortEarly:!1,errors:{wrap:{label:"{}"}},...r},i=e.validate(n,s);return i.error?xa.fail(i.error):xa.ok(i.value)}static validateFnc(e){return(n,r)=>{const s=e(n);return s.isSuccess?n:r.message({custom:s.error.message})}}}He(Jl,"RULE_NOT_NULL_OR_UNDEFINED",dr.any().required().invalid(null)),He(Jl,"RULE_ALLOW_NULL_OR_UNDEFINED",dr.any().optional().valid(null)),He(Jl,"RULE_ALLOW_NULL",dr.any().valid(null)),He(Jl,"RULE_ALLOW_EMPTY",dr.any().optional().valid(null,"")),He(Jl,"RULE_IS_TYPE_STRING",dr.string()),He(Jl,"RULE_IS_TYPE_NUMBER",dr.number());class KOe extends Error{}class k$ extends Error{constructor(n,r,s={}){super(r);He(this,"code");He(this,"payload",{});this.name=this.constructor.name,this.code=n,this.payload=s,Object.setPrototypeOf(this,k$.prototype)}}const QC=class QC extends k${static create(e,n,r){return new QC(e,n,r)}};He(QC,"INVALID_INPUT_DATA","INVALID_INPUT_DATA");let i0=QC;function TQ(t,e="",n){return i0.create(t,e,n)}var kQ={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Object.prototype.hasOwnProperty;t.is=function(n,r){return n===r?n!==0||r!==0||1/n===1/r:n!==n&&r!==r},t.shallowEqual=function(n,r,s){if(n===r)return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=s&&typeof s.customEqual=="function"?s.customEqual:t.is,c=0;cthis.props===null)}}class TUe extends dr.ValidationError{}class kUe extends dr.ValidationError{}class DUe extends dr.ValidationError{}class NUe extends dr.ValidationError{}class OUe extends dr.ValidationError{}const QT={USD:{symbol:"$",name:"US Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"USD",name_plural:"US dollars"},CAD:{symbol:"CA$",name:"Canadian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"CAD",name_plural:"Canadian dollars"},EUR:{symbol:"€",name:"Euro",symbol_native:"€",decimal_digits:2,rounding:0,code:"EUR",name_plural:"euros"},BTC:{symbol:"BTC",name:"Bitcoin",symbol_native:"฿",decimal_digits:8,rounding:0,code:"BTC",name_plural:"Bitcoins"},AED:{symbol:"AED",name:"United Arab Emirates Dirham",symbol_native:"د.إ.‏",decimal_digits:2,rounding:0,code:"AED",name_plural:"UAE dirhams"},AFN:{symbol:"Af",name:"Afghan Afghani",symbol_native:"؋",decimal_digits:2,rounding:0,code:"AFN",name_plural:"Afghan Afghanis"},ALL:{symbol:"ALL",name:"Albanian Lek",symbol_native:"Lek",decimal_digits:2,rounding:0,code:"ALL",name_plural:"Albanian lekë"},AMD:{symbol:"AMD",name:"Armenian Dram",symbol_native:"դր.",decimal_digits:2,rounding:0,code:"AMD",name_plural:"Armenian drams"},ARS:{symbol:"AR$",name:"Argentine Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"ARS",name_plural:"Argentine pesos"},AUD:{symbol:"AU$",name:"Australian Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"AUD",name_plural:"Australian dollars"},AZN:{symbol:"man.",name:"Azerbaijani Manat",symbol_native:"ман.",decimal_digits:2,rounding:0,code:"AZN",name_plural:"Azerbaijani manats"},BAM:{symbol:"KM",name:"Bosnia-Herzegovina Convertible Mark",symbol_native:"KM",decimal_digits:2,rounding:0,code:"BAM",name_plural:"Bosnia-Herzegovina convertible marks"},BDT:{symbol:"Tk",name:"Bangladeshi Taka",symbol_native:"৳",decimal_digits:2,rounding:0,code:"BDT",name_plural:"Bangladeshi takas"},BGN:{symbol:"BGN",name:"Bulgarian Lev",symbol_native:"лв.",decimal_digits:2,rounding:0,code:"BGN",name_plural:"Bulgarian leva"},BHD:{symbol:"BD",name:"Bahraini Dinar",symbol_native:"د.ب.‏",decimal_digits:3,rounding:0,code:"BHD",name_plural:"Bahraini dinars"},BIF:{symbol:"FBu",name:"Burundian Franc",symbol_native:"FBu",decimal_digits:0,rounding:0,code:"BIF",name_plural:"Burundian francs"},BND:{symbol:"BN$",name:"Brunei Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BND",name_plural:"Brunei dollars"},BOB:{symbol:"Bs",name:"Bolivian Boliviano",symbol_native:"Bs",decimal_digits:2,rounding:0,code:"BOB",name_plural:"Bolivian bolivianos"},BRL:{symbol:"R$",name:"Brazilian Real",symbol_native:"R$",decimal_digits:2,rounding:0,code:"BRL",name_plural:"Brazilian reals"},BWP:{symbol:"BWP",name:"Botswanan Pula",symbol_native:"P",decimal_digits:2,rounding:0,code:"BWP",name_plural:"Botswanan pulas"},BYR:{symbol:"BYR",name:"Belarusian Ruble",symbol_native:"BYR",decimal_digits:0,rounding:0,code:"BYR",name_plural:"Belarusian rubles"},BZD:{symbol:"BZ$",name:"Belize Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"BZD",name_plural:"Belize dollars"},CDF:{symbol:"CDF",name:"Congolese Franc",symbol_native:"FrCD",decimal_digits:2,rounding:0,code:"CDF",name_plural:"Congolese francs"},CHF:{symbol:"CHF",name:"Swiss Franc",symbol_native:"CHF",decimal_digits:2,rounding:.05,code:"CHF",name_plural:"Swiss francs"},CLP:{symbol:"CL$",name:"Chilean Peso",symbol_native:"$",decimal_digits:0,rounding:0,code:"CLP",name_plural:"Chilean pesos"},CNY:{symbol:"CN¥",name:"Chinese Yuan",symbol_native:"CN¥",decimal_digits:2,rounding:0,code:"CNY",name_plural:"Chinese yuan"},COP:{symbol:"CO$",name:"Colombian Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"COP",name_plural:"Colombian pesos"},CRC:{symbol:"₡",name:"Costa Rican Colón",symbol_native:"₡",decimal_digits:2,rounding:0,code:"CRC",name_plural:"Costa Rican colóns"},CVE:{symbol:"CV$",name:"Cape Verdean Escudo",symbol_native:"CV$",decimal_digits:2,rounding:0,code:"CVE",name_plural:"Cape Verdean escudos"},CZK:{symbol:"Kč",name:"Czech Republic Koruna",symbol_native:"Kč",decimal_digits:2,rounding:0,code:"CZK",name_plural:"Czech Republic korunas"},DJF:{symbol:"Fdj",name:"Djiboutian Franc",symbol_native:"Fdj",decimal_digits:0,rounding:0,code:"DJF",name_plural:"Djiboutian francs"},DKK:{symbol:"Dkr",name:"Danish Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"DKK",name_plural:"Danish kroner"},DOP:{symbol:"RD$",name:"Dominican Peso",symbol_native:"RD$",decimal_digits:2,rounding:0,code:"DOP",name_plural:"Dominican pesos"},DZD:{symbol:"DA",name:"Algerian Dinar",symbol_native:"د.ج.‏",decimal_digits:2,rounding:0,code:"DZD",name_plural:"Algerian dinars"},EEK:{symbol:"Ekr",name:"Estonian Kroon",symbol_native:"kr",decimal_digits:2,rounding:0,code:"EEK",name_plural:"Estonian kroons"},EGP:{symbol:"EGP",name:"Egyptian Pound",symbol_native:"ج.م.‏",decimal_digits:2,rounding:0,code:"EGP",name_plural:"Egyptian pounds"},ERN:{symbol:"Nfk",name:"Eritrean Nakfa",symbol_native:"Nfk",decimal_digits:2,rounding:0,code:"ERN",name_plural:"Eritrean nakfas"},ETB:{symbol:"Br",name:"Ethiopian Birr",symbol_native:"Br",decimal_digits:2,rounding:0,code:"ETB",name_plural:"Ethiopian birrs"},GBP:{symbol:"£",name:"British Pound Sterling",symbol_native:"£",decimal_digits:2,rounding:0,code:"GBP",name_plural:"British pounds sterling"},GEL:{symbol:"GEL",name:"Georgian Lari",symbol_native:"GEL",decimal_digits:2,rounding:0,code:"GEL",name_plural:"Georgian laris"},GHS:{symbol:"GH₵",name:"Ghanaian Cedi",symbol_native:"GH₵",decimal_digits:2,rounding:0,code:"GHS",name_plural:"Ghanaian cedis"},GNF:{symbol:"FG",name:"Guinean Franc",symbol_native:"FG",decimal_digits:0,rounding:0,code:"GNF",name_plural:"Guinean francs"},GTQ:{symbol:"GTQ",name:"Guatemalan Quetzal",symbol_native:"Q",decimal_digits:2,rounding:0,code:"GTQ",name_plural:"Guatemalan quetzals"},HKD:{symbol:"HK$",name:"Hong Kong Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"HKD",name_plural:"Hong Kong dollars"},HNL:{symbol:"HNL",name:"Honduran Lempira",symbol_native:"L",decimal_digits:2,rounding:0,code:"HNL",name_plural:"Honduran lempiras"},HRK:{symbol:"kn",name:"Croatian Kuna",symbol_native:"kn",decimal_digits:2,rounding:0,code:"HRK",name_plural:"Croatian kunas"},HUF:{symbol:"Ft",name:"Hungarian Forint",symbol_native:"Ft",decimal_digits:2,rounding:0,code:"HUF",name_plural:"Hungarian forints"},IDR:{symbol:"Rp",name:"Indonesian Rupiah",symbol_native:"Rp",decimal_digits:2,rounding:0,code:"IDR",name_plural:"Indonesian rupiahs"},ILS:{symbol:"₪",name:"Israeli New Sheqel",symbol_native:"₪",decimal_digits:2,rounding:0,code:"ILS",name_plural:"Israeli new sheqels"},INR:{symbol:"Rs",name:"Indian Rupee",symbol_native:"টকা",decimal_digits:2,rounding:0,code:"INR",name_plural:"Indian rupees"},IQD:{symbol:"IQD",name:"Iraqi Dinar",symbol_native:"د.ع.‏",decimal_digits:3,rounding:0,code:"IQD",name_plural:"Iraqi dinars"},IRR:{symbol:"IRR",name:"Iranian Rial",symbol_native:"﷼",decimal_digits:2,rounding:0,code:"IRR",name_plural:"Iranian rials"},ISK:{symbol:"Ikr",name:"Icelandic Króna",symbol_native:"kr",decimal_digits:0,rounding:0,code:"ISK",name_plural:"Icelandic krónur"},JMD:{symbol:"J$",name:"Jamaican Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"JMD",name_plural:"Jamaican dollars"},JOD:{symbol:"JD",name:"Jordanian Dinar",symbol_native:"د.أ.‏",decimal_digits:3,rounding:0,code:"JOD",name_plural:"Jordanian dinars"},JPY:{symbol:"¥",name:"Japanese Yen",symbol_native:"¥",decimal_digits:0,rounding:0,code:"JPY",name_plural:"Japanese yen"},KES:{symbol:"Ksh",name:"Kenyan Shilling",symbol_native:"Ksh",decimal_digits:2,rounding:0,code:"KES",name_plural:"Kenyan shillings"},KHR:{symbol:"KHR",name:"Cambodian Riel",symbol_native:"៛",decimal_digits:2,rounding:0,code:"KHR",name_plural:"Cambodian riels"},KMF:{symbol:"CF",name:"Comorian Franc",symbol_native:"FC",decimal_digits:0,rounding:0,code:"KMF",name_plural:"Comorian francs"},KRW:{symbol:"₩",name:"South Korean Won",symbol_native:"₩",decimal_digits:0,rounding:0,code:"KRW",name_plural:"South Korean won"},KWD:{symbol:"KD",name:"Kuwaiti Dinar",symbol_native:"د.ك.‏",decimal_digits:3,rounding:0,code:"KWD",name_plural:"Kuwaiti dinars"},KZT:{symbol:"KZT",name:"Kazakhstani Tenge",symbol_native:"тңг.",decimal_digits:2,rounding:0,code:"KZT",name_plural:"Kazakhstani tenges"},LAK:{symbol:"₭",name:"Lao kip",symbol_native:"ກີບ",decimal_digits:2,rounding:0,code:"LAK",name_plural:"Lao kips"},LBP:{symbol:"LB£",name:"Lebanese Pound",symbol_native:"ل.ل.‏",decimal_digits:2,rounding:0,code:"LBP",name_plural:"Lebanese pounds"},LKR:{symbol:"SLRs",name:"Sri Lankan Rupee",symbol_native:"SL Re",decimal_digits:2,rounding:0,code:"LKR",name_plural:"Sri Lankan rupees"},LTL:{symbol:"Lt",name:"Lithuanian Litas",symbol_native:"Lt",decimal_digits:2,rounding:0,code:"LTL",name_plural:"Lithuanian litai"},LVL:{symbol:"Ls",name:"Latvian Lats",symbol_native:"Ls",decimal_digits:2,rounding:0,code:"LVL",name_plural:"Latvian lati"},LYD:{symbol:"LD",name:"Libyan Dinar",symbol_native:"د.ل.‏",decimal_digits:3,rounding:0,code:"LYD",name_plural:"Libyan dinars"},MAD:{symbol:"MAD",name:"Moroccan Dirham",symbol_native:"د.م.‏",decimal_digits:2,rounding:0,code:"MAD",name_plural:"Moroccan dirhams"},MDL:{symbol:"MDL",name:"Moldovan Leu",symbol_native:"MDL",decimal_digits:2,rounding:0,code:"MDL",name_plural:"Moldovan lei"},MGA:{symbol:"MGA",name:"Malagasy Ariary",symbol_native:"MGA",decimal_digits:2,rounding:0,code:"MGA",name_plural:"Malagasy Ariaries"},MKD:{symbol:"MKD",name:"Macedonian Denar",symbol_native:"MKD",decimal_digits:2,rounding:0,code:"MKD",name_plural:"Macedonian denari"},MMK:{symbol:"MMK",name:"Myanma Kyat",symbol_native:"K",decimal_digits:2,rounding:0,code:"MMK",name_plural:"Myanma kyats"},MOP:{symbol:"MOP$",name:"Macanese Pataca",symbol_native:"MOP$",decimal_digits:2,rounding:0,code:"MOP",name_plural:"Macanese patacas"},MUR:{symbol:"MURs",name:"Mauritian Rupee",symbol_native:"MURs",decimal_digits:2,rounding:0,code:"MUR",name_plural:"Mauritian rupees"},MXN:{symbol:"MX$",name:"Mexican Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"MXN",name_plural:"Mexican pesos"},MYR:{symbol:"RM",name:"Malaysian Ringgit",symbol_native:"RM",decimal_digits:2,rounding:0,code:"MYR",name_plural:"Malaysian ringgits"},MZN:{symbol:"MTn",name:"Mozambican Metical",symbol_native:"MTn",decimal_digits:2,rounding:0,code:"MZN",name_plural:"Mozambican meticals"},NAD:{symbol:"N$",name:"Namibian Dollar",symbol_native:"N$",decimal_digits:2,rounding:0,code:"NAD",name_plural:"Namibian dollars"},NGN:{symbol:"₦",name:"Nigerian Naira",symbol_native:"₦",decimal_digits:2,rounding:0,code:"NGN",name_plural:"Nigerian nairas"},NIO:{symbol:"C$",name:"Nicaraguan Córdoba",symbol_native:"C$",decimal_digits:2,rounding:0,code:"NIO",name_plural:"Nicaraguan córdobas"},NOK:{symbol:"Nkr",name:"Norwegian Krone",symbol_native:"kr",decimal_digits:2,rounding:0,code:"NOK",name_plural:"Norwegian kroner"},NPR:{symbol:"NPRs",name:"Nepalese Rupee",symbol_native:"नेरू",decimal_digits:2,rounding:0,code:"NPR",name_plural:"Nepalese rupees"},NZD:{symbol:"NZ$",name:"New Zealand Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"NZD",name_plural:"New Zealand dollars"},OMR:{symbol:"OMR",name:"Omani Rial",symbol_native:"ر.ع.‏",decimal_digits:3,rounding:0,code:"OMR",name_plural:"Omani rials"},PAB:{symbol:"B/.",name:"Panamanian Balboa",symbol_native:"B/.",decimal_digits:2,rounding:0,code:"PAB",name_plural:"Panamanian balboas"},PEN:{symbol:"S/.",name:"Peruvian Nuevo Sol",symbol_native:"S/.",decimal_digits:2,rounding:0,code:"PEN",name_plural:"Peruvian nuevos soles"},PHP:{symbol:"₱",name:"Philippine Peso",symbol_native:"₱",decimal_digits:2,rounding:0,code:"PHP",name_plural:"Philippine pesos"},PKR:{symbol:"PKRs",name:"Pakistani Rupee",symbol_native:"₨",decimal_digits:2,rounding:0,code:"PKR",name_plural:"Pakistani rupees"},PLN:{symbol:"zł",name:"Polish Zloty",symbol_native:"zł",decimal_digits:2,rounding:0,code:"PLN",name_plural:"Polish zlotys"},PYG:{symbol:"₲",name:"Paraguayan Guarani",symbol_native:"₲",decimal_digits:0,rounding:0,code:"PYG",name_plural:"Paraguayan guaranis"},QAR:{symbol:"QR",name:"Qatari Rial",symbol_native:"ر.ق.‏",decimal_digits:2,rounding:0,code:"QAR",name_plural:"Qatari rials"},RON:{symbol:"RON",name:"Romanian Leu",symbol_native:"RON",decimal_digits:2,rounding:0,code:"RON",name_plural:"Romanian lei"},RSD:{symbol:"din.",name:"Serbian Dinar",symbol_native:"дин.",decimal_digits:2,rounding:0,code:"RSD",name_plural:"Serbian dinars"},RUB:{symbol:"RUB",name:"Russian Ruble",symbol_native:"₽",decimal_digits:2,rounding:0,code:"RUB",name_plural:"Russian rubles"},RWF:{symbol:"RWF",name:"Rwandan Franc",symbol_native:"FR",decimal_digits:0,rounding:0,code:"RWF",name_plural:"Rwandan francs"},SAR:{symbol:"SR",name:"Saudi Riyal",symbol_native:"ر.س.‏",decimal_digits:2,rounding:0,code:"SAR",name_plural:"Saudi riyals"},SDG:{symbol:"SDG",name:"Sudanese Pound",symbol_native:"SDG",decimal_digits:2,rounding:0,code:"SDG",name_plural:"Sudanese pounds"},SEK:{symbol:"Skr",name:"Swedish Krona",symbol_native:"kr",decimal_digits:2,rounding:0,code:"SEK",name_plural:"Swedish kronor"},SGD:{symbol:"S$",name:"Singapore Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"SGD",name_plural:"Singapore dollars"},SOS:{symbol:"Ssh",name:"Somali Shilling",symbol_native:"Ssh",decimal_digits:2,rounding:0,code:"SOS",name_plural:"Somali shillings"},SYP:{symbol:"SY£",name:"Syrian Pound",symbol_native:"ل.س.‏",decimal_digits:2,rounding:0,code:"SYP",name_plural:"Syrian pounds"},THB:{symbol:"฿",name:"Thai Baht",symbol_native:"฿",decimal_digits:2,rounding:0,code:"THB",name_plural:"Thai baht"},TND:{symbol:"DT",name:"Tunisian Dinar",symbol_native:"د.ت.‏",decimal_digits:3,rounding:0,code:"TND",name_plural:"Tunisian dinars"},TOP:{symbol:"T$",name:"Tongan Paʻanga",symbol_native:"T$",decimal_digits:2,rounding:0,code:"TOP",name_plural:"Tongan paʻanga"},TRY:{symbol:"TL",name:"Turkish Lira",symbol_native:"TL",decimal_digits:2,rounding:0,code:"TRY",name_plural:"Turkish Lira"},TTD:{symbol:"TT$",name:"Trinidad and Tobago Dollar",symbol_native:"$",decimal_digits:2,rounding:0,code:"TTD",name_plural:"Trinidad and Tobago dollars"},TWD:{symbol:"NT$",name:"New Taiwan Dollar",symbol_native:"NT$",decimal_digits:2,rounding:0,code:"TWD",name_plural:"New Taiwan dollars"},TZS:{symbol:"TSh",name:"Tanzanian Shilling",symbol_native:"TSh",decimal_digits:2,rounding:0,code:"TZS",name_plural:"Tanzanian shillings"},UAH:{symbol:"₴",name:"Ukrainian Hryvnia",symbol_native:"₴",decimal_digits:2,rounding:0,code:"UAH",name_plural:"Ukrainian hryvnias"},UGX:{symbol:"USh",name:"Ugandan Shilling",symbol_native:"USh",decimal_digits:0,rounding:0,code:"UGX",name_plural:"Ugandan shillings"},UYU:{symbol:"$U",name:"Uruguayan Peso",symbol_native:"$",decimal_digits:2,rounding:0,code:"UYU",name_plural:"Uruguayan pesos"},UZS:{symbol:"UZS",name:"Uzbekistan Som",symbol_native:"UZS",decimal_digits:2,rounding:0,code:"UZS",name_plural:"Uzbekistan som"},VEF:{symbol:"Bs.F.",name:"Venezuelan Bolívar",symbol_native:"Bs.F.",decimal_digits:2,rounding:0,code:"VEF",name_plural:"Venezuelan bolívars"},VND:{symbol:"₫",name:"Vietnamese Dong",symbol_native:"₫",decimal_digits:0,rounding:0,code:"VND",name_plural:"Vietnamese dong"},XAF:{symbol:"FCFA",name:"CFA Franc BEAC",symbol_native:"FCFA",decimal_digits:0,rounding:0,code:"XAF",name_plural:"CFA francs BEAC"},XOF:{symbol:"CFA",name:"CFA Franc BCEAO",symbol_native:"CFA",decimal_digits:0,rounding:0,code:"XOF",name_plural:"CFA francs BCEAO"},YER:{symbol:"YR",name:"Yemeni Rial",symbol_native:"ر.ي.‏",decimal_digits:2,rounding:0,code:"YER",name_plural:"Yemeni rials"},ZAR:{symbol:"R",name:"South African Rand",symbol_native:"R",decimal_digits:2,rounding:0,code:"ZAR",name_plural:"South African rand"},ZMK:{symbol:"ZK",name:"Zambian Kwacha",symbol_native:"ZK",decimal_digits:0,rounding:0,code:"ZMK",name_plural:"Zambian kwachas"}},Au=class Au extends YOe{constructor(){super(...arguments);He(this,"toString",()=>this.code)}get symbol(){return this.props?String(this.props.symbol_native):""}get code(){return this.props?String(this.props.code):""}static validate(n,r){const s=dr.alternatives(Jl.RULE_ALLOW_EMPTY.default(""),dr.string().uppercase().valid(...Object.keys(QT)).label(String(r.label)));return Jl.validate(s,n)}static createFromCode(n,r={}){const s={...r,label:r.label?r.label:"current_code"},i=Au.validate(n,s);return i.isFailure?xa.fail(TQ(i0.INVALID_INPUT_DATA,i.error.message,s)):xa.ok(new Au(QT[i.object]))}static createDefaultCode(){return Au.createFromCode(Au.DEFAULT_CURRENCY_CODE)}isEmpty(){return this.isNull()||this.props===void 0}toPrimitive(){return this.toString()}};He(Au,"DEFAULT_CURRENCY_CODE","EUR"),He(Au,"CURRENCIES",QT);let DC=Au;class MUe extends dr.ValidationError{}var XOe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},QOe={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function vb(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vb=function(e){return typeof e}:vb=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vb(t)}function S4(t){return ZOe(t)||JOe(t)||eMe(t)||tMe()}function ZOe(t){if(Array.isArray(t))return t}function JOe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function eMe(t,e){if(t){if(typeof t=="string")return E4(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E4(t,e)}}function E4(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=0}function sMe(t){return t.length>0&&t.every(function(e){return e>=0})&&t.some(function(e){return e>0})}function C4(t){return t%2===0}function A4(t){return NQ(t)&&!Number.isInteger(t)}function iMe(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=t.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var n=e.split(".")[1];return n?n.length:0}function Ay(t){return Math.abs(t)%1===.5}function oMe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var s=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){s.readyState===4&&(s.status>=200&&s.status<400?n(JSON.parse(s.responseText)):r(new Error(s.statusText)))},onerror:function(){r(new Error("Network error"))}});s.open("GET",t,!0),aMe(s,e.headers),s.send()})}function aMe(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in e)t.setRequestHeader(n,e[n]);return t}function Uy(t){return typeof t>"u"}function OQ(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(t).forEach(function(r){if(vb(r[1])==="object"){var s=OQ(r[1]);Object.entries(s).forEach(function(i){n[r[0]+e+i[0]]=i[1]})}else n[r[0]]=r[1]}),n}function lMe(t){return!!t&&(vb(t)==="object"||typeof t=="function")&&typeof t.then=="function"}function MQ(){var t=function(r,s){var i=function(c){return Math.pow(10,iMe(c))},a=Math.max(i(r),i(s));return Math.round(r*a)*Math.round(s*a)/(a*a)},e={HALF_ODD:function(r){var s=Math.round(r);return Ay(r)&&C4(s)?s-1:s},HALF_EVEN:function(r){var s=Math.round(r);return Ay(r)?C4(s)?s:s-1:s},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Ay(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Ay(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Ay(r)?Math.sign(r)*Math.ceil(Math.abs(r)):Math.round(r)},DOWN:function(r){return Math.floor(r)}};return{add:function(r,s){return r+s},subtract:function(r,s){return r-s},multiply:function(r,s){return A4(r)||A4(s)?t(r,s):r*s},divide:function(r,s){return r/s},modulo:function(r,s){return r%s},round:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[s](r)}}}var cMe=MQ();function uMe(t){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(t);return{getMatches:function(){return e!==null?e.slice(1).filter(function(r){return!Uy(r)}):[]},getMinimumFractionDigits:function(){var r=function(i){return i==="."};return Uy(this.getMatches().find(r))?0:this.getMatches()[cMe.add(this.getMatches().findIndex(r),1)].split("").length},getCurrencyDisplay:function(){var r={USD:"code",dollar:"name",$:"symbol"};return r[this.getMatches().find(function(s){return s==="USD"||s==="dollar"||s==="$"})]},getStyle:function(){return Uy(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Uy(this.getMatches().find(function(r){return r===","}))}}}function dMe(t){var e=function(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;for(var a in i)s=s.replace("{{".concat(a,"}}"),i[a]);return s},n=function(s,i){return oMe(e(t.endpoint,{from:s,to:i}),{headers:t.headers})};return{getExchangeRate:function(s,i){return(lMe(t.endpoint)?t.endpoint:n(s,i)).then(function(a){return OQ(a)[e(t.propertyPath,{from:s,to:i})]})}}}function o0(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!t)throw new n(e)}function fMe(t){o0(rMe(t),"You must provide a numeric value between 0 and 100.",RangeError)}function hMe(t){o0(sMe(t),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ZT(t){o0(Number.isInteger(t),"You must provide an integer.",TypeError)}var Fn=MQ(),pMe=function t(e){var n=Object.assign({},{amount:t.defaultAmount,currency:t.defaultCurrency,precision:t.defaultPrecision},e),r=n.amount,s=n.currency,i=n.precision;ZT(r),ZT(i);var a=t.globalLocale,o=t.globalFormat,c=t.globalRoundingMode,u=t.globalFormatRoundingMode,f=Object.assign({},t.globalExchangeRatesApi),l=function(p){var h=Object.assign({},Object.assign({},{amount:r,currency:s,precision:i},p),Object.assign({},{locale:this.locale},p));return Object.assign(t({amount:h.amount,currency:h.currency,precision:h.precision}),{locale:h.locale})},d=function(p){o0(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return s},getLocale:function(){return this.locale||a},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return i},convertPrecision:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;ZT(p);var y=this.getPrecision(),g=p>y,v=g?Fn.multiply:Fn.divide,w=g?[p,y]:[y,p],x=Math.pow(10,Fn.subtract.apply(Fn,w));return l.call(this,{amount:Fn.round(v(this.getAmount(),x),h),precision:p})},add:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return l.call(this,{amount:Fn.add(h[0].getAmount(),h[1].getAmount()),precision:h[0].getPrecision()})},subtract:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return l.call(this,{amount:Fn.subtract(h[0].getAmount(),h[1].getAmount()),precision:h[0].getPrecision()})},multiply:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Fn.round(Fn.multiply(this.getAmount(),p),h)})},divide:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return l.call(this,{amount:Fn.round(Fn.divide(this.getAmount(),p),h)})},percentage:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;return fMe(p),this.multiply(Fn.divide(p,100),h)},allocate:function(p){var h=this;hMe(p);for(var y=p.reduce(function(x,A){return Fn.add(x,A)}),g=this.getAmount(),v=p.map(function(x){var A=Math.floor(Fn.divide(Fn.multiply(h.getAmount(),x),y));return g=Fn.subtract(g,A),l.call(h,{amount:A})}),w=0;g>0;)p[w]>0&&(v[w]=v[w].add(l.call(this,{amount:1})),g=Fn.subtract(g,1)),w+=1;return v},convert:function(p){var h=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=y.endpoint,v=g===void 0?f.endpoint:g,w=y.propertyPath,x=w===void 0?f.propertyPath||"rates.{{to}}":w,A=y.headers,k=A===void 0?f.headers:A,R=y.roundingMode,E=R===void 0?c:R,T=Object.assign({},{endpoint:v,propertyPath:x,headers:k,roundingMode:E});return dMe(T).getExchangeRate(this.getCurrency(),p).then(function(D){return o0(!Uy(D),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(h,{amount:Fn.round(Fn.multiply(h.getAmount(),parseFloat(D)),T.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()h[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var h=t.normalizePrecision([this,p]);return h[0].getAmount()>=h[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return Fn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasCents:function(){return Fn.modulo(this.getAmount(),Math.pow(10,i))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var h=t.normalizePrecision([this,p]);return h[0].getAmount()===h[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=uMe(p);return this.toRoundedUnit(y.getMinimumFractionDigits(),h).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return Fn.divide(this.getAmount(),Math.pow(10,i))},toRoundedUnit:function(p){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,p);return Fn.divide(Fn.round(Fn.multiply(this.toUnit(),y),h),y)},toObject:function(){return{amount:r,currency:s,precision:i}},toJSON:function(){return this.toObject()}}},bS=Object.assign(pMe,XOe,QOe,nMe),NC={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */DC.exports;(function(t,e){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",l=1,d=2,m=4,p=1,h=2,y=1,g=2,v=4,w=8,x=16,A=32,k=64,R=128,E=256,T=512,D=30,O="...",L=800,I=16,F=1,U=2,Y=3,V=1/0,H=9007199254740991,ee=17976931348623157e292,re=NaN,X=4294967295,q=X-1,K=X>>>1,Z=[["ary",R],["bind",y],["bindKey",g],["curry",w],["curryRight",x],["flip",T],["partial",A],["partialRight",k],["rearg",E]],ue="[object Arguments]",de="[object Array]",ie="[object AsyncFunction]",be="[object Boolean]",Ae="[object Date]",_e="[object DOMException]",Me="[object Error]",Ne="[object Function]",ye="[object GeneratorFunction]",$e="[object Map]",ut="[object Number]",Qe="[object Null]",vt="[object Object]",Sn="[object Promise]",Yt="[object Proxy]",mn="[object RegExp]",Xt="[object Set]",J="[object String]",fe="[object Symbol]",ge="[object Undefined]",Pe="[object WeakMap]",Oe="[object WeakSet]",xe="[object ArrayBuffer]",Te="[object DataView]",Ye="[object Float32Array]",Rt="[object Float64Array]",bt="[object Int8Array]",Os="[object Int16Array]",Kn="[object Int32Array]",ps="[object Uint8Array]",Ut="[object Uint8ClampedArray]",on="[object Uint16Array]",gn="[object Uint32Array]",Be=/\b__p \+= '';/g,it=/\b(__p \+=) '' \+/g,ot=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,nt=/[&<>"']/g,Ht=RegExp(St.source),Ct=RegExp(nt.source),vn=/<%-([\s\S]+?)%>/g,an=/<%([\s\S]+?)%>/g,ln=/<%=([\s\S]+?)%>/g,Tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hr=/^\w*$/,kn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(te.source),he=/^\s+/,Ce=/\s/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qe=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xe=/[()=,{}\[\]\/\s]/,We=/\\(\\)?/g,Je=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mt=/\w*$/,Lt=/^[-+]0x[0-9a-f]+$/i,Rr=/^0b[01]+$/i,yn=/^\[object .+?Constructor\]$/,Wt=/^0o[0-7]+$/i,Hn=/^(?:0|[1-9]\d*)$/,Jc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ma=/($^)/,Ho=/['\n\r\u2028\u2029\\]/g,Ms="\\ud800-\\udfff",Bv="\\u0300-\\u036f",Wd="\\ufe20-\\ufe2f",Pl="\\u20d0-\\u20ff",Gd=Bv+Wd+Pl,qd="\\u2700-\\u27bf",$t="a-z\\xdf-\\xf6\\xf8-\\xff",Vn="\\xac\\xb1\\xd7\\xf7",eu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kd="\\u2000-\\u206f",ir=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Tl="A-Z\\xc0-\\xd6\\xd8-\\xde",Uv="\\ufe0e\\ufe0f",V_=Vn+eu+Kd+ir,dR="['’]",vte="["+Ms+"]",s2="["+V_+"]",W_="["+Gd+"]",i2="\\d+",yte="["+qd+"]",o2="["+$t+"]",a2="[^"+Ms+V_+i2+qd+$t+Tl+"]",fR="\\ud83c[\\udffb-\\udfff]",bte="(?:"+W_+"|"+fR+")",l2="[^"+Ms+"]",hR="(?:\\ud83c[\\udde6-\\uddff]){2}",pR="[\\ud800-\\udbff][\\udc00-\\udfff]",yp="["+Tl+"]",c2="\\u200d",u2="(?:"+o2+"|"+a2+")",wte="(?:"+yp+"|"+a2+")",d2="(?:"+dR+"(?:d|ll|m|re|s|t|ve))?",f2="(?:"+dR+"(?:D|LL|M|RE|S|T|VE))?",h2=bte+"?",p2="["+Uv+"]?",_te="(?:"+c2+"(?:"+[l2,hR,pR].join("|")+")"+p2+h2+")*",xte="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ste="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",m2=p2+h2+_te,Ete="(?:"+[yte,hR,pR].join("|")+")"+m2,Cte="(?:"+[l2+W_+"?",W_,hR,pR,vte].join("|")+")",Ate=RegExp(dR,"g"),Rte=RegExp(W_,"g"),mR=RegExp(fR+"(?="+fR+")|"+Cte+m2,"g"),Pte=RegExp([yp+"?"+o2+"+"+d2+"(?="+[s2,yp,"$"].join("|")+")",wte+"+"+f2+"(?="+[s2,yp+u2,"$"].join("|")+")",yp+"?"+u2+"+"+d2,yp+"+"+f2,Ste,xte,i2,Ete].join("|"),"g"),Tte=RegExp("["+c2+Ms+Gd+Uv+"]"),kte=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Dte=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nte=-1,In={};In[Ye]=In[Rt]=In[bt]=In[Os]=In[Kn]=In[ps]=In[Ut]=In[on]=In[gn]=!0,In[ue]=In[de]=In[xe]=In[be]=In[Te]=In[Ae]=In[Me]=In[Ne]=In[$e]=In[ut]=In[vt]=In[mn]=In[Xt]=In[J]=In[Pe]=!1;var Dn={};Dn[ue]=Dn[de]=Dn[xe]=Dn[Te]=Dn[be]=Dn[Ae]=Dn[Ye]=Dn[Rt]=Dn[bt]=Dn[Os]=Dn[Kn]=Dn[$e]=Dn[ut]=Dn[vt]=Dn[mn]=Dn[Xt]=Dn[J]=Dn[fe]=Dn[ps]=Dn[Ut]=Dn[on]=Dn[gn]=!0,Dn[Me]=Dn[Ne]=Dn[Pe]=!1;var Ote={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Mte={"&":"&","<":"<",">":">",'"':""","'":"'"},Lte={"&":"&","<":"<",">":">",""":'"',"'":"'"},Ite={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$te=parseFloat,Fte=parseInt,g2=typeof yr=="object"&&yr&&yr.Object===Object&&yr,jte=typeof self=="object"&&self&&self.Object===Object&&self,Jr=g2||jte||Function("return this")(),gR=e&&!e.nodeType&&e,Yd=gR&&!0&&t&&!t.nodeType&&t,v2=Yd&&Yd.exports===gR,vR=v2&&g2.process,co=function(){try{var ae=Yd&&Yd.require&&Yd.require("util").types;return ae||vR&&vR.binding&&vR.binding("util")}catch{}}(),y2=co&&co.isArrayBuffer,b2=co&&co.isDate,w2=co&&co.isMap,_2=co&&co.isRegExp,x2=co&&co.isSet,S2=co&&co.isTypedArray;function Ti(ae,we,pe){switch(pe.length){case 0:return ae.call(we);case 1:return ae.call(we,pe[0]);case 2:return ae.call(we,pe[0],pe[1]);case 3:return ae.call(we,pe[0],pe[1],pe[2])}return ae.apply(we,pe)}function zte(ae,we,pe,Ve){for(var gt=-1,en=ae==null?0:ae.length;++gt-1}function yR(ae,we,pe){for(var Ve=-1,gt=ae==null?0:ae.length;++Ve-1;);return pe}function D2(ae,we){for(var pe=ae.length;pe--&&bp(we,ae[pe],0)>-1;);return pe}function Yte(ae,we){for(var pe=ae.length,Ve=0;pe--;)ae[pe]===we&&++Ve;return Ve}var Xte=xR(Ote),Qte=xR(Mte);function Zte(ae){return"\\"+Ite[ae]}function Jte(ae,we){return ae==null?n:ae[we]}function wp(ae){return Tte.test(ae)}function ene(ae){return kte.test(ae)}function tne(ae){for(var we,pe=[];!(we=ae.next()).done;)pe.push(we.value);return pe}function AR(ae){var we=-1,pe=Array(ae.size);return ae.forEach(function(Ve,gt){pe[++we]=[gt,Ve]}),pe}function N2(ae,we){return function(pe){return ae(we(pe))}}function ru(ae,we){for(var pe=-1,Ve=ae.length,gt=0,en=[];++pe-1}function Une(b,S){var N=this.__data__,M=cx(N,b);return M<0?(++this.size,N.push([b,S])):N[M][1]=S,this}kl.prototype.clear=Fne,kl.prototype.delete=jne,kl.prototype.get=zne,kl.prototype.has=Bne,kl.prototype.set=Une;function Dl(b){var S=-1,N=b==null?0:b.length;for(this.clear();++S=S?b:S)),b}function po(b,S,N,M,j,G){var Q,ne=S&l,le=S&d,Se=S&m;if(N&&(Q=j?N(b,M,j,G):N(b)),Q!==n)return Q;if(!Yn(b))return b;var Ee=yt(b);if(Ee){if(Q=Gre(b),!ne)return ti(b,Q)}else{var Re=gs(b),Fe=Re==Ne||Re==ye;if(cu(b))return pF(b,ne);if(Re==vt||Re==ue||Fe&&!j){if(Q=le||Fe?{}:OF(b),!ne)return le?Lre(b,sre(Q,b)):Mre(b,V2(Q,b))}else{if(!Dn[Re])return j?b:{};Q=qre(b,Re,ne)}}G||(G=new Wo);var Ze=G.get(b);if(Ze)return Ze;G.set(b,Q),lj(b)?b.forEach(function(ct){Q.add(po(ct,S,N,ct,b,G))}):oj(b)&&b.forEach(function(ct,kt){Q.set(kt,po(ct,S,N,kt,b,G))});var lt=Se?le?ZR:QR:le?ri:Vr,Et=Ee?n:lt(b);return uo(Et||b,function(ct,kt){Et&&(kt=ct,ct=b[kt]),Yv(Q,kt,po(ct,S,N,kt,b,G))}),Q}function ire(b){var S=Vr(b);return function(N){return W2(N,b,S)}}function W2(b,S,N){var M=N.length;if(b==null)return!M;for(b=En(b);M--;){var j=N[M],G=S[j],Q=b[j];if(Q===n&&!(j in b)||!G(Q))return!1}return!0}function G2(b,S,N){if(typeof b!="function")throw new fo(a);return ny(function(){b.apply(n,N)},S)}function Xv(b,S,N,M){var j=-1,G=G_,Q=!0,ne=b.length,le=[],Se=S.length;if(!ne)return le;N&&(S=Wn(S,ki(N))),M?(G=yR,Q=!1):S.length>=s&&(G=Hv,Q=!1,S=new Zd(S));e:for(;++jj?0:j+N),M=M===n||M>j?j:_t(M),M<0&&(M+=j),M=N>M?0:uj(M);N0&&N(ne)?S>1?es(ne,S-1,N,M,j):nu(j,ne):M||(j[j.length]=ne)}return j}var OR=wF(),Y2=wF(!0);function La(b,S){return b&&OR(b,S,Vr)}function MR(b,S){return b&&Y2(b,S,Vr)}function dx(b,S){return tu(S,function(N){return Il(b[N])})}function ef(b,S){S=au(S,b);for(var N=0,M=S.length;b!=null&&NS}function lre(b,S){return b!=null&&cn.call(b,S)}function cre(b,S){return b!=null&&S in En(b)}function ure(b,S,N){return b>=ms(S,N)&&b=120&&Ee.length>=120)?new Zd(Q&&Ee):n}Ee=b[0];var Re=-1,Fe=ne[0];e:for(;++Re-1;)ne!==b&&nx.call(ne,le,1),nx.call(b,le,1);return b}function oF(b,S){for(var N=b?S.length:0,M=N-1;N--;){var j=S[N];if(N==M||j!==G){var G=j;Ll(j)?nx.call(b,j,1):VR(b,j)}}return b}function BR(b,S){return b+ix(z2()*(S-b+1))}function Sre(b,S,N,M){for(var j=-1,G=Tr(sx((S-b)/(N||1)),0),Q=pe(G);G--;)Q[M?G:++j]=b,b+=N;return Q}function UR(b,S){var N="";if(!b||S<1||S>H)return N;do S%2&&(N+=b),S=ix(S/2),S&&(b+=b);while(S);return N}function At(b,S){return iP(IF(b,S,si),b+"")}function Ere(b){return H2(Dp(b))}function Cre(b,S){var N=Dp(b);return xx(N,Jd(S,0,N.length))}function Jv(b,S,N,M){if(!Yn(b))return b;S=au(S,b);for(var j=-1,G=S.length,Q=G-1,ne=b;ne!=null&&++jj?0:j+S),N=N>j?j:N,N<0&&(N+=j),j=S>N?0:N-S>>>0,S>>>=0;for(var G=pe(j);++M>>1,Q=b[G];Q!==null&&!Ni(Q)&&(N?Q<=S:Q=s){var Se=S?null:jre(b);if(Se)return K_(Se);Q=!1,j=Hv,le=new Zd}else le=S?[]:ne;e:for(;++M=M?b:mo(b,S,N)}var hF=gne||function(b){return Jr.clearTimeout(b)};function pF(b,S){if(S)return b.slice();var N=b.length,M=L2?L2(N):new b.constructor(N);return b.copy(M),M}function KR(b){var S=new b.constructor(b.byteLength);return new ex(S).set(new ex(b)),S}function kre(b,S){var N=S?KR(b.buffer):b.buffer;return new b.constructor(N,b.byteOffset,b.byteLength)}function Dre(b){var S=new b.constructor(b.source,mt.exec(b));return S.lastIndex=b.lastIndex,S}function Nre(b){return Kv?En(Kv.call(b)):{}}function mF(b,S){var N=S?KR(b.buffer):b.buffer;return new b.constructor(N,b.byteOffset,b.length)}function gF(b,S){if(b!==S){var N=b!==n,M=b===null,j=b===b,G=Ni(b),Q=S!==n,ne=S===null,le=S===S,Se=Ni(S);if(!ne&&!Se&&!G&&b>S||G&&Q&&le&&!ne&&!Se||M&&Q&&le||!N&&le||!j)return 1;if(!M&&!G&&!Se&&b=ne)return le;var Se=N[M];return le*(Se=="desc"?-1:1)}}return b.index-S.index}function vF(b,S,N,M){for(var j=-1,G=b.length,Q=N.length,ne=-1,le=S.length,Se=Tr(G-Q,0),Ee=pe(le+Se),Re=!M;++ne1?N[j-1]:n,Q=j>2?N[2]:n;for(G=b.length>3&&typeof G=="function"?(j--,G):n,Q&&Is(N[0],N[1],Q)&&(G=j<3?n:G,j=1),S=En(S);++M-1?j[G?S[Q]:Q]:n}}function SF(b){return Ml(function(S){var N=S.length,M=N,j=ho.prototype.thru;for(b&&S.reverse();M--;){var G=S[M];if(typeof G!="function")throw new fo(a);if(j&&!Q&&wx(G)=="wrapper")var Q=new ho([],!0)}for(M=Q?M:N;++M1&&Ft.reverse(),Ee&&lene))return!1;var Se=G.get(b),Ee=G.get(S);if(Se&&Ee)return Se==S&&Ee==b;var Re=-1,Fe=!0,Ze=N&h?new Zd:n;for(G.set(b,S),G.set(S,b);++Re1?"& ":"")+S[M],S=S.join(N>2?", ":" "),b.replace(Le,`{ + */NC.exports;(function(t,e){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",o="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",l=1,d=2,m=4,p=1,h=2,y=1,g=2,v=4,w=8,x=16,A=32,k=64,R=128,E=256,T=512,D=30,O="...",L=800,I=16,F=1,U=2,Y=3,V=1/0,H=9007199254740991,ee=17976931348623157e292,re=NaN,X=4294967295,q=X-1,K=X>>>1,Z=[["ary",R],["bind",y],["bindKey",g],["curry",w],["curryRight",x],["flip",T],["partial",A],["partialRight",k],["rearg",E]],ue="[object Arguments]",de="[object Array]",ie="[object AsyncFunction]",be="[object Boolean]",Ae="[object Date]",_e="[object DOMException]",Me="[object Error]",Ne="[object Function]",ye="[object GeneratorFunction]",$e="[object Map]",ut="[object Number]",Qe="[object Null]",vt="[object Object]",Sn="[object Promise]",Yt="[object Proxy]",mn="[object RegExp]",Xt="[object Set]",J="[object String]",fe="[object Symbol]",ge="[object Undefined]",Pe="[object WeakMap]",Oe="[object WeakSet]",xe="[object ArrayBuffer]",Te="[object DataView]",Ye="[object Float32Array]",Rt="[object Float64Array]",bt="[object Int8Array]",Os="[object Int16Array]",Kn="[object Int32Array]",ps="[object Uint8Array]",Ut="[object Uint8ClampedArray]",on="[object Uint16Array]",gn="[object Uint32Array]",Be=/\b__p \+= '';/g,it=/\b(__p \+=) '' \+/g,ot=/(__e\(.*?\)|\b__t\)) \+\n'';/g,St=/&(?:amp|lt|gt|quot|#39);/g,nt=/[&<>"']/g,Ht=RegExp(St.source),Ct=RegExp(nt.source),vn=/<%-([\s\S]+?)%>/g,an=/<%([\s\S]+?)%>/g,ln=/<%=([\s\S]+?)%>/g,Tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hr=/^\w*$/,kn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(te.source),he=/^\s+/,Ce=/\s/,Le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,qe=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,Ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xe=/[()=,{}\[\]\/\s]/,We=/\\(\\)?/g,Je=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mt=/\w*$/,Lt=/^[-+]0x[0-9a-f]+$/i,Rr=/^0b[01]+$/i,yn=/^\[object .+?Constructor\]$/,Wt=/^0o[0-7]+$/i,Hn=/^(?:0|[1-9]\d*)$/,Jc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,La=/($^)/,Vo=/['\n\r\u2028\u2029\\]/g,Ms="\\ud800-\\udfff",Bv="\\u0300-\\u036f",Wd="\\ufe20-\\ufe2f",Tl="\\u20d0-\\u20ff",Gd=Bv+Wd+Tl,qd="\\u2700-\\u27bf",$t="a-z\\xdf-\\xf6\\xf8-\\xff",Vn="\\xac\\xb1\\xd7\\xf7",eu="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Kd="\\u2000-\\u206f",ir=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",kl="A-Z\\xc0-\\xd6\\xd8-\\xde",Uv="\\ufe0e\\ufe0f",W_=Vn+eu+Kd+ir,fR="['’]",_te="["+Ms+"]",a2="["+W_+"]",G_="["+Gd+"]",l2="\\d+",xte="["+qd+"]",c2="["+$t+"]",u2="[^"+Ms+W_+l2+qd+$t+kl+"]",hR="\\ud83c[\\udffb-\\udfff]",Ste="(?:"+G_+"|"+hR+")",d2="[^"+Ms+"]",pR="(?:\\ud83c[\\udde6-\\uddff]){2}",mR="[\\ud800-\\udbff][\\udc00-\\udfff]",bp="["+kl+"]",f2="\\u200d",h2="(?:"+c2+"|"+u2+")",Ete="(?:"+bp+"|"+u2+")",p2="(?:"+fR+"(?:d|ll|m|re|s|t|ve))?",m2="(?:"+fR+"(?:D|LL|M|RE|S|T|VE))?",g2=Ste+"?",v2="["+Uv+"]?",Cte="(?:"+f2+"(?:"+[d2,pR,mR].join("|")+")"+v2+g2+")*",Ate="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rte="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",y2=v2+g2+Cte,Pte="(?:"+[xte,pR,mR].join("|")+")"+y2,Tte="(?:"+[d2+G_+"?",G_,pR,mR,_te].join("|")+")",kte=RegExp(fR,"g"),Dte=RegExp(G_,"g"),gR=RegExp(hR+"(?="+hR+")|"+Tte+y2,"g"),Nte=RegExp([bp+"?"+c2+"+"+p2+"(?="+[a2,bp,"$"].join("|")+")",Ete+"+"+m2+"(?="+[a2,bp+h2,"$"].join("|")+")",bp+"?"+h2+"+"+p2,bp+"+"+m2,Rte,Ate,l2,Pte].join("|"),"g"),Ote=RegExp("["+f2+Ms+Gd+Uv+"]"),Mte=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Lte=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ite=-1,In={};In[Ye]=In[Rt]=In[bt]=In[Os]=In[Kn]=In[ps]=In[Ut]=In[on]=In[gn]=!0,In[ue]=In[de]=In[xe]=In[be]=In[Te]=In[Ae]=In[Me]=In[Ne]=In[$e]=In[ut]=In[vt]=In[mn]=In[Xt]=In[J]=In[Pe]=!1;var Dn={};Dn[ue]=Dn[de]=Dn[xe]=Dn[Te]=Dn[be]=Dn[Ae]=Dn[Ye]=Dn[Rt]=Dn[bt]=Dn[Os]=Dn[Kn]=Dn[$e]=Dn[ut]=Dn[vt]=Dn[mn]=Dn[Xt]=Dn[J]=Dn[fe]=Dn[ps]=Dn[Ut]=Dn[on]=Dn[gn]=!0,Dn[Me]=Dn[Ne]=Dn[Pe]=!1;var $te={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Fte={"&":"&","<":"<",">":">",'"':""","'":"'"},jte={"&":"&","<":"<",">":">",""":'"',"'":"'"},zte={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Bte=parseFloat,Ute=parseInt,b2=typeof yr=="object"&&yr&&yr.Object===Object&&yr,Hte=typeof self=="object"&&self&&self.Object===Object&&self,Jr=b2||Hte||Function("return this")(),vR=e&&!e.nodeType&&e,Yd=vR&&!0&&t&&!t.nodeType&&t,w2=Yd&&Yd.exports===vR,yR=w2&&b2.process,co=function(){try{var ae=Yd&&Yd.require&&Yd.require("util").types;return ae||yR&&yR.binding&&yR.binding("util")}catch{}}(),_2=co&&co.isArrayBuffer,x2=co&&co.isDate,S2=co&&co.isMap,E2=co&&co.isRegExp,C2=co&&co.isSet,A2=co&&co.isTypedArray;function Ti(ae,we,pe){switch(pe.length){case 0:return ae.call(we);case 1:return ae.call(we,pe[0]);case 2:return ae.call(we,pe[0],pe[1]);case 3:return ae.call(we,pe[0],pe[1],pe[2])}return ae.apply(we,pe)}function Vte(ae,we,pe,Ve){for(var gt=-1,en=ae==null?0:ae.length;++gt-1}function bR(ae,we,pe){for(var Ve=-1,gt=ae==null?0:ae.length;++Ve-1;);return pe}function M2(ae,we){for(var pe=ae.length;pe--&&wp(we,ae[pe],0)>-1;);return pe}function Jte(ae,we){for(var pe=ae.length,Ve=0;pe--;)ae[pe]===we&&++Ve;return Ve}var ene=SR($te),tne=SR(Fte);function nne(ae){return"\\"+zte[ae]}function rne(ae,we){return ae==null?n:ae[we]}function _p(ae){return Ote.test(ae)}function sne(ae){return Mte.test(ae)}function ine(ae){for(var we,pe=[];!(we=ae.next()).done;)pe.push(we.value);return pe}function RR(ae){var we=-1,pe=Array(ae.size);return ae.forEach(function(Ve,gt){pe[++we]=[gt,Ve]}),pe}function L2(ae,we){return function(pe){return ae(we(pe))}}function ru(ae,we){for(var pe=-1,Ve=ae.length,gt=0,en=[];++pe-1}function Gne(b,S){var N=this.__data__,M=ux(N,b);return M<0?(++this.size,N.push([b,S])):N[M][1]=S,this}Dl.prototype.clear=Une,Dl.prototype.delete=Hne,Dl.prototype.get=Vne,Dl.prototype.has=Wne,Dl.prototype.set=Gne;function Nl(b){var S=-1,N=b==null?0:b.length;for(this.clear();++S=S?b:S)),b}function po(b,S,N,M,j,G){var Q,ne=S&l,le=S&d,Se=S&m;if(N&&(Q=j?N(b,M,j,G):N(b)),Q!==n)return Q;if(!Yn(b))return b;var Ee=yt(b);if(Ee){if(Q=Xre(b),!ne)return ti(b,Q)}else{var Re=gs(b),Fe=Re==Ne||Re==ye;if(cu(b))return vF(b,ne);if(Re==vt||Re==ue||Fe&&!j){if(Q=le||Fe?{}:IF(b),!ne)return le?jre(b,lre(Q,b)):Fre(b,q2(Q,b))}else{if(!Dn[Re])return j?b:{};Q=Qre(b,Re,ne)}}G||(G=new Go);var Ze=G.get(b);if(Ze)return Ze;G.set(b,Q),dj(b)?b.forEach(function(ct){Q.add(po(ct,S,N,ct,b,G))}):cj(b)&&b.forEach(function(ct,kt){Q.set(kt,po(ct,S,N,kt,b,G))});var lt=Se?le?JR:ZR:le?ri:Vr,Et=Ee?n:lt(b);return uo(Et||b,function(ct,kt){Et&&(kt=ct,ct=b[kt]),Yv(Q,kt,po(ct,S,N,kt,b,G))}),Q}function cre(b){var S=Vr(b);return function(N){return K2(N,b,S)}}function K2(b,S,N){var M=N.length;if(b==null)return!M;for(b=En(b);M--;){var j=N[M],G=S[j],Q=b[j];if(Q===n&&!(j in b)||!G(Q))return!1}return!0}function Y2(b,S,N){if(typeof b!="function")throw new fo(a);return ny(function(){b.apply(n,N)},S)}function Xv(b,S,N,M){var j=-1,G=q_,Q=!0,ne=b.length,le=[],Se=S.length;if(!ne)return le;N&&(S=Wn(S,ki(N))),M?(G=bR,Q=!1):S.length>=s&&(G=Hv,Q=!1,S=new Zd(S));e:for(;++jj?0:j+N),M=M===n||M>j?j:_t(M),M<0&&(M+=j),M=N>M?0:hj(M);N0&&N(ne)?S>1?es(ne,S-1,N,M,j):nu(j,ne):M||(j[j.length]=ne)}return j}var MR=SF(),Z2=SF(!0);function Ia(b,S){return b&&MR(b,S,Vr)}function LR(b,S){return b&&Z2(b,S,Vr)}function fx(b,S){return tu(S,function(N){return $l(b[N])})}function ef(b,S){S=au(S,b);for(var N=0,M=S.length;b!=null&&NS}function fre(b,S){return b!=null&&cn.call(b,S)}function hre(b,S){return b!=null&&S in En(b)}function pre(b,S,N){return b>=ms(S,N)&&b=120&&Ee.length>=120)?new Zd(Q&&Ee):n}Ee=b[0];var Re=-1,Fe=ne[0];e:for(;++Re-1;)ne!==b&&rx.call(ne,le,1),rx.call(b,le,1);return b}function cF(b,S){for(var N=b?S.length:0,M=N-1;N--;){var j=S[N];if(N==M||j!==G){var G=j;Il(j)?rx.call(b,j,1):WR(b,j)}}return b}function UR(b,S){return b+ox(H2()*(S-b+1))}function Rre(b,S,N,M){for(var j=-1,G=Tr(ix((S-b)/(N||1)),0),Q=pe(G);G--;)Q[M?G:++j]=b,b+=N;return Q}function HR(b,S){var N="";if(!b||S<1||S>H)return N;do S%2&&(N+=b),S=ox(S/2),S&&(b+=b);while(S);return N}function At(b,S){return oP(jF(b,S,si),b+"")}function Pre(b){return G2(Np(b))}function Tre(b,S){var N=Np(b);return Sx(N,Jd(S,0,N.length))}function Jv(b,S,N,M){if(!Yn(b))return b;S=au(S,b);for(var j=-1,G=S.length,Q=G-1,ne=b;ne!=null&&++jj?0:j+S),N=N>j?j:N,N<0&&(N+=j),j=S>N?0:N-S>>>0,S>>>=0;for(var G=pe(j);++M>>1,Q=b[G];Q!==null&&!Ni(Q)&&(N?Q<=S:Q=s){var Se=S?null:Hre(b);if(Se)return Y_(Se);Q=!1,j=Hv,le=new Zd}else le=S?[]:ne;e:for(;++M=M?b:mo(b,S,N)}var gF=wne||function(b){return Jr.clearTimeout(b)};function vF(b,S){if(S)return b.slice();var N=b.length,M=F2?F2(N):new b.constructor(N);return b.copy(M),M}function YR(b){var S=new b.constructor(b.byteLength);return new tx(S).set(new tx(b)),S}function Mre(b,S){var N=S?YR(b.buffer):b.buffer;return new b.constructor(N,b.byteOffset,b.byteLength)}function Lre(b){var S=new b.constructor(b.source,mt.exec(b));return S.lastIndex=b.lastIndex,S}function Ire(b){return Kv?En(Kv.call(b)):{}}function yF(b,S){var N=S?YR(b.buffer):b.buffer;return new b.constructor(N,b.byteOffset,b.length)}function bF(b,S){if(b!==S){var N=b!==n,M=b===null,j=b===b,G=Ni(b),Q=S!==n,ne=S===null,le=S===S,Se=Ni(S);if(!ne&&!Se&&!G&&b>S||G&&Q&&le&&!ne&&!Se||M&&Q&&le||!N&&le||!j)return 1;if(!M&&!G&&!Se&&b=ne)return le;var Se=N[M];return le*(Se=="desc"?-1:1)}}return b.index-S.index}function wF(b,S,N,M){for(var j=-1,G=b.length,Q=N.length,ne=-1,le=S.length,Se=Tr(G-Q,0),Ee=pe(le+Se),Re=!M;++ne1?N[j-1]:n,Q=j>2?N[2]:n;for(G=b.length>3&&typeof G=="function"?(j--,G):n,Q&&Is(N[0],N[1],Q)&&(G=j<3?n:G,j=1),S=En(S);++M-1?j[G?S[Q]:Q]:n}}function AF(b){return Ll(function(S){var N=S.length,M=N,j=ho.prototype.thru;for(b&&S.reverse();M--;){var G=S[M];if(typeof G!="function")throw new fo(a);if(j&&!Q&&_x(G)=="wrapper")var Q=new ho([],!0)}for(M=Q?M:N;++M1&&Ft.reverse(),Ee&&lene))return!1;var Se=G.get(b),Ee=G.get(S);if(Se&&Ee)return Se==S&&Ee==b;var Re=-1,Fe=!0,Ze=N&h?new Zd:n;for(G.set(b,S),G.set(S,b);++Re1?"& ":"")+S[M],S=S.join(N>2?", ":" "),b.replace(Le,`{ /* [wrapped with `+S+`] */ -`)}function Yre(b){return yt(b)||rf(b)||!!(F2&&b&&b[F2])}function Ll(b,S){var N=typeof b;return S=S??H,!!S&&(N=="number"||N!="symbol"&&Hn.test(b))&&b>-1&&b%1==0&&b0){if(++S>=L)return arguments[0]}else S=0;return b.apply(n,arguments)}}function xx(b,S){var N=-1,M=b.length,j=M-1;for(S=S===n?M:S;++N1?b[S-1]:n;return N=typeof N=="function"?(b.pop(),N):n,KF(b,N)});function YF(b){var S=W(b);return S.__chain__=!0,S}function oie(b,S){return S(b),b}function Sx(b,S){return S(b)}var aie=Ml(function(b){var S=b.length,N=S?b[0]:0,M=this.__wrapped__,j=function(G){return NR(G,b)};return S>1||this.__actions__.length||!(M instanceof It)||!Ll(N)?this.thru(j):(M=M.slice(N,+N+(S?1:0)),M.__actions__.push({func:Sx,args:[j],thisArg:n}),new ho(M,this.__chain__).thru(function(G){return S&&!G.length&&G.push(n),G}))});function lie(){return YF(this)}function cie(){return new ho(this.value(),this.__chain__)}function uie(){this.__values__===n&&(this.__values__=cj(this.value()));var b=this.__index__>=this.__values__.length,S=b?n:this.__values__[this.__index__++];return{done:b,value:S}}function die(){return this}function fie(b){for(var S,N=this;N instanceof lx;){var M=UF(N);M.__index__=0,M.__values__=n,S?j.__wrapped__=M:S=M;var j=M;N=N.__wrapped__}return j.__wrapped__=b,S}function hie(){var b=this.__wrapped__;if(b instanceof It){var S=b;return this.__actions__.length&&(S=new It(this)),S=S.reverse(),S.__actions__.push({func:Sx,args:[oP],thisArg:n}),new ho(S,this.__chain__)}return this.thru(oP)}function pie(){return dF(this.__wrapped__,this.__actions__)}var mie=mx(function(b,S,N){cn.call(b,N)?++b[N]:Nl(b,N,1)});function gie(b,S,N){var M=yt(b)?E2:ore;return N&&Is(b,S,N)&&(S=n),M(b,at(S,3))}function vie(b,S){var N=yt(b)?tu:K2;return N(b,at(S,3))}var yie=xF(HF),bie=xF(VF);function wie(b,S){return es(Ex(b,S),1)}function _ie(b,S){return es(Ex(b,S),V)}function xie(b,S,N){return N=N===n?1:_t(N),es(Ex(b,S),N)}function XF(b,S){var N=yt(b)?uo:iu;return N(b,at(S,3))}function QF(b,S){var N=yt(b)?Bte:q2;return N(b,at(S,3))}var Sie=mx(function(b,S,N){cn.call(b,N)?b[N].push(S):Nl(b,N,[S])});function Eie(b,S,N,M){b=ni(b)?b:Dp(b),N=N&&!M?_t(N):0;var j=b.length;return N<0&&(N=Tr(j+N,0)),Tx(b)?N<=j&&b.indexOf(S,N)>-1:!!j&&bp(b,S,N)>-1}var Cie=At(function(b,S,N){var M=-1,j=typeof S=="function",G=ni(b)?pe(b.length):[];return iu(b,function(Q){G[++M]=j?Ti(S,Q,N):Qv(Q,S,N)}),G}),Aie=mx(function(b,S,N){Nl(b,N,S)});function Ex(b,S){var N=yt(b)?Wn:eF;return N(b,at(S,3))}function Rie(b,S,N,M){return b==null?[]:(yt(S)||(S=S==null?[]:[S]),N=M?n:N,yt(N)||(N=N==null?[]:[N]),sF(b,S,N))}var Pie=mx(function(b,S,N){b[N?0:1].push(S)},function(){return[[],[]]});function Tie(b,S,N){var M=yt(b)?bR:P2,j=arguments.length<3;return M(b,at(S,4),N,j,iu)}function kie(b,S,N){var M=yt(b)?Ute:P2,j=arguments.length<3;return M(b,at(S,4),N,j,q2)}function Die(b,S){var N=yt(b)?tu:K2;return N(b,Rx(at(S,3)))}function Nie(b){var S=yt(b)?H2:Ere;return S(b)}function Oie(b,S,N){(N?Is(b,S,N):S===n)?S=1:S=_t(S);var M=yt(b)?tre:Cre;return M(b,S)}function Mie(b){var S=yt(b)?nre:Rre;return S(b)}function Lie(b){if(b==null)return 0;if(ni(b))return Tx(b)?_p(b):b.length;var S=gs(b);return S==$e||S==Xt?b.size:FR(b).length}function Iie(b,S,N){var M=yt(b)?wR:Pre;return N&&Is(b,S,N)&&(S=n),M(b,at(S,3))}var $ie=At(function(b,S){if(b==null)return[];var N=S.length;return N>1&&Is(b,S[0],S[1])?S=[]:N>2&&Is(S[0],S[1],S[2])&&(S=[S[0]]),sF(b,es(S,1),[])}),Cx=vne||function(){return Jr.Date.now()};function Fie(b,S){if(typeof S!="function")throw new fo(a);return b=_t(b),function(){if(--b<1)return S.apply(this,arguments)}}function ZF(b,S,N){return S=N?n:S,S=b&&S==null?b.length:S,Ol(b,R,n,n,n,n,S)}function JF(b,S){var N;if(typeof S!="function")throw new fo(a);return b=_t(b),function(){return--b>0&&(N=S.apply(this,arguments)),b<=1&&(S=n),N}}var lP=At(function(b,S,N){var M=y;if(N.length){var j=ru(N,Tp(lP));M|=A}return Ol(b,M,S,N,j)}),ej=At(function(b,S,N){var M=y|g;if(N.length){var j=ru(N,Tp(ej));M|=A}return Ol(S,M,b,N,j)});function tj(b,S,N){S=N?n:S;var M=Ol(b,w,n,n,n,n,n,S);return M.placeholder=tj.placeholder,M}function nj(b,S,N){S=N?n:S;var M=Ol(b,x,n,n,n,n,n,S);return M.placeholder=nj.placeholder,M}function rj(b,S,N){var M,j,G,Q,ne,le,Se=0,Ee=!1,Re=!1,Fe=!0;if(typeof b!="function")throw new fo(a);S=vo(S)||0,Yn(N)&&(Ee=!!N.leading,Re="maxWait"in N,G=Re?Tr(vo(N.maxWait)||0,S):G,Fe="trailing"in N?!!N.trailing:Fe);function Ze(mr){var qo=M,Fl=j;return M=j=n,Se=mr,Q=b.apply(Fl,qo),Q}function lt(mr){return Se=mr,ne=ny(kt,S),Ee?Ze(mr):Q}function Et(mr){var qo=mr-le,Fl=mr-Se,xj=S-qo;return Re?ms(xj,G-Fl):xj}function ct(mr){var qo=mr-le,Fl=mr-Se;return le===n||qo>=S||qo<0||Re&&Fl>=G}function kt(){var mr=Cx();if(ct(mr))return Ft(mr);ne=ny(kt,Et(mr))}function Ft(mr){return ne=n,Fe&&M?Ze(mr):(M=j=n,Q)}function Oi(){ne!==n&&hF(ne),Se=0,M=le=j=ne=n}function $s(){return ne===n?Q:Ft(Cx())}function Mi(){var mr=Cx(),qo=ct(mr);if(M=arguments,j=this,le=mr,qo){if(ne===n)return lt(le);if(Re)return hF(ne),ne=ny(kt,S),Ze(le)}return ne===n&&(ne=ny(kt,S)),Q}return Mi.cancel=Oi,Mi.flush=$s,Mi}var jie=At(function(b,S){return G2(b,1,S)}),zie=At(function(b,S,N){return G2(b,vo(S)||0,N)});function Bie(b){return Ol(b,T)}function Ax(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new fo(a);var N=function(){var M=arguments,j=S?S.apply(this,M):M[0],G=N.cache;if(G.has(j))return G.get(j);var Q=b.apply(this,M);return N.cache=G.set(j,Q)||G,Q};return N.cache=new(Ax.Cache||Dl),N}Ax.Cache=Dl;function Rx(b){if(typeof b!="function")throw new fo(a);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Uie(b){return JF(2,b)}var Hie=Tre(function(b,S){S=S.length==1&&yt(S[0])?Wn(S[0],ki(at())):Wn(es(S,1),ki(at()));var N=S.length;return At(function(M){for(var j=-1,G=ms(M.length,N);++j=S}),rf=Q2(function(){return arguments}())?Q2:function(b){return or(b)&&cn.call(b,"callee")&&!$2.call(b,"callee")},yt=pe.isArray,soe=y2?ki(y2):fre;function ni(b){return b!=null&&Px(b.length)&&!Il(b)}function pr(b){return or(b)&&ni(b)}function ioe(b){return b===!0||b===!1||or(b)&&Ls(b)==be}var cu=bne||wP,ooe=b2?ki(b2):hre;function aoe(b){return or(b)&&b.nodeType===1&&!ry(b)}function loe(b){if(b==null)return!0;if(ni(b)&&(yt(b)||typeof b=="string"||typeof b.splice=="function"||cu(b)||kp(b)||rf(b)))return!b.length;var S=gs(b);if(S==$e||S==Xt)return!b.size;if(ty(b))return!FR(b).length;for(var N in b)if(cn.call(b,N))return!1;return!0}function coe(b,S){return Zv(b,S)}function uoe(b,S,N){N=typeof N=="function"?N:n;var M=N?N(b,S):n;return M===n?Zv(b,S,n,N):!!M}function uP(b){if(!or(b))return!1;var S=Ls(b);return S==Me||S==_e||typeof b.message=="string"&&typeof b.name=="string"&&!ry(b)}function doe(b){return typeof b=="number"&&j2(b)}function Il(b){if(!Yn(b))return!1;var S=Ls(b);return S==Ne||S==ye||S==ie||S==Yt}function ij(b){return typeof b=="number"&&b==_t(b)}function Px(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=H}function Yn(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function or(b){return b!=null&&typeof b=="object"}var oj=w2?ki(w2):mre;function foe(b,S){return b===S||$R(b,S,eP(S))}function hoe(b,S,N){return N=typeof N=="function"?N:n,$R(b,S,eP(S),N)}function poe(b){return aj(b)&&b!=+b}function moe(b){if(Zre(b))throw new gt(i);return Z2(b)}function goe(b){return b===null}function voe(b){return b==null}function aj(b){return typeof b=="number"||or(b)&&Ls(b)==ut}function ry(b){if(!or(b)||Ls(b)!=vt)return!1;var S=tx(b);if(S===null)return!0;var N=cn.call(S,"constructor")&&S.constructor;return typeof N=="function"&&N instanceof N&&Q_.call(N)==hne}var dP=_2?ki(_2):gre;function yoe(b){return ij(b)&&b>=-9007199254740991&&b<=H}var lj=x2?ki(x2):vre;function Tx(b){return typeof b=="string"||!yt(b)&&or(b)&&Ls(b)==J}function Ni(b){return typeof b=="symbol"||or(b)&&Ls(b)==fe}var kp=S2?ki(S2):yre;function boe(b){return b===n}function woe(b){return or(b)&&gs(b)==Pe}function _oe(b){return or(b)&&Ls(b)==Oe}var xoe=bx(jR),Soe=bx(function(b,S){return b<=S});function cj(b){if(!b)return[];if(ni(b))return Tx(b)?Vo(b):ti(b);if(Vv&&b[Vv])return tne(b[Vv]());var S=gs(b),N=S==$e?AR:S==Xt?K_:Dp;return N(b)}function $l(b){if(!b)return b===0?b:0;if(b=vo(b),b===V||b===-1/0){var S=b<0?-1:1;return S*ee}return b===b?b:0}function _t(b){var S=$l(b),N=S%1;return S===S?N?S-N:S:0}function uj(b){return b?Jd(_t(b),0,X):0}function vo(b){if(typeof b=="number")return b;if(Ni(b))return re;if(Yn(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=Yn(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=T2(b);var N=Rr.test(b);return N||Wt.test(b)?Fte(b.slice(2),N?2:8):Lt.test(b)?re:+b}function dj(b){return Ia(b,ri(b))}function Eoe(b){return b?Jd(_t(b),-9007199254740991,H):b===0?b:0}function rn(b){return b==null?"":Di(b)}var Coe=Rp(function(b,S){if(ty(S)||ni(S)){Ia(S,Vr(S),b);return}for(var N in S)cn.call(S,N)&&Yv(b,N,S[N])}),fj=Rp(function(b,S){Ia(S,ri(S),b)}),kx=Rp(function(b,S,N,M){Ia(S,ri(S),b,M)}),Aoe=Rp(function(b,S,N,M){Ia(S,Vr(S),b,M)}),Roe=Ml(NR);function Poe(b,S){var N=Ap(b);return S==null?N:V2(N,S)}var Toe=At(function(b,S){b=En(b);var N=-1,M=S.length,j=M>2?S[2]:n;for(j&&Is(S[0],S[1],j)&&(M=1);++N1),G}),Ia(b,ZR(b),N),M&&(N=po(N,l|d|m,zre));for(var j=S.length;j--;)VR(N,S[j]);return N});function qoe(b,S){return pj(b,Rx(at(S)))}var Koe=Ml(function(b,S){return b==null?{}:_re(b,S)});function pj(b,S){if(b==null)return{};var N=Wn(ZR(b),function(M){return[M]});return S=at(S),iF(b,N,function(M,j){return S(M,j[0])})}function Yoe(b,S,N){S=au(S,b);var M=-1,j=S.length;for(j||(j=1,b=n);++MS){var M=b;b=S,S=M}if(N||b%1||S%1){var j=z2();return ms(b+j*(S-b+$te("1e-"+((j+"").length-1))),S)}return BR(b,S)}var oae=Pp(function(b,S,N){return S=S.toLowerCase(),b+(N?vj(S):S)});function vj(b){return pP(rn(b).toLowerCase())}function yj(b){return b=rn(b),b&&b.replace(Jc,Xte).replace(Rte,"")}function aae(b,S,N){b=rn(b),S=Di(S);var M=b.length;N=N===n?M:Jd(_t(N),0,M);var j=N;return N-=S.length,N>=0&&b.slice(N,j)==S}function lae(b){return b=rn(b),b&&Ct.test(b)?b.replace(nt,Qte):b}function cae(b){return b=rn(b),b&&oe.test(b)?b.replace(te,"\\$&"):b}var uae=Pp(function(b,S,N){return b+(N?"-":"")+S.toLowerCase()}),dae=Pp(function(b,S,N){return b+(N?" ":"")+S.toLowerCase()}),fae=_F("toLowerCase");function hae(b,S,N){b=rn(b),S=_t(S);var M=S?_p(b):0;if(!S||M>=S)return b;var j=(S-M)/2;return yx(ix(j),N)+b+yx(sx(j),N)}function pae(b,S,N){b=rn(b),S=_t(S);var M=S?_p(b):0;return S&&M>>0,N?(b=rn(b),b&&(typeof S=="string"||S!=null&&!dP(S))&&(S=Di(S),!S&&wp(b))?lu(Vo(b),0,N):b.split(S,N)):[]}var _ae=Pp(function(b,S,N){return b+(N?" ":"")+pP(S)});function xae(b,S,N){return b=rn(b),N=N==null?0:Jd(_t(N),0,b.length),S=Di(S),b.slice(N,N+S.length)==S}function Sae(b,S,N){var M=W.templateSettings;N&&Is(b,S,N)&&(S=n),b=rn(b),S=kx({},S,M,PF);var j=kx({},S.imports,M.imports,PF),G=Vr(j),Q=CR(j,G),ne,le,Se=0,Ee=S.interpolate||Ma,Re="__p += '",Fe=RR((S.escape||Ma).source+"|"+Ee.source+"|"+(Ee===ln?Je:Ma).source+"|"+(S.evaluate||Ma).source+"|$","g"),Ze="//# sourceURL="+(cn.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Nte+"]")+` -`;b.replace(Fe,function(ct,kt,Ft,Oi,$s,Mi){return Ft||(Ft=Oi),Re+=b.slice(Se,Mi).replace(Ho,Zte),kt&&(ne=!0,Re+=`' + +`)}function Jre(b){return yt(b)||rf(b)||!!(B2&&b&&b[B2])}function Il(b,S){var N=typeof b;return S=S??H,!!S&&(N=="number"||N!="symbol"&&Hn.test(b))&&b>-1&&b%1==0&&b0){if(++S>=L)return arguments[0]}else S=0;return b.apply(n,arguments)}}function Sx(b,S){var N=-1,M=b.length,j=M-1;for(S=S===n?M:S;++N1?b[S-1]:n;return N=typeof N=="function"?(b.pop(),N):n,QF(b,N)});function ZF(b){var S=W(b);return S.__chain__=!0,S}function uie(b,S){return S(b),b}function Ex(b,S){return S(b)}var die=Ll(function(b){var S=b.length,N=S?b[0]:0,M=this.__wrapped__,j=function(G){return OR(G,b)};return S>1||this.__actions__.length||!(M instanceof It)||!Il(N)?this.thru(j):(M=M.slice(N,+N+(S?1:0)),M.__actions__.push({func:Ex,args:[j],thisArg:n}),new ho(M,this.__chain__).thru(function(G){return S&&!G.length&&G.push(n),G}))});function fie(){return ZF(this)}function hie(){return new ho(this.value(),this.__chain__)}function pie(){this.__values__===n&&(this.__values__=fj(this.value()));var b=this.__index__>=this.__values__.length,S=b?n:this.__values__[this.__index__++];return{done:b,value:S}}function mie(){return this}function gie(b){for(var S,N=this;N instanceof cx;){var M=WF(N);M.__index__=0,M.__values__=n,S?j.__wrapped__=M:S=M;var j=M;N=N.__wrapped__}return j.__wrapped__=b,S}function vie(){var b=this.__wrapped__;if(b instanceof It){var S=b;return this.__actions__.length&&(S=new It(this)),S=S.reverse(),S.__actions__.push({func:Ex,args:[aP],thisArg:n}),new ho(S,this.__chain__)}return this.thru(aP)}function yie(){return pF(this.__wrapped__,this.__actions__)}var bie=gx(function(b,S,N){cn.call(b,N)?++b[N]:Ol(b,N,1)});function wie(b,S,N){var M=yt(b)?R2:ure;return N&&Is(b,S,N)&&(S=n),M(b,at(S,3))}function _ie(b,S){var N=yt(b)?tu:Q2;return N(b,at(S,3))}var xie=CF(GF),Sie=CF(qF);function Eie(b,S){return es(Cx(b,S),1)}function Cie(b,S){return es(Cx(b,S),V)}function Aie(b,S,N){return N=N===n?1:_t(N),es(Cx(b,S),N)}function JF(b,S){var N=yt(b)?uo:iu;return N(b,at(S,3))}function ej(b,S){var N=yt(b)?Wte:X2;return N(b,at(S,3))}var Rie=gx(function(b,S,N){cn.call(b,N)?b[N].push(S):Ol(b,N,[S])});function Pie(b,S,N,M){b=ni(b)?b:Np(b),N=N&&!M?_t(N):0;var j=b.length;return N<0&&(N=Tr(j+N,0)),kx(b)?N<=j&&b.indexOf(S,N)>-1:!!j&&wp(b,S,N)>-1}var Tie=At(function(b,S,N){var M=-1,j=typeof S=="function",G=ni(b)?pe(b.length):[];return iu(b,function(Q){G[++M]=j?Ti(S,Q,N):Qv(Q,S,N)}),G}),kie=gx(function(b,S,N){Ol(b,N,S)});function Cx(b,S){var N=yt(b)?Wn:rF;return N(b,at(S,3))}function Die(b,S,N,M){return b==null?[]:(yt(S)||(S=S==null?[]:[S]),N=M?n:N,yt(N)||(N=N==null?[]:[N]),aF(b,S,N))}var Nie=gx(function(b,S,N){b[N?0:1].push(S)},function(){return[[],[]]});function Oie(b,S,N){var M=yt(b)?wR:D2,j=arguments.length<3;return M(b,at(S,4),N,j,iu)}function Mie(b,S,N){var M=yt(b)?Gte:D2,j=arguments.length<3;return M(b,at(S,4),N,j,X2)}function Lie(b,S){var N=yt(b)?tu:Q2;return N(b,Px(at(S,3)))}function Iie(b){var S=yt(b)?G2:Pre;return S(b)}function $ie(b,S,N){(N?Is(b,S,N):S===n)?S=1:S=_t(S);var M=yt(b)?ire:Tre;return M(b,S)}function Fie(b){var S=yt(b)?ore:Dre;return S(b)}function jie(b){if(b==null)return 0;if(ni(b))return kx(b)?xp(b):b.length;var S=gs(b);return S==$e||S==Xt?b.size:jR(b).length}function zie(b,S,N){var M=yt(b)?_R:Nre;return N&&Is(b,S,N)&&(S=n),M(b,at(S,3))}var Bie=At(function(b,S){if(b==null)return[];var N=S.length;return N>1&&Is(b,S[0],S[1])?S=[]:N>2&&Is(S[0],S[1],S[2])&&(S=[S[0]]),aF(b,es(S,1),[])}),Ax=_ne||function(){return Jr.Date.now()};function Uie(b,S){if(typeof S!="function")throw new fo(a);return b=_t(b),function(){if(--b<1)return S.apply(this,arguments)}}function tj(b,S,N){return S=N?n:S,S=b&&S==null?b.length:S,Ml(b,R,n,n,n,n,S)}function nj(b,S){var N;if(typeof S!="function")throw new fo(a);return b=_t(b),function(){return--b>0&&(N=S.apply(this,arguments)),b<=1&&(S=n),N}}var cP=At(function(b,S,N){var M=y;if(N.length){var j=ru(N,kp(cP));M|=A}return Ml(b,M,S,N,j)}),rj=At(function(b,S,N){var M=y|g;if(N.length){var j=ru(N,kp(rj));M|=A}return Ml(S,M,b,N,j)});function sj(b,S,N){S=N?n:S;var M=Ml(b,w,n,n,n,n,n,S);return M.placeholder=sj.placeholder,M}function ij(b,S,N){S=N?n:S;var M=Ml(b,x,n,n,n,n,n,S);return M.placeholder=ij.placeholder,M}function oj(b,S,N){var M,j,G,Q,ne,le,Se=0,Ee=!1,Re=!1,Fe=!0;if(typeof b!="function")throw new fo(a);S=vo(S)||0,Yn(N)&&(Ee=!!N.leading,Re="maxWait"in N,G=Re?Tr(vo(N.maxWait)||0,S):G,Fe="trailing"in N?!!N.trailing:Fe);function Ze(mr){var Ko=M,jl=j;return M=j=n,Se=mr,Q=b.apply(jl,Ko),Q}function lt(mr){return Se=mr,ne=ny(kt,S),Ee?Ze(mr):Q}function Et(mr){var Ko=mr-le,jl=mr-Se,Cj=S-Ko;return Re?ms(Cj,G-jl):Cj}function ct(mr){var Ko=mr-le,jl=mr-Se;return le===n||Ko>=S||Ko<0||Re&&jl>=G}function kt(){var mr=Ax();if(ct(mr))return Ft(mr);ne=ny(kt,Et(mr))}function Ft(mr){return ne=n,Fe&&M?Ze(mr):(M=j=n,Q)}function Oi(){ne!==n&&gF(ne),Se=0,M=le=j=ne=n}function $s(){return ne===n?Q:Ft(Ax())}function Mi(){var mr=Ax(),Ko=ct(mr);if(M=arguments,j=this,le=mr,Ko){if(ne===n)return lt(le);if(Re)return gF(ne),ne=ny(kt,S),Ze(le)}return ne===n&&(ne=ny(kt,S)),Q}return Mi.cancel=Oi,Mi.flush=$s,Mi}var Hie=At(function(b,S){return Y2(b,1,S)}),Vie=At(function(b,S,N){return Y2(b,vo(S)||0,N)});function Wie(b){return Ml(b,T)}function Rx(b,S){if(typeof b!="function"||S!=null&&typeof S!="function")throw new fo(a);var N=function(){var M=arguments,j=S?S.apply(this,M):M[0],G=N.cache;if(G.has(j))return G.get(j);var Q=b.apply(this,M);return N.cache=G.set(j,Q)||G,Q};return N.cache=new(Rx.Cache||Nl),N}Rx.Cache=Nl;function Px(b){if(typeof b!="function")throw new fo(a);return function(){var S=arguments;switch(S.length){case 0:return!b.call(this);case 1:return!b.call(this,S[0]);case 2:return!b.call(this,S[0],S[1]);case 3:return!b.call(this,S[0],S[1],S[2])}return!b.apply(this,S)}}function Gie(b){return nj(2,b)}var qie=Ore(function(b,S){S=S.length==1&&yt(S[0])?Wn(S[0],ki(at())):Wn(es(S,1),ki(at()));var N=S.length;return At(function(M){for(var j=-1,G=ms(M.length,N);++j=S}),rf=eF(function(){return arguments}())?eF:function(b){return or(b)&&cn.call(b,"callee")&&!z2.call(b,"callee")},yt=pe.isArray,loe=_2?ki(_2):gre;function ni(b){return b!=null&&Tx(b.length)&&!$l(b)}function pr(b){return or(b)&&ni(b)}function coe(b){return b===!0||b===!1||or(b)&&Ls(b)==be}var cu=Sne||_P,uoe=x2?ki(x2):vre;function doe(b){return or(b)&&b.nodeType===1&&!ry(b)}function foe(b){if(b==null)return!0;if(ni(b)&&(yt(b)||typeof b=="string"||typeof b.splice=="function"||cu(b)||Dp(b)||rf(b)))return!b.length;var S=gs(b);if(S==$e||S==Xt)return!b.size;if(ty(b))return!jR(b).length;for(var N in b)if(cn.call(b,N))return!1;return!0}function hoe(b,S){return Zv(b,S)}function poe(b,S,N){N=typeof N=="function"?N:n;var M=N?N(b,S):n;return M===n?Zv(b,S,n,N):!!M}function dP(b){if(!or(b))return!1;var S=Ls(b);return S==Me||S==_e||typeof b.message=="string"&&typeof b.name=="string"&&!ry(b)}function moe(b){return typeof b=="number"&&U2(b)}function $l(b){if(!Yn(b))return!1;var S=Ls(b);return S==Ne||S==ye||S==ie||S==Yt}function lj(b){return typeof b=="number"&&b==_t(b)}function Tx(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=H}function Yn(b){var S=typeof b;return b!=null&&(S=="object"||S=="function")}function or(b){return b!=null&&typeof b=="object"}var cj=S2?ki(S2):bre;function goe(b,S){return b===S||FR(b,S,tP(S))}function voe(b,S,N){return N=typeof N=="function"?N:n,FR(b,S,tP(S),N)}function yoe(b){return uj(b)&&b!=+b}function boe(b){if(nse(b))throw new gt(i);return tF(b)}function woe(b){return b===null}function _oe(b){return b==null}function uj(b){return typeof b=="number"||or(b)&&Ls(b)==ut}function ry(b){if(!or(b)||Ls(b)!=vt)return!1;var S=nx(b);if(S===null)return!0;var N=cn.call(S,"constructor")&&S.constructor;return typeof N=="function"&&N instanceof N&&Z_.call(N)==vne}var fP=E2?ki(E2):wre;function xoe(b){return lj(b)&&b>=-9007199254740991&&b<=H}var dj=C2?ki(C2):_re;function kx(b){return typeof b=="string"||!yt(b)&&or(b)&&Ls(b)==J}function Ni(b){return typeof b=="symbol"||or(b)&&Ls(b)==fe}var Dp=A2?ki(A2):xre;function Soe(b){return b===n}function Eoe(b){return or(b)&&gs(b)==Pe}function Coe(b){return or(b)&&Ls(b)==Oe}var Aoe=wx(zR),Roe=wx(function(b,S){return b<=S});function fj(b){if(!b)return[];if(ni(b))return kx(b)?Wo(b):ti(b);if(Vv&&b[Vv])return ine(b[Vv]());var S=gs(b),N=S==$e?RR:S==Xt?Y_:Np;return N(b)}function Fl(b){if(!b)return b===0?b:0;if(b=vo(b),b===V||b===-1/0){var S=b<0?-1:1;return S*ee}return b===b?b:0}function _t(b){var S=Fl(b),N=S%1;return S===S?N?S-N:S:0}function hj(b){return b?Jd(_t(b),0,X):0}function vo(b){if(typeof b=="number")return b;if(Ni(b))return re;if(Yn(b)){var S=typeof b.valueOf=="function"?b.valueOf():b;b=Yn(S)?S+"":S}if(typeof b!="string")return b===0?b:+b;b=N2(b);var N=Rr.test(b);return N||Wt.test(b)?Ute(b.slice(2),N?2:8):Lt.test(b)?re:+b}function pj(b){return $a(b,ri(b))}function Poe(b){return b?Jd(_t(b),-9007199254740991,H):b===0?b:0}function rn(b){return b==null?"":Di(b)}var Toe=Pp(function(b,S){if(ty(S)||ni(S)){$a(S,Vr(S),b);return}for(var N in S)cn.call(S,N)&&Yv(b,N,S[N])}),mj=Pp(function(b,S){$a(S,ri(S),b)}),Dx=Pp(function(b,S,N,M){$a(S,ri(S),b,M)}),koe=Pp(function(b,S,N,M){$a(S,Vr(S),b,M)}),Doe=Ll(OR);function Noe(b,S){var N=Rp(b);return S==null?N:q2(N,S)}var Ooe=At(function(b,S){b=En(b);var N=-1,M=S.length,j=M>2?S[2]:n;for(j&&Is(S[0],S[1],j)&&(M=1);++N1),G}),$a(b,JR(b),N),M&&(N=po(N,l|d|m,Vre));for(var j=S.length;j--;)WR(N,S[j]);return N});function Qoe(b,S){return vj(b,Px(at(S)))}var Zoe=Ll(function(b,S){return b==null?{}:Cre(b,S)});function vj(b,S){if(b==null)return{};var N=Wn(JR(b),function(M){return[M]});return S=at(S),lF(b,N,function(M,j){return S(M,j[0])})}function Joe(b,S,N){S=au(S,b);var M=-1,j=S.length;for(j||(j=1,b=n);++MS){var M=b;b=S,S=M}if(N||b%1||S%1){var j=H2();return ms(b+j*(S-b+Bte("1e-"+((j+"").length-1))),S)}return UR(b,S)}var uae=Tp(function(b,S,N){return S=S.toLowerCase(),b+(N?wj(S):S)});function wj(b){return mP(rn(b).toLowerCase())}function _j(b){return b=rn(b),b&&b.replace(Jc,ene).replace(Dte,"")}function dae(b,S,N){b=rn(b),S=Di(S);var M=b.length;N=N===n?M:Jd(_t(N),0,M);var j=N;return N-=S.length,N>=0&&b.slice(N,j)==S}function fae(b){return b=rn(b),b&&Ct.test(b)?b.replace(nt,tne):b}function hae(b){return b=rn(b),b&&oe.test(b)?b.replace(te,"\\$&"):b}var pae=Tp(function(b,S,N){return b+(N?"-":"")+S.toLowerCase()}),mae=Tp(function(b,S,N){return b+(N?" ":"")+S.toLowerCase()}),gae=EF("toLowerCase");function vae(b,S,N){b=rn(b),S=_t(S);var M=S?xp(b):0;if(!S||M>=S)return b;var j=(S-M)/2;return bx(ox(j),N)+b+bx(ix(j),N)}function yae(b,S,N){b=rn(b),S=_t(S);var M=S?xp(b):0;return S&&M>>0,N?(b=rn(b),b&&(typeof S=="string"||S!=null&&!fP(S))&&(S=Di(S),!S&&_p(b))?lu(Wo(b),0,N):b.split(S,N)):[]}var Cae=Tp(function(b,S,N){return b+(N?" ":"")+mP(S)});function Aae(b,S,N){return b=rn(b),N=N==null?0:Jd(_t(N),0,b.length),S=Di(S),b.slice(N,N+S.length)==S}function Rae(b,S,N){var M=W.templateSettings;N&&Is(b,S,N)&&(S=n),b=rn(b),S=Dx({},S,M,DF);var j=Dx({},S.imports,M.imports,DF),G=Vr(j),Q=AR(j,G),ne,le,Se=0,Ee=S.interpolate||La,Re="__p += '",Fe=PR((S.escape||La).source+"|"+Ee.source+"|"+(Ee===ln?Je:La).source+"|"+(S.evaluate||La).source+"|$","g"),Ze="//# sourceURL="+(cn.call(S,"sourceURL")?(S.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ite+"]")+` +`;b.replace(Fe,function(ct,kt,Ft,Oi,$s,Mi){return Ft||(Ft=Oi),Re+=b.slice(Se,Mi).replace(Vo,nne),kt&&(ne=!0,Re+=`' + __e(`+kt+`) + '`),$s&&(le=!0,Re+=`'; `+$s+`; @@ -293,31 +293,31 @@ __p += '`),Ft&&(Re+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Re+`return __p -}`;var Et=wj(function(){return en(G,Ze+"return "+Re).apply(n,Q)});if(Et.source=Re,uP(Et))throw Et;return Et}function Eae(b){return rn(b).toLowerCase()}function Cae(b){return rn(b).toUpperCase()}function Aae(b,S,N){if(b=rn(b),b&&(N||S===n))return T2(b);if(!b||!(S=Di(S)))return b;var M=Vo(b),j=Vo(S),G=k2(M,j),Q=D2(M,j)+1;return lu(M,G,Q).join("")}function Rae(b,S,N){if(b=rn(b),b&&(N||S===n))return b.slice(0,O2(b)+1);if(!b||!(S=Di(S)))return b;var M=Vo(b),j=D2(M,Vo(S))+1;return lu(M,0,j).join("")}function Pae(b,S,N){if(b=rn(b),b&&(N||S===n))return b.replace(he,"");if(!b||!(S=Di(S)))return b;var M=Vo(b),j=k2(M,Vo(S));return lu(M,j).join("")}function Tae(b,S){var N=D,M=O;if(Yn(S)){var j="separator"in S?S.separator:j;N="length"in S?_t(S.length):N,M="omission"in S?Di(S.omission):M}b=rn(b);var G=b.length;if(wp(b)){var Q=Vo(b);G=Q.length}if(N>=G)return b;var ne=N-_p(M);if(ne<1)return M;var le=Q?lu(Q,0,ne).join(""):b.slice(0,ne);if(j===n)return le+M;if(Q&&(ne+=le.length-ne),dP(j)){if(b.slice(ne).search(j)){var Se,Ee=le;for(j.global||(j=RR(j.source,rn(mt.exec(j))+"g")),j.lastIndex=0;Se=j.exec(Ee);)var Re=Se.index;le=le.slice(0,Re===n?ne:Re)}}else if(b.indexOf(Di(j),ne)!=ne){var Fe=le.lastIndexOf(j);Fe>-1&&(le=le.slice(0,Fe))}return le+M}function kae(b){return b=rn(b),b&&Ht.test(b)?b.replace(St,ine):b}var Dae=Pp(function(b,S,N){return b+(N?" ":"")+S.toUpperCase()}),pP=_F("toUpperCase");function bj(b,S,N){return b=rn(b),S=N?n:S,S===n?ene(b)?lne(b):Wte(b):b.match(S)||[]}var wj=At(function(b,S){try{return Ti(b,n,S)}catch(N){return uP(N)?N:new gt(N)}}),Nae=Ml(function(b,S){return uo(S,function(N){N=$a(N),Nl(b,N,lP(b[N],b))}),b});function Oae(b){var S=b==null?0:b.length,N=at();return b=S?Wn(b,function(M){if(typeof M[1]!="function")throw new fo(a);return[N(M[0]),M[1]]}):[],At(function(M){for(var j=-1;++jH)return[];var N=X,M=ms(b,X);S=at(S),b-=X;for(var j=ER(M,S);++N0||S<0)?new It(N):(b<0?N=N.takeRight(-b):b&&(N=N.drop(b)),S!==n&&(S=_t(S),N=S<0?N.dropRight(-S):N.take(S-b)),N)},It.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},It.prototype.toArray=function(){return this.take(X)},La(It.prototype,function(b,S){var N=/^(?:filter|find|map|reject)|While$/.test(S),M=/^(?:head|last)$/.test(S),j=W[M?"take"+(S=="last"?"Right":""):S],G=M||/^find/.test(S);j&&(W.prototype[S]=function(){var Q=this.__wrapped__,ne=M?[1]:arguments,le=Q instanceof It,Se=ne[0],Ee=le||yt(Q),Re=function(kt){var Ft=j.apply(W,nu([kt],ne));return M&&Fe?Ft[0]:Ft};Ee&&N&&typeof Se=="function"&&Se.length!=1&&(le=Ee=!1);var Fe=this.__chain__,Ze=!!this.__actions__.length,lt=G&&!Fe,Et=le&&!Ze;if(!G&&Ee){Q=Et?Q:new It(this);var ct=b.apply(Q,ne);return ct.__actions__.push({func:Sx,args:[Re],thisArg:n}),new ho(ct,Fe)}return lt&&Et?b.apply(this,ne):(ct=this.thru(Re),lt?M?ct.value()[0]:ct.value():ct)})}),uo(["pop","push","shift","sort","splice","unshift"],function(b){var S=Y_[b],N=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",M=/^(?:pop|shift)$/.test(b);W.prototype[b]=function(){var j=arguments;if(M&&!this.__chain__){var G=this.value();return S.apply(yt(G)?G:[],j)}return this[N](function(Q){return S.apply(yt(Q)?Q:[],j)})}}),La(It.prototype,function(b,S){var N=W[S];if(N){var M=N.name+"";cn.call(Cp,M)||(Cp[M]=[]),Cp[M].push({name:S,func:N})}}),Cp[gx(n,g).name]=[{name:"wrapper",func:n}],It.prototype.clone=kne,It.prototype.reverse=Dne,It.prototype.value=Nne,W.prototype.at=aie,W.prototype.chain=lie,W.prototype.commit=cie,W.prototype.next=uie,W.prototype.plant=fie,W.prototype.reverse=hie,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=pie,W.prototype.first=W.prototype.head,Vv&&(W.prototype[Vv]=die),W},xp=cne();Yd?((Yd.exports=xp)._=xp,gR._=xp):Jr._=xp}).call(yr)})(DC,DC.exports);var dMe=DC.exports;const fMe=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},PUe=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},ZT={locale:"es-ES"},qp={amount:null,currencyCode:kC.DEFAULT_CURRENCY_CODE,scale:2},ar=class ar extends RQ{constructor(n,r,s){super(n);He(this,"_isNull");He(this,"_options");He(this,"isEmpty",()=>this.isNull());He(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=dr.any().optional().valid(null),i=dr.number().label(r.label?r.label:"amount"),a=dr.alternatives(s,i);return Zl.validate(a,n)}static getMonetaryValueInfo(n){const[r,s]=n.split("."),i=s?s.length:0;return[(r+s).replace(/[^0-9]/g,""),i]}static create(n=qp,r=ZT){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=qp.amount,currencyCode:i=qp.currencyCode,scale:a=qp.scale}=n||{},o=ar.validate(s,r);if(o.isFailure)return _a.fail(CQ(i0.INVALID_INPUT_DATA,o.error.message,r));const c=ar.sanitize(o.object),u=i,f=yS({amount:Number(c),currency:u,precision:a}).setLocale(r.locale);return _a.ok(new this(f,dMe.isNull(c),r))}static createFromFormattedValue(n,r,s=ar.DEFAULT_SCALE,i={locale:ZT.locale}){if(n===null||n==="")return ar.create({amount:null,scale:s,currencyCode:r});const a=String(n),[o,c]=a.split(",");let u=o,f=2;return c===void 0?f=0:(c===""&&(u=o+c.padEnd(1,"0"),f=1),c.length===1?(u=o+c.padEnd(1,"0"),f=1):c.length===2?(u=o+c.padEnd(2,"0"),f=2):c.length===3?(u=o+c.padEnd(3,"0"),f=3):c.length===4&&(u=o+c.padEnd(4,"0"),f=4)),ar.create({amount:u,scale:f,currencyCode:r},i)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return _a.ok(new ar(n,!1,ZT))}static normalizeScale(n){return yS.normalizePrecision(n.map(r=>r.props)).map(r=>ar.createFromDinero(r).object)}static minimum(n){return ar.createFromDinero(yS.minimum(n.map(r=>r.props))).object}static maximum(n){return ar.createFromDinero(yS.maximum(n.map(r=>r.props))).object}static _toString(n,r,s){if(n===null)return"";new Intl.NumberFormat(s,{useGrouping:!0}).format(n===null?0:fMe({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ar._toString(this.isNull()?null:this.getAmount(),this.getScale(),this._options.locale)}toJSON(){var n;return this._isNull?{}:(n=this.props)==null?void 0:n.toJSON()}toPrimitive(){var n;return this._isNull?null:Number((n=this.props)==null?void 0:n.getAmount())}toPrimitives(){return this.toObject()}getAmount(){return this.props.getAmount()}getScale(){return this.props.getPrecision()}convertScale(n,r="HALF_UP"){return this._isNull?ar.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ar.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return kC.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ar.createFromDinero(this.props.add(n.props)).object}subtract(n){return ar.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ar.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ar.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ar.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ar.createFromDinero(r).object)}equalsTo(n){return this.props.equalsTo(n.props)}lessThan(n){return this.props.lessThan(n.props)}lessThanOrEqual(n){return this.props.lessThanOrEqual(n.props)}greaterThan(n){return this.props.greaterThan(n.props)}greaterThanOrEqual(n){return this.props.greaterThanOrEqual(n.props)}isZero(){return this.props.isZero()}isPositive(){return this.props.isPositive()}isNegative(){return this.props.isNegative()}hasSameCurrency(n){return this.props.hasSameCurrency(n.props)}hasSameAmount(n){return this.props.hasSameAmount(n.props)}toFormat(n,r){return this._isNull?"":this.props.toFormat(n,r)}toUnit(){return this.props.toUnit()}toRoundedUnit(n,r){return this.props.toRoundedUnit(n,r)}toObject(){const n=this.props.toObject();return{amount:this._isNull?null:n.amount,scale:n.precision,currency_code:String(n.currency)}}toNumber(){return this.toUnit()}};He(ar,"DEFAULT_SCALE",qp.scale),He(ar,"DEFAULT_CURRENCY_CODE",qp.currencyCode);let NC=ar;class TUe extends dr.ValidationError{}class kUe extends dr.ValidationError{}const yb=0,T$=10,kN=1,DQ=9999,NQ=_.createContext(void 0),hMe=({dataSource:t,children:e})=>P.jsx(NQ.Provider,{value:t,children:e}),DUe=[5,10,15,30,50,75,100],OQ=(t=yb,e=T$)=>{const[n,r]=_.useState({pageIndex:t,pageSize:e});return[n,i=>{const a=i;return a.pageIndexDQ)&&(a.pageSize=kN),r(o=>({...o,pageIndex:i.pageIndex,pageSize:i.pageSize})),a}]},pMe=(t=yb,e=T$)=>{const[n,r]=yOe(),s=n.get("page_index"),i=n.get("page_size"),a=_.useMemo(()=>{const l=parseInt(s??"",10);let d=isNaN(l)?t:l;return d{const l=parseInt(i??"",10);let d=isNaN(l)?e:l;return(dDQ)&&(d=e),d},[i,e]),[c,u]=OQ(a,o);return[c,l=>{const d=u(l);r({page_index:String(d.pageIndex),page_size:String(d.pageSize)})}]},mMe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=pMe(),[i,a]=OQ(e,n);return t?[r,s]:[i,a]},gMe=_.createContext(null),NUe=({syncWithLocation:t=!0,initialGlobalFilter:e=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,a]=mMe({syncWithLocation:t,initialPageIndex:n,initialPageSize:r}),[o,c]=_.useState(e||[]),[u,f]=_.useState([]),l=_.useMemo(()=>!!(o&&o.length),[o]),d=_.useCallback(()=>c([]),[]);return P.jsx(gMe.Provider,{value:{pagination:i,setPagination:a,sorting:u,setSorting:f,globalFilter:o,setGlobalFilter:c,resetGlobalFilter:d,isFiltered:l},children:s})},vMe=se.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex items-center gap-2",t),...e}));vMe.displayName="ButtonGroup";const yMe=({label:t="Cancelar",...e})=>P.jsx(no,{type:"button",variant:"secondary",...e,children:t});yMe.displayName="CancelButton";const bMe=jo("",{variants:{size:{default:"w-4 h-4",sm:"h-3.5 w-3.5",lg:"h-6 w-6",icon:"w-7 h-7"}},defaultVariants:{size:"default"}}),MQ=se.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},a)=>{const o=!!r;return P.jsxs(no,{ref:a,size:n,className:ce(o?"gap-1":"",t),...i,children:[o&&P.jsx(r,{className:ce(bMe({size:n}))}),P.jsx(P.Fragment,{children:e||s})]})});MQ.displayName="CustomButton";const wMe=({label:t="Enviar",...e})=>P.jsx(MQ,{type:"submit",label:t,variant:"default",...e});wMe.displayName="SubmitButton";const _Me=jo("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),xMe=({className:t,as:e="article",variant:n,...r})=>P.jsx(e,{className:ce(_Me({variant:n,className:t})),...r});xMe.displayName="Container";const SMe=()=>{const t=Lv();return P.jsxs(no,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[P.jsx(dL,{className:"w-4 h-4"}),P.jsx("span",{className:"sr-only",children:tr("common.back")})]})};function EMe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const IA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Iv(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function k$(t){return"nodeType"in t}function ei(t){var e,n;return t?Iv(t)?t:k$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function D$(t){const{Document:e}=ei(t);return t instanceof e}function D_(t){return Iv(t)?!1:t instanceof ei(t).HTMLElement}function LQ(t){return t instanceof ei(t).SVGElement}function $v(t){return t?Iv(t)?t.document:k$(t)?D$(t)?t:D_(t)||LQ(t)?t.ownerDocument:document:document:document}const Ra=IA?_.useLayoutEffect:_.useEffect;function $A(t){const e=_.useRef(t);return Ra(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function a0(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return Ra(()=>{n.current!==t&&(n.current=t)},e),n}function N_(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function OC(t){const e=$A(t),n=_.useRef(null),r=_.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function MC(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current}let JT={};function O_(t,e){return _.useMemo(()=>{if(e)return e;const n=JT[t]==null?0:JT[t]+1;return JT[t]=n,t+"-"+n},[t,e])}function IQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const o=Object.entries(a);for(const[c,u]of o){const f=i[c];f!=null&&(i[c]=f+t*u)}return i},{...e})}}const jm=IQ(1),LC=IQ(-1);function AMe(t){return"clientX"in t&&"clientY"in t}function FA(t){if(!t)return!1;const{KeyboardEvent:e}=ei(t.target);return e&&t instanceof e}function RMe(t){if(!t)return!1;const{TouchEvent:e}=ei(t.target);return e&&t instanceof e}function IC(t){if(RMe(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return AMe(t)?{x:t.clientX,y:t.clientY}:null}const Jh=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[Jh.Translate.toString(t),Jh.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),E4="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function PMe(t){return t.matches(E4)?t:t.querySelector(E4)}const TMe={display:"none"};function kMe(t){let{id:e,value:n}=t;return se.createElement("div",{id:e,style:TMe},n)}function DMe(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return se.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function NMe(){const[t,e]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const $Q=_.createContext(null);function OMe(t){const e=_.useContext($Q);_.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function MMe(){const[t]=_.useState(()=>new Set),e=_.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[_.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var o;return(o=a[s])==null?void 0:o.call(a,i)})},[t]),e]}const LMe={draggable:` +}`;var Et=Sj(function(){return en(G,Ze+"return "+Re).apply(n,Q)});if(Et.source=Re,dP(Et))throw Et;return Et}function Pae(b){return rn(b).toLowerCase()}function Tae(b){return rn(b).toUpperCase()}function kae(b,S,N){if(b=rn(b),b&&(N||S===n))return N2(b);if(!b||!(S=Di(S)))return b;var M=Wo(b),j=Wo(S),G=O2(M,j),Q=M2(M,j)+1;return lu(M,G,Q).join("")}function Dae(b,S,N){if(b=rn(b),b&&(N||S===n))return b.slice(0,I2(b)+1);if(!b||!(S=Di(S)))return b;var M=Wo(b),j=M2(M,Wo(S))+1;return lu(M,0,j).join("")}function Nae(b,S,N){if(b=rn(b),b&&(N||S===n))return b.replace(he,"");if(!b||!(S=Di(S)))return b;var M=Wo(b),j=O2(M,Wo(S));return lu(M,j).join("")}function Oae(b,S){var N=D,M=O;if(Yn(S)){var j="separator"in S?S.separator:j;N="length"in S?_t(S.length):N,M="omission"in S?Di(S.omission):M}b=rn(b);var G=b.length;if(_p(b)){var Q=Wo(b);G=Q.length}if(N>=G)return b;var ne=N-xp(M);if(ne<1)return M;var le=Q?lu(Q,0,ne).join(""):b.slice(0,ne);if(j===n)return le+M;if(Q&&(ne+=le.length-ne),fP(j)){if(b.slice(ne).search(j)){var Se,Ee=le;for(j.global||(j=PR(j.source,rn(mt.exec(j))+"g")),j.lastIndex=0;Se=j.exec(Ee);)var Re=Se.index;le=le.slice(0,Re===n?ne:Re)}}else if(b.indexOf(Di(j),ne)!=ne){var Fe=le.lastIndexOf(j);Fe>-1&&(le=le.slice(0,Fe))}return le+M}function Mae(b){return b=rn(b),b&&Ht.test(b)?b.replace(St,cne):b}var Lae=Tp(function(b,S,N){return b+(N?" ":"")+S.toUpperCase()}),mP=EF("toUpperCase");function xj(b,S,N){return b=rn(b),S=N?n:S,S===n?sne(b)?fne(b):Yte(b):b.match(S)||[]}var Sj=At(function(b,S){try{return Ti(b,n,S)}catch(N){return dP(N)?N:new gt(N)}}),Iae=Ll(function(b,S){return uo(S,function(N){N=Fa(N),Ol(b,N,cP(b[N],b))}),b});function $ae(b){var S=b==null?0:b.length,N=at();return b=S?Wn(b,function(M){if(typeof M[1]!="function")throw new fo(a);return[N(M[0]),M[1]]}):[],At(function(M){for(var j=-1;++jH)return[];var N=X,M=ms(b,X);S=at(S),b-=X;for(var j=CR(M,S);++N0||S<0)?new It(N):(b<0?N=N.takeRight(-b):b&&(N=N.drop(b)),S!==n&&(S=_t(S),N=S<0?N.dropRight(-S):N.take(S-b)),N)},It.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},It.prototype.toArray=function(){return this.take(X)},Ia(It.prototype,function(b,S){var N=/^(?:filter|find|map|reject)|While$/.test(S),M=/^(?:head|last)$/.test(S),j=W[M?"take"+(S=="last"?"Right":""):S],G=M||/^find/.test(S);j&&(W.prototype[S]=function(){var Q=this.__wrapped__,ne=M?[1]:arguments,le=Q instanceof It,Se=ne[0],Ee=le||yt(Q),Re=function(kt){var Ft=j.apply(W,nu([kt],ne));return M&&Fe?Ft[0]:Ft};Ee&&N&&typeof Se=="function"&&Se.length!=1&&(le=Ee=!1);var Fe=this.__chain__,Ze=!!this.__actions__.length,lt=G&&!Fe,Et=le&&!Ze;if(!G&&Ee){Q=Et?Q:new It(this);var ct=b.apply(Q,ne);return ct.__actions__.push({func:Ex,args:[Re],thisArg:n}),new ho(ct,Fe)}return lt&&Et?b.apply(this,ne):(ct=this.thru(Re),lt?M?ct.value()[0]:ct.value():ct)})}),uo(["pop","push","shift","sort","splice","unshift"],function(b){var S=X_[b],N=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",M=/^(?:pop|shift)$/.test(b);W.prototype[b]=function(){var j=arguments;if(M&&!this.__chain__){var G=this.value();return S.apply(yt(G)?G:[],j)}return this[N](function(Q){return S.apply(yt(Q)?Q:[],j)})}}),Ia(It.prototype,function(b,S){var N=W[S];if(N){var M=N.name+"";cn.call(Ap,M)||(Ap[M]=[]),Ap[M].push({name:S,func:N})}}),Ap[vx(n,g).name]=[{name:"wrapper",func:n}],It.prototype.clone=Mne,It.prototype.reverse=Lne,It.prototype.value=Ine,W.prototype.at=die,W.prototype.chain=fie,W.prototype.commit=hie,W.prototype.next=pie,W.prototype.plant=gie,W.prototype.reverse=vie,W.prototype.toJSON=W.prototype.valueOf=W.prototype.value=yie,W.prototype.first=W.prototype.head,Vv&&(W.prototype[Vv]=mie),W},Sp=hne();Yd?((Yd.exports=Sp)._=Sp,vR._=Sp):Jr._=Sp}).call(yr)})(NC,NC.exports);var mMe=NC.exports;const gMe=({amount:t,scale:e})=>{const n=10**e;return Number(t)/n},LUe=t=>{const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${r}`},JT={locale:"es-ES"},Kp={amount:null,currencyCode:DC.DEFAULT_CURRENCY_CODE,scale:2},ar=class ar extends DQ{constructor(n,r,s){super(n);He(this,"_isNull");He(this,"_options");He(this,"isEmpty",()=>this.isNull());He(this,"isNull",()=>this._isNull);this._isNull=Object.freeze(r),this._options=Object.freeze(s)}static validate(n,r){const s=dr.any().optional().valid(null),i=dr.number().label(r.label?r.label:"amount"),a=dr.alternatives(s,i);return Jl.validate(a,n)}static getMonetaryValueInfo(n){const[r,s]=n.split("."),i=s?s.length:0;return[(r+s).replace(/[^0-9]/g,""),i]}static create(n=Kp,r=JT){if(n===null)throw new Error("InvalidParams: props params is missing");const{amount:s=Kp.amount,currencyCode:i=Kp.currencyCode,scale:a=Kp.scale}=n||{},o=ar.validate(s,r);if(o.isFailure)return xa.fail(TQ(i0.INVALID_INPUT_DATA,o.error.message,r));const c=ar.sanitize(o.object),u=i,f=bS({amount:Number(c),currency:u,precision:a}).setLocale(r.locale);return xa.ok(new this(f,mMe.isNull(c),r))}static createFromFormattedValue(n,r,s=ar.DEFAULT_SCALE,i={locale:JT.locale}){if(n===null||n==="")return ar.create({amount:null,scale:s,currencyCode:r});const a=String(n),[o,c]=a.split(",");let u=o,f=2;return c===void 0?f=0:(c===""&&(u=o+c.padEnd(1,"0"),f=1),c.length===1?(u=o+c.padEnd(1,"0"),f=1):c.length===2?(u=o+c.padEnd(2,"0"),f=2):c.length===3?(u=o+c.padEnd(3,"0"),f=3):c.length===4&&(u=o+c.padEnd(4,"0"),f=4)),ar.create({amount:u,scale:f,currencyCode:r},i)}static sanitize(n){let r=null;return typeof n=="string"?r=parseFloat(n):r=n,r}static createFromDinero(n){return xa.ok(new ar(n,!1,JT))}static normalizeScale(n){return bS.normalizePrecision(n.map(r=>r.props)).map(r=>ar.createFromDinero(r).object)}static minimum(n){return ar.createFromDinero(bS.minimum(n.map(r=>r.props))).object}static maximum(n){return ar.createFromDinero(bS.maximum(n.map(r=>r.props))).object}static _toString(n,r,s){if(n===null)return"";new Intl.NumberFormat(s,{useGrouping:!0}).format(n===null?0:gMe({amount:n,scale:r}));const i=Math.pow(10,r);return(Number(n)/i).toFixed(r)}toString(){return ar._toString(this.isNull()?null:this.getAmount(),this.getScale(),this._options.locale)}toJSON(){var n;return this._isNull?{}:(n=this.props)==null?void 0:n.toJSON()}toPrimitive(){var n;return this._isNull?null:Number((n=this.props)==null?void 0:n.getAmount())}toPrimitives(){return this.toObject()}getAmount(){return this.props.getAmount()}getScale(){return this.props.getPrecision()}convertScale(n,r="HALF_UP"){return this._isNull?ar.create({amount:null,scale:n,currencyCode:this.getCurrency().code}).object:ar.createFromDinero(this.props.convertPrecision(n,r)).object}getCurrency(){return DC.createFromCode(this.props.getCurrency()).object}getLocale(){return this.props.getLocale()}add(n){return ar.createFromDinero(this.props.add(n.props)).object}subtract(n){return ar.createFromDinero(this.props.subtract(n.props)).object}multiply(n,r){return ar.createFromDinero(this.props.multiply(n,r)).object}divide(n,r){return ar.createFromDinero(this.props.divide(n,r)).object}percentage(n,r){return ar.createFromDinero(this.props.percentage(n,r)).object}allocate(n){return this.props.allocate(n).map(r=>ar.createFromDinero(r).object)}equalsTo(n){return this.props.equalsTo(n.props)}lessThan(n){return this.props.lessThan(n.props)}lessThanOrEqual(n){return this.props.lessThanOrEqual(n.props)}greaterThan(n){return this.props.greaterThan(n.props)}greaterThanOrEqual(n){return this.props.greaterThanOrEqual(n.props)}isZero(){return this.props.isZero()}isPositive(){return this.props.isPositive()}isNegative(){return this.props.isNegative()}hasSameCurrency(n){return this.props.hasSameCurrency(n.props)}hasSameAmount(n){return this.props.hasSameAmount(n.props)}toFormat(n,r){return this._isNull?"":this.props.toFormat(n,r)}toUnit(){return this.props.toUnit()}toRoundedUnit(n,r){return this.props.toRoundedUnit(n,r)}toObject(){const n=this.props.toObject();return{amount:this._isNull?null:n.amount,scale:n.precision,currency_code:String(n.currency)}}toNumber(){return this.toUnit()}};He(ar,"DEFAULT_SCALE",Kp.scale),He(ar,"DEFAULT_CURRENCY_CODE",Kp.currencyCode);let OC=ar;class IUe extends dr.ValidationError{}class $Ue extends dr.ValidationError{}const yb=0,D$=10,DN=1,LQ=9999,IQ=_.createContext(void 0),vMe=({dataSource:t,children:e})=>P.jsx(IQ.Provider,{value:t,children:e}),FUe=[5,10,15,30,50,75,100],$Q=(t=yb,e=D$)=>{const[n,r]=_.useState({pageIndex:t,pageSize:e});return[n,i=>{const a=i;return a.pageIndexLQ)&&(a.pageSize=DN),r(o=>({...o,pageIndex:i.pageIndex,pageSize:i.pageSize})),a}]},yMe=(t=yb,e=D$)=>{const[n,r]=xOe(),s=n.get("page_index"),i=n.get("page_size"),a=_.useMemo(()=>{const l=parseInt(s??"",10);let d=isNaN(l)?t:l;return d{const l=parseInt(i??"",10);let d=isNaN(l)?e:l;return(dLQ)&&(d=e),d},[i,e]),[c,u]=$Q(a,o);return[c,l=>{const d=u(l);r({page_index:String(d.pageIndex),page_size:String(d.pageSize)})}]},bMe=({syncWithLocation:t=!0,initialPageIndex:e,initialPageSize:n})=>{const[r,s]=yMe(),[i,a]=$Q(e,n);return t?[r,s]:[i,a]},wMe=_.createContext(null),jUe=({syncWithLocation:t=!0,initialGlobalFilter:e=[],initialPageIndex:n,initialPageSize:r,children:s})=>{const[i,a]=bMe({syncWithLocation:t,initialPageIndex:n,initialPageSize:r}),[o,c]=_.useState(e||[]),[u,f]=_.useState([]),l=_.useMemo(()=>!!(o&&o.length),[o]),d=_.useCallback(()=>c([]),[]);return P.jsx(wMe.Provider,{value:{pagination:i,setPagination:a,sorting:u,setSorting:f,globalFilter:o,setGlobalFilter:c,resetGlobalFilter:d,isFiltered:l},children:s})},_Me=se.forwardRef(({className:t,...e},n)=>P.jsx("div",{ref:n,className:ce("flex items-center gap-2",t),...e}));_Me.displayName="ButtonGroup";const xMe=({label:t="Cancelar",...e})=>P.jsx(no,{type:"button",variant:"secondary",...e,children:t});xMe.displayName="CancelButton";const SMe=zo("",{variants:{size:{default:"w-4 h-4",sm:"h-3.5 w-3.5",lg:"h-6 w-6",icon:"w-7 h-7"}},defaultVariants:{size:"default"}}),FQ=se.forwardRef(({className:t,label:e,size:n,icon:r,children:s,...i},a)=>{const o=!!r;return P.jsxs(no,{ref:a,size:n,className:ce(o?"gap-1":"",t),...i,children:[o&&P.jsx(r,{className:ce(SMe({size:n}))}),P.jsx(P.Fragment,{children:e||s})]})});FQ.displayName="CustomButton";const EMe=({label:t="Enviar",...e})=>P.jsx(FQ,{type:"submit",label:t,variant:"default",...e});EMe.displayName="SubmitButton";const CMe=zo("p-6",{variants:{variant:{full:"w-full",boxed:"container max-w-3xl lg:max-w-5xl mx-auto"}},defaultVariants:{variant:"full"}}),AMe=({className:t,as:e="article",variant:n,...r})=>P.jsx(e,{className:ce(CMe({variant:n,className:t})),...r});AMe.displayName="Container";const RMe=()=>{const t=Lv();return P.jsxs(no,{variant:"outline",size:"icon",className:"h-7 w-7",onClick:()=>t(-1),children:[P.jsx(hL,{className:"w-4 h-4"}),P.jsx("span",{className:"sr-only",children:tr("common.back")})]})};function PMe(){for(var t=arguments.length,e=new Array(t),n=0;nr=>{e.forEach(s=>s(r))},e)}const $A=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Iv(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function N$(t){return"nodeType"in t}function ei(t){var e,n;return t?Iv(t)?t:N$(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function O$(t){const{Document:e}=ei(t);return t instanceof e}function N_(t){return Iv(t)?!1:t instanceof ei(t).HTMLElement}function jQ(t){return t instanceof ei(t).SVGElement}function $v(t){return t?Iv(t)?t.document:N$(t)?O$(t)?t:N_(t)||jQ(t)?t.ownerDocument:document:document:document}const Pa=$A?_.useLayoutEffect:_.useEffect;function FA(t){const e=_.useRef(t);return Pa(()=>{e.current=t}),_.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s{t.current=setInterval(r,s)},[]),n=_.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function a0(t,e){e===void 0&&(e=[t]);const n=_.useRef(t);return Pa(()=>{n.current!==t&&(n.current=t)},e),n}function O_(t,e){const n=_.useRef();return _.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function MC(t){const e=FA(t),n=_.useRef(null),r=_.useCallback(s=>{s!==n.current&&(e==null||e(s,n.current)),n.current=s},[]);return[n,r]}function LC(t){const e=_.useRef();return _.useEffect(()=>{e.current=t},[t]),e.current}let ek={};function M_(t,e){return _.useMemo(()=>{if(e)return e;const n=ek[t]==null?0:ek[t]+1;return ek[t]=n,t+"-"+n},[t,e])}function zQ(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{const o=Object.entries(a);for(const[c,u]of o){const f=i[c];f!=null&&(i[c]=f+t*u)}return i},{...e})}}const jm=zQ(1),IC=zQ(-1);function kMe(t){return"clientX"in t&&"clientY"in t}function jA(t){if(!t)return!1;const{KeyboardEvent:e}=ei(t.target);return e&&t instanceof e}function DMe(t){if(!t)return!1;const{TouchEvent:e}=ei(t.target);return e&&t instanceof e}function $C(t){if(DMe(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return kMe(t)?{x:t.clientX,y:t.clientY}:null}const ep=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[ep.Translate.toString(t),ep.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),R4="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function NMe(t){return t.matches(R4)?t:t.querySelector(R4)}const OMe={display:"none"};function MMe(t){let{id:e,value:n}=t;return se.createElement("div",{id:e,style:OMe},n)}function LMe(t){let{id:e,announcement:n,ariaLiveType:r="assertive"}=t;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return se.createElement("div",{id:e,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function IMe(){const[t,e]=_.useState("");return{announce:_.useCallback(r=>{r!=null&&e(r)},[]),announcement:t}}const BQ=_.createContext(null);function $Me(t){const e=_.useContext(BQ);_.useEffect(()=>{if(!e)throw new Error("useDndMonitor must be used within a children of ");return e(t)},[t,e])}function FMe(){const[t]=_.useState(()=>new Set),e=_.useCallback(r=>(t.add(r),()=>t.delete(r)),[t]);return[_.useCallback(r=>{let{type:s,event:i}=r;t.forEach(a=>{var o;return(o=a[s])==null?void 0:o.call(a,i)})},[t]),e]}const jMe={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. - `},IMe={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function $Me(t){let{announcements:e=IMe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=LMe}=t;const{announce:i,announcement:a}=NMe(),o=O_("DndLiveRegion"),[c,u]=_.useState(!1);if(_.useEffect(()=>{u(!0)},[]),OMe(_.useMemo(()=>({onDragStart(l){let{active:d}=l;i(e.onDragStart({active:d}))},onDragMove(l){let{active:d,over:m}=l;e.onDragMove&&i(e.onDragMove({active:d,over:m}))},onDragOver(l){let{active:d,over:m}=l;i(e.onDragOver({active:d,over:m}))},onDragEnd(l){let{active:d,over:m}=l;i(e.onDragEnd({active:d,over:m}))},onDragCancel(l){let{active:d,over:m}=l;i(e.onDragCancel({active:d,over:m}))}}),[i,e])),!c)return null;const f=se.createElement(se.Fragment,null,se.createElement(kMe,{id:r,value:s.draggable}),se.createElement(DMe,{id:o,announcement:a}));return n?ks.createPortal(f,n):f}var jr;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(jr||(jr={}));function $C(){}function OUe(t,e){return _.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function MUe(){for(var t=arguments.length,e=new Array(t),n=0;n[...e].filter(r=>r!=null),[...e])}const Pa=Object.freeze({x:0,y:0});function FMe(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function jMe(t,e){const n=IC(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function zMe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function BMe(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function UMe(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function C4(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const LUe=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=C4(e,e.left,e.top),i=[];for(const a of r){const{id:o}=a,c=n.get(o);if(c){const u=FMe(C4(c),s);i.push({id:o,data:{droppableContainer:a,value:u}})}}return i.sort(zMe)};function HMe(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),i=Math.min(e.top+e.height,t.top+t.height),a=s-r,o=i-n;if(r{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const i of r){const{id:a}=i,o=n.get(a);if(o){const c=HMe(o,e);c>0&&s.push({id:a,data:{droppableContainer:i,value:c}})}}return s.sort(BMe)};function WMe(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function FQ(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:Pa}function GMe(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i({...a,top:a.top+t*o.y,bottom:a.bottom+t*o.y,left:a.left+t*o.x,right:a.right+t*o.x}),{...n})}}const qMe=GMe(1);function jQ(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function KMe(t,e,n){const r=jQ(e);if(!r)return t;const{scaleX:s,scaleY:i,x:a,y:o}=r,c=t.left-a-(1-s)*parseFloat(n),u=t.top-o-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),f=s?t.width/s:t.width,l=i?t.height/i:t.height;return{width:f,height:l,top:u,right:c+f,bottom:u+l,left:c}}const YMe={ignoreTransform:!1};function Fv(t,e){e===void 0&&(e=YMe);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:f}=ei(t).getComputedStyle(t);u&&(n=KMe(n,u,f))}const{top:r,left:s,width:i,height:a,bottom:o,right:c}=n;return{top:r,left:s,width:i,height:a,bottom:o,right:c}}function A4(t){return Fv(t,{ignoreTransform:!0})}function XMe(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function QMe(t,e){return e===void 0&&(e=ei(t).getComputedStyle(t)),e.position==="fixed"}function ZMe(t,e){e===void 0&&(e=ei(t).getComputedStyle(t));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=e[s];return typeof i=="string"?n.test(i):!1})}function N$(t,e){const n=[];function r(s){if(e!=null&&n.length>=e||!s)return n;if(D$(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!D_(s)||LQ(s)||n.includes(s))return n;const i=ei(t).getComputedStyle(s);return s!==t&&ZMe(s,i)&&n.push(s),QMe(s,i)?n:r(s.parentNode)}return t?r(t):n}function zQ(t){const[e]=N$(t,1);return e??null}function ek(t){return!IA||!t?null:Iv(t)?t:k$(t)?D$(t)||t===$v(t).scrollingElement?window:D_(t)?t:null:null}function BQ(t){return Iv(t)?t.scrollX:t.scrollLeft}function UQ(t){return Iv(t)?t.scrollY:t.scrollTop}function DN(t){return{x:BQ(t),y:UQ(t)}}var Yr;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(Yr||(Yr={}));function HQ(t){return!IA||!t?!1:t===document.scrollingElement}function VQ(t){const e={x:0,y:0},n=HQ(t)?{height:window.innerHeight,width:window.innerWidth}:{height:t.clientHeight,width:t.clientWidth},r={x:t.scrollWidth-n.width,y:t.scrollHeight-n.height},s=t.scrollTop<=e.y,i=t.scrollLeft<=e.x,a=t.scrollTop>=r.y,o=t.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:o,maxScroll:r,minScroll:e}}const JMe={x:.2,y:.2};function eLe(t,e,n,r,s){let{top:i,left:a,right:o,bottom:c}=n;r===void 0&&(r=10),s===void 0&&(s=JMe);const{isTop:u,isBottom:f,isLeft:l,isRight:d}=VQ(t),m={x:0,y:0},p={x:0,y:0},h={height:e.height*s.y,width:e.width*s.x};return!u&&i<=e.top+h.height?(m.y=Yr.Backward,p.y=r*Math.abs((e.top+h.height-i)/h.height)):!f&&c>=e.bottom-h.height&&(m.y=Yr.Forward,p.y=r*Math.abs((e.bottom-h.height-c)/h.height)),!d&&o>=e.right-h.width?(m.x=Yr.Forward,p.x=r*Math.abs((e.right-h.width-o)/h.width)):!l&&a<=e.left+h.width&&(m.x=Yr.Backward,p.x=r*Math.abs((e.left+h.width-a)/h.width)),{direction:m,speed:p}}function tLe(t){if(t===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:e,left:n,right:r,bottom:s}=t.getBoundingClientRect();return{top:e,left:n,right:r,bottom:s,width:t.clientWidth,height:t.clientHeight}}function WQ(t){return t.reduce((e,n)=>jm(e,DN(n)),Pa)}function nLe(t){return t.reduce((e,n)=>e+BQ(n),0)}function rLe(t){return t.reduce((e,n)=>e+UQ(n),0)}function GQ(t,e){if(e===void 0&&(e=Fv),!t)return;const{top:n,left:r,bottom:s,right:i}=e(t);zQ(t)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&t.scrollIntoView({block:"center",inline:"center"})}const sLe=[["x",["left","right"],nLe],["y",["top","bottom"],rLe]];class O${constructor(e,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=N$(n),s=WQ(r);this.rect={...e},this.width=e.width,this.height=e.height;for(const[i,a,o]of sLe)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=o(r),f=s[i]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class bb{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=e}add(e,n,r){var s;(s=this.target)==null||s.addEventListener(e,n,r),this.listeners.push([e,n,r])}}function iLe(t){const{EventTarget:e}=ei(t);return t instanceof e?t:$v(t)}function tk(t,e){const n=Math.abs(t.x),r=Math.abs(t.y);return typeof e=="number"?Math.sqrt(n**2+r**2)>e:"x"in e&&"y"in e?n>e.x&&r>e.y:"x"in e?n>e.x:"y"in e?r>e.y:!1}var Ro;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(Ro||(Ro={}));function R4(t){t.preventDefault()}function oLe(t){t.stopPropagation()}var nn;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(nn||(nn={}));const qQ={start:[nn.Space,nn.Enter],cancel:[nn.Esc],end:[nn.Space,nn.Enter,nn.Tab]},aLe=(t,e)=>{let{currentCoordinates:n}=e;switch(t.code){case nn.Right:return{...n,x:n.x+25};case nn.Left:return{...n,x:n.x-25};case nn.Down:return{...n,y:n.y+25};case nn.Up:return{...n,y:n.y-25}}};class KQ{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:n}}=e;this.props=e,this.listeners=new bb($v(n)),this.windowListeners=new bb(ei(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ro.Resize,this.handleCancel),this.windowListeners.add(Ro.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ro.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:e,onStart:n}=this.props,r=e.node.current;r&&GQ(r),n(Pa)}handleKeyDown(e){if(FA(e)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=qQ,coordinateGetter:a=aLe,scrollBehavior:o="smooth"}=s,{code:c}=e;if(i.end.includes(c)){this.handleEnd(e);return}if(i.cancel.includes(c)){this.handleCancel(e);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:Pa;this.referenceCoordinates||(this.referenceCoordinates=f);const l=a(e,{active:n,context:r.current,currentCoordinates:f});if(l){const d=LC(l,f),m={x:0,y:0},{scrollableAncestors:p}=r.current;for(const h of p){const y=e.code,{isTop:g,isRight:v,isLeft:w,isBottom:x,maxScroll:A,minScroll:k}=VQ(h),R=tLe(h),E={x:Math.min(y===nn.Right?R.right-R.width/2:R.right,Math.max(y===nn.Right?R.left:R.left+R.width/2,l.x)),y:Math.min(y===nn.Down?R.bottom-R.height/2:R.bottom,Math.max(y===nn.Down?R.top:R.top+R.height/2,l.y))},T=y===nn.Right&&!v||y===nn.Left&&!w,D=y===nn.Down&&!x||y===nn.Up&&!g;if(T&&E.x!==l.x){const O=h.scrollLeft+d.x,L=y===nn.Right&&O<=A.x||y===nn.Left&&O>=k.x;if(L&&!d.y){h.scrollTo({left:O,behavior:o});return}L?m.x=h.scrollLeft-O:m.x=y===nn.Right?h.scrollLeft-A.x:h.scrollLeft-k.x,m.x&&h.scrollBy({left:-m.x,behavior:o});break}else if(D&&E.y!==l.y){const O=h.scrollTop+d.y,L=y===nn.Down&&O<=A.y||y===nn.Up&&O>=k.y;if(L&&!d.x){h.scrollTo({top:O,behavior:o});return}L?m.y=h.scrollTop-O:m.y=y===nn.Down?h.scrollTop-A.y:h.scrollTop-k.y,m.y&&h.scrollBy({top:-m.y,behavior:o});break}}this.handleMove(e,jm(LC(l,this.referenceCoordinates),m))}}}handleMove(e,n){const{onMove:r}=this.props;e.preventDefault(),r(n)}handleEnd(e){const{onEnd:n}=this.props;e.preventDefault(),this.detach(),n()}handleCancel(e){const{onCancel:n}=this.props;e.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}KQ.activators=[{eventName:"onKeyDown",handler:(t,e,n)=>{let{keyboardCodes:r=qQ,onActivation:s}=e,{active:i}=n;const{code:a}=t.nativeEvent;if(r.start.includes(a)){const o=i.activatorNode.current;return o&&t.target!==o?!1:(t.preventDefault(),s==null||s({event:t.nativeEvent}),!0)}return!1}}];function P4(t){return!!(t&&"distance"in t)}function T4(t){return!!(t&&"delay"in t)}class M${constructor(e,n,r){var s;r===void 0&&(r=iLe(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=n;const{event:i}=e,{target:a}=i;this.props=e,this.events=n,this.document=$v(a),this.documentListeners=new bb(this.document),this.listeners=new bb(r),this.windowListeners=new bb(ei(a)),this.initialCoordinates=(s=IC(i))!=null?s:Pa,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:e,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Ro.Resize,this.handleCancel),this.windowListeners.add(Ro.DragStart,R4),this.windowListeners.add(Ro.VisibilityChange,this.handleCancel),this.windowListeners.add(Ro.ContextMenu,R4),this.documentListeners.add(Ro.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(T4(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(P4(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,n){const{active:r,onPending:s}=this.props;s(r,e,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:e}=this,{onStart:n}=this.props;e&&(this.activated=!0,this.documentListeners.add(Ro.Click,oLe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ro.SelectionChange,this.removeTextSelection),n(e))}handleMove(e){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:o}}=i;if(!s)return;const c=(n=IC(e))!=null?n:Pa,u=LC(s,c);if(!r&&o){if(P4(o)){if(o.tolerance!=null&&tk(u,o.tolerance))return this.handleCancel();if(tk(u,o.distance))return this.handleStart()}if(T4(o)&&tk(u,o.tolerance))return this.handleCancel();this.handlePending(o,u);return}e.cancelable&&e.preventDefault(),a(c)}handleEnd(){const{onAbort:e,onEnd:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleCancel(){const{onAbort:e,onCancel:n}=this.props;this.detach(),this.activated||e(this.props.active),n()}handleKeydown(e){e.code===nn.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}}const lLe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class YQ extends M${constructor(e){const{event:n}=e,r=$v(n.target);super(e,lLe,r)}}YQ.activators=[{eventName:"onPointerDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const cLe={move:{name:"mousemove"},end:{name:"mouseup"}};var NN;(function(t){t[t.RightClick=2]="RightClick"})(NN||(NN={}));class uLe extends M${constructor(e){super(e,cLe,$v(e.event.target))}}uLe.activators=[{eventName:"onMouseDown",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;return n.button===NN.RightClick?!1:(r==null||r({event:n}),!0)}}];const nk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class dLe extends M${constructor(e){super(e,nk)}static setup(){return window.addEventListener(nk.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(nk.move.name,e)};function e(){}}}dLe.activators=[{eventName:"onTouchStart",handler:(t,e)=>{let{nativeEvent:n}=t,{onActivation:r}=e;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var wb;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(wb||(wb={}));var FC;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(FC||(FC={}));function fLe(t){let{acceleration:e,activator:n=wb.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:o=FC.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:l,threshold:d}=t;const m=pLe({delta:l,disabled:!i}),[p,h]=CMe(),y=_.useRef({x:0,y:0}),g=_.useRef({x:0,y:0}),v=_.useMemo(()=>{switch(n){case wb.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case wb.DraggableRect:return s}},[n,s,c]),w=_.useRef(null),x=_.useCallback(()=>{const k=w.current;if(!k)return;const R=y.current.x*g.current.x,E=y.current.y*g.current.y;k.scrollBy(R,E)},[]),A=_.useMemo(()=>o===FC.TreeOrder?[...u].reverse():u,[o,u]);_.useEffect(()=>{if(!i||!u.length||!v){h();return}for(const k of A){if((r==null?void 0:r(k))===!1)continue;const R=u.indexOf(k),E=f[R];if(!E)continue;const{direction:T,speed:D}=eLe(k,E,v,e,d);for(const O of["x","y"])m[O][T[O]]||(D[O]=0,T[O]=0);if(D.x>0||D.y>0){h(),w.current=k,p(x,a),y.current=D,g.current=T;return}}y.current={x:0,y:0},g.current={x:0,y:0},h()},[e,x,r,h,i,a,JSON.stringify(v),JSON.stringify(m),p,u,A,f,JSON.stringify(d)])}const hLe={x:{[Yr.Backward]:!1,[Yr.Forward]:!1},y:{[Yr.Backward]:!1,[Yr.Forward]:!1}};function pLe(t){let{delta:e,disabled:n}=t;const r=MC(e);return N_(s=>{if(n||!r||!s)return hLe;const i={x:Math.sign(e.x-r.x),y:Math.sign(e.y-r.y)};return{x:{[Yr.Backward]:s.x[Yr.Backward]||i.x===-1,[Yr.Forward]:s.x[Yr.Forward]||i.x===1},y:{[Yr.Backward]:s.y[Yr.Backward]||i.y===-1,[Yr.Forward]:s.y[Yr.Forward]||i.y===1}}},[n,e,r])}function mLe(t,e){const n=e!=null?t.get(e):void 0,r=n?n.node.current:null;return N_(s=>{var i;return e==null?null:(i=r??s)!=null?i:null},[r,e])}function gLe(t,e){return _.useMemo(()=>t.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:e(a.handler,r)}));return[...n,...i]},[]),[t,e])}var l0;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(l0||(l0={}));var ON;(function(t){t.Optimized="optimized"})(ON||(ON={}));const k4=new Map;function vLe(t,e){let{dragging:n,dependencies:r,config:s}=e;const[i,a]=_.useState(null),{frequency:o,measure:c,strategy:u}=s,f=_.useRef(t),l=y(),d=a0(l),m=_.useCallback(function(g){g===void 0&&(g=[]),!d.current&&a(v=>v===null?g:v.concat(g.filter(w=>!v.includes(w))))},[d]),p=_.useRef(null),h=N_(g=>{if(l&&!n)return k4;if(!g||g===k4||f.current!==t||i!=null){const v=new Map;for(let w of t){if(!w)continue;if(i&&i.length>0&&!i.includes(w.id)&&w.rect.current){v.set(w.id,w.rect.current);continue}const x=w.node.current,A=x?new O$(c(x),x):null;w.rect.current=A,A&&v.set(w.id,A)}return v}return g},[t,i,n,l,c]);return _.useEffect(()=>{f.current=t},[t]),_.useEffect(()=>{l||m()},[n,l]),_.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),_.useEffect(()=>{l||typeof o!="number"||p.current!==null||(p.current=setTimeout(()=>{m(),p.current=null},o))},[o,l,m,...r]),{droppableRects:h,measureDroppableContainers:m,measuringScheduled:i!=null};function y(){switch(u){case l0.Always:return!1;case l0.BeforeDragging:return n;default:return!n}}}function L$(t,e){return N_(n=>t?n||(typeof e=="function"?e(t):t):null,[e,t])}function yLe(t,e){return L$(t,e)}function bLe(t){let{callback:e,disabled:n}=t;const r=$A(e),s=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return _.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function jA(t){let{callback:e,disabled:n}=t;const r=$A(e),s=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return _.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function wLe(t){return new O$(Fv(t),t)}function D4(t,e,n){e===void 0&&(e=wLe);const[r,s]=_.useState(null);function i(){s(c=>{if(!t)return null;if(t.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=e(t);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const a=bLe({callback(c){if(t)for(const u of c){const{type:f,target:l}=u;if(f==="childList"&&l instanceof HTMLElement&&l.contains(t)){i();break}}}}),o=jA({callback:i});return Ra(()=>{i(),t?(o==null||o.observe(t),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[t]),r}function _Le(t){const e=L$(t);return FQ(t,e)}const N4=[];function xLe(t){const e=_.useRef(t),n=N_(r=>t?r&&r!==N4&&t&&e.current&&t.parentNode===e.current.parentNode?r:N$(t):N4,[t]);return _.useEffect(()=>{e.current=t},[t]),n}function SLe(t){const[e,n]=_.useState(null),r=_.useRef(t),s=_.useCallback(i=>{const a=ek(i.target);a&&n(o=>o?(o.set(a,DN(a)),new Map(o)):null)},[]);return _.useEffect(()=>{const i=r.current;if(t!==i){a(i);const o=t.map(c=>{const u=ek(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,DN(u)]):null}).filter(c=>c!=null);n(o.length?new Map(o):null),r.current=t}return()=>{a(t),a(i)};function a(o){o.forEach(c=>{const u=ek(c);u==null||u.removeEventListener("scroll",s)})}},[s,t]),_.useMemo(()=>t.length?e?Array.from(e.values()).reduce((i,a)=>jm(i,a),Pa):WQ(t):Pa,[t,e])}function O4(t,e){e===void 0&&(e=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},e),_.useEffect(()=>{const r=t!==Pa;r&&!n.current&&(n.current=t),!r&&n.current&&(n.current=null)},[t]),n.current?LC(t,n.current):Pa}function ELe(t){_.useEffect(()=>{if(!IA)return;const e=t.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of e)n==null||n()}},t.map(e=>{let{sensor:n}=e;return n}))}function CLe(t,e){return _.useMemo(()=>t.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=a=>{i(a,e)},n},{}),[t,e])}function XQ(t){return _.useMemo(()=>t?XMe(t):null,[t])}const M4=[];function ALe(t,e){e===void 0&&(e=Fv);const[n]=t,r=XQ(n?ei(n):null),[s,i]=_.useState(M4);function a(){i(()=>t.length?t.map(c=>HQ(c)?r:new O$(e(c),c)):M4)}const o=jA({callback:a});return Ra(()=>{o==null||o.disconnect(),a(),t.forEach(c=>o==null?void 0:o.observe(c))},[t]),s}function QQ(t){if(!t)return null;if(t.children.length>1)return t;const e=t.children[0];return D_(e)?e:t}function RLe(t){let{measure:e}=t;const[n,r]=_.useState(null),s=_.useCallback(u=>{for(const{target:f}of u)if(D_(f)){r(l=>{const d=e(f);return l?{...l,width:d.width,height:d.height}:d});break}},[e]),i=jA({callback:s}),a=_.useCallback(u=>{const f=QQ(u);i==null||i.disconnect(),f&&(i==null||i.observe(f)),r(f?e(f):null)},[e,i]),[o,c]=OC(a);return _.useMemo(()=>({nodeRef:o,rect:n,setRef:c}),[n,o,c])}const PLe=[{sensor:YQ,options:{}},{sensor:KQ,options:{}}],TLe={current:{}},qS={draggable:{measure:A4},droppable:{measure:A4,strategy:l0.WhileDragging,frequency:ON.Optimized},dragOverlay:{measure:Fv}};class _b extends Map{get(e){var n;return e!=null&&(n=super.get(e))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:n}=e;return!n})}getNodeFor(e){var n,r;return(n=(r=this.get(e))==null?void 0:r.node.current)!=null?n:void 0}}const kLe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new _b,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$C},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:qS,measureDroppableContainers:$C,windowRect:null,measuringScheduled:!1},ZQ={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$C,draggableNodes:new Map,over:null,measureDroppableContainers:$C},M_=_.createContext(ZQ),JQ=_.createContext(kLe);function DLe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new _b}}}function NLe(t,e){switch(e.type){case jr.DragStart:return{...t,draggable:{...t.draggable,initialCoordinates:e.initialCoordinates,active:e.active}};case jr.DragMove:return t.draggable.active==null?t:{...t,draggable:{...t.draggable,translate:{x:e.coordinates.x-t.draggable.initialCoordinates.x,y:e.coordinates.y-t.draggable.initialCoordinates.y}}};case jr.DragEnd:case jr.DragCancel:return{...t,draggable:{...t.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case jr.RegisterDroppable:{const{element:n}=e,{id:r}=n,s=new _b(t.droppable.containers);return s.set(r,n),{...t,droppable:{...t.droppable,containers:s}}}case jr.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=e,i=t.droppable.containers.get(n);if(!i||r!==i.key)return t;const a=new _b(t.droppable.containers);return a.set(n,{...i,disabled:s}),{...t,droppable:{...t.droppable,containers:a}}}case jr.UnregisterDroppable:{const{id:n,key:r}=e,s=t.droppable.containers.get(n);if(!s||r!==s.key)return t;const i=new _b(t.droppable.containers);return i.delete(n),{...t,droppable:{...t.droppable,containers:i}}}default:return t}}function OLe(t){let{disabled:e}=t;const{active:n,activatorEvent:r,draggableNodes:s}=_.useContext(M_),i=MC(r),a=MC(n==null?void 0:n.id);return _.useEffect(()=>{if(!e&&!r&&i&&a!=null){if(!FA(i)||document.activeElement===i.target)return;const o=s.get(a);if(!o)return;const{activatorNode:c,node:u}=o;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const l=PMe(f);if(l){l.focus();break}}})}},[r,e,s,a,i]),null}function eZ(t,e){let{transform:n,...r}=e;return t!=null&&t.length?t.reduce((s,i)=>i({transform:s,...r}),n):n}function MLe(t){return _.useMemo(()=>({draggable:{...qS.draggable,...t==null?void 0:t.draggable},droppable:{...qS.droppable,...t==null?void 0:t.droppable},dragOverlay:{...qS.dragOverlay,...t==null?void 0:t.dragOverlay}}),[t==null?void 0:t.draggable,t==null?void 0:t.droppable,t==null?void 0:t.dragOverlay])}function LLe(t){let{activeNode:e,measure:n,initialRect:r,config:s=!0}=t;const i=_.useRef(!1),{x:a,y:o}=typeof s=="boolean"?{x:s,y:s}:s;Ra(()=>{if(!a&&!o||!e){i.current=!1;return}if(i.current||!r)return;const u=e==null?void 0:e.node.current;if(!u||u.isConnected===!1)return;const f=n(u),l=FQ(f,r);if(a||(l.x=0),o||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){const d=zQ(u);d&&d.scrollBy({top:l.y,left:l.x})}},[e,a,o,r,n])}const zA=_.createContext({...Pa,scaleX:1,scaleY:1});var Cu;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(Cu||(Cu={}));const IUe=_.memo(function(e){var n,r,s,i;let{id:a,accessibility:o,autoScroll:c=!0,children:u,sensors:f=PLe,collisionDetection:l=VMe,measuring:d,modifiers:m,...p}=e;const h=_.useReducer(NLe,void 0,DLe),[y,g]=h,[v,w]=MMe(),[x,A]=_.useState(Cu.Uninitialized),k=x===Cu.Initialized,{draggable:{active:R,nodes:E,translate:T},droppable:{containers:D}}=y,O=R!=null?E.get(R):null,L=_.useRef({initial:null,translated:null}),I=_.useMemo(()=>{var nt;return R!=null?{id:R,data:(nt=O==null?void 0:O.data)!=null?nt:TLe,rect:L}:null},[R,O]),F=_.useRef(null),[U,Y]=_.useState(null),[V,H]=_.useState(null),ee=a0(p,Object.values(p)),re=O_("DndDescribedBy",a),X=_.useMemo(()=>D.getEnabled(),[D]),q=MLe(d),{droppableRects:K,measureDroppableContainers:Z,measuringScheduled:ue}=vLe(X,{dragging:k,dependencies:[T.x,T.y],config:q.droppable}),de=mLe(E,R),ie=_.useMemo(()=>V?IC(V):null,[V]),be=St(),Ae=yLe(de,q.draggable.measure);LLe({activeNode:R!=null?E.get(R):null,config:be.layoutShiftCompensation,initialRect:Ae,measure:q.draggable.measure});const _e=D4(de,q.draggable.measure,Ae),Me=D4(de?de.parentElement:null),Ne=_.useRef({activatorEvent:null,active:null,activeNode:de,collisionRect:null,collisions:null,droppableRects:K,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ye=D.getNodeFor((n=Ne.current.over)==null?void 0:n.id),$e=RLe({measure:q.dragOverlay.measure}),ut=(r=$e.nodeRef.current)!=null?r:de,Qe=k?(s=$e.rect)!=null?s:_e:null,vt=!!($e.nodeRef.current&&$e.rect),Sn=_Le(vt?null:_e),Yt=XQ(ut?ei(ut):null),mn=xLe(k?ye??de:null),Xt=ALe(mn),J=eZ(m,{transform:{x:T.x-Sn.x,y:T.y-Sn.y,scaleX:1,scaleY:1},activatorEvent:V,active:I,activeNodeRect:_e,containerNodeRect:Me,draggingNodeRect:Qe,over:Ne.current.over,overlayNodeRect:$e.rect,scrollableAncestors:mn,scrollableAncestorRects:Xt,windowRect:Yt}),fe=ie?jm(ie,T):null,ge=SLe(mn),Pe=O4(ge),Oe=O4(ge,[_e]),xe=jm(J,Pe),Te=Qe?qMe(Qe,J):null,Ye=I&&Te?l({active:I,collisionRect:Te,droppableRects:K,droppableContainers:X,pointerCoordinates:fe}):null,Rt=UMe(Ye,"id"),[bt,Os]=_.useState(null),Kn=vt?J:jm(J,Oe),ps=WMe(Kn,(i=bt==null?void 0:bt.rect)!=null?i:null,_e),Ut=_.useRef(null),on=_.useCallback((nt,Ht)=>{let{sensor:Ct,options:vn}=Ht;if(F.current==null)return;const an=E.get(F.current);if(!an)return;const ln=nt.nativeEvent,Tn=new Ct({active:F.current,activeNode:an,event:ln,options:vn,context:Ne,onAbort(kn){if(!E.get(kn))return;const{onDragAbort:oe}=ee.current,he={id:kn};oe==null||oe(he),v({type:"onDragAbort",event:he})},onPending(kn,te,oe,he){if(!E.get(kn))return;const{onDragPending:Le}=ee.current,qe={id:kn,constraint:te,initialCoordinates:oe,offset:he};Le==null||Le(qe),v({type:"onDragPending",event:qe})},onStart(kn){const te=F.current;if(te==null)return;const oe=E.get(te);if(!oe)return;const{onDragStart:he}=ee.current,Ce={activatorEvent:ln,active:{id:te,data:oe.data,rect:L}};ks.unstable_batchedUpdates(()=>{he==null||he(Ce),A(Cu.Initializing),g({type:jr.DragStart,initialCoordinates:kn,active:te}),v({type:"onDragStart",event:Ce}),Y(Ut.current),H(ln)})},onMove(kn){g({type:jr.DragMove,coordinates:kn})},onEnd:hr(jr.DragEnd),onCancel:hr(jr.DragCancel)});Ut.current=Tn;function hr(kn){return async function(){const{active:oe,collisions:he,over:Ce,scrollAdjustedTranslate:Le}=Ne.current;let qe=null;if(oe&&Le){const{cancelDrop:st}=ee.current;qe={activatorEvent:ln,active:oe,collisions:he,delta:Le,over:Ce},kn===jr.DragEnd&&typeof st=="function"&&await Promise.resolve(st(qe))&&(kn=jr.DragCancel)}F.current=null,ks.unstable_batchedUpdates(()=>{g({type:kn}),A(Cu.Uninitialized),Os(null),Y(null),H(null),Ut.current=null;const st=kn===jr.DragEnd?"onDragEnd":"onDragCancel";if(qe){const Ue=ee.current[st];Ue==null||Ue(qe),v({type:st,event:qe})}})}}},[E]),gn=_.useCallback((nt,Ht)=>(Ct,vn)=>{const an=Ct.nativeEvent,ln=E.get(vn);if(F.current!==null||!ln||an.dndKit||an.defaultPrevented)return;const Tn={active:ln};nt(Ct,Ht.options,Tn)===!0&&(an.dndKit={capturedBy:Ht.sensor},F.current=vn,on(Ct,Ht))},[E,on]),Be=gLe(f,gn);ELe(f),Ra(()=>{_e&&x===Cu.Initializing&&A(Cu.Initialized)},[_e,x]),_.useEffect(()=>{const{onDragMove:nt}=ee.current,{active:Ht,activatorEvent:Ct,collisions:vn,over:an}=Ne.current;if(!Ht||!Ct)return;const ln={active:Ht,activatorEvent:Ct,collisions:vn,delta:{x:xe.x,y:xe.y},over:an};ks.unstable_batchedUpdates(()=>{nt==null||nt(ln),v({type:"onDragMove",event:ln})})},[xe.x,xe.y]),_.useEffect(()=>{const{active:nt,activatorEvent:Ht,collisions:Ct,droppableContainers:vn,scrollAdjustedTranslate:an}=Ne.current;if(!nt||F.current==null||!Ht||!an)return;const{onDragOver:ln}=ee.current,Tn=vn.get(Rt),hr=Tn&&Tn.rect.current?{id:Tn.id,rect:Tn.rect.current,data:Tn.data,disabled:Tn.disabled}:null,kn={active:nt,activatorEvent:Ht,collisions:Ct,delta:{x:an.x,y:an.y},over:hr};ks.unstable_batchedUpdates(()=>{Os(hr),ln==null||ln(kn),v({type:"onDragOver",event:kn})})},[Rt]),Ra(()=>{Ne.current={activatorEvent:V,active:I,activeNode:de,collisionRect:Te,collisions:Ye,droppableRects:K,draggableNodes:E,draggingNode:ut,draggingNodeRect:Qe,droppableContainers:D,over:bt,scrollableAncestors:mn,scrollAdjustedTranslate:xe},L.current={initial:Qe,translated:Te}},[I,de,Ye,Te,E,ut,Qe,K,D,bt,mn,xe]),fLe({...be,delta:T,draggingRect:Te,pointerCoordinates:fe,scrollableAncestors:mn,scrollableAncestorRects:Xt});const it=_.useMemo(()=>({active:I,activeNode:de,activeNodeRect:_e,activatorEvent:V,collisions:Ye,containerNodeRect:Me,dragOverlay:$e,draggableNodes:E,droppableContainers:D,droppableRects:K,over:bt,measureDroppableContainers:Z,scrollableAncestors:mn,scrollableAncestorRects:Xt,measuringConfiguration:q,measuringScheduled:ue,windowRect:Yt}),[I,de,_e,V,Ye,Me,$e,E,D,K,bt,Z,mn,Xt,q,ue,Yt]),ot=_.useMemo(()=>({activatorEvent:V,activators:Be,active:I,activeNodeRect:_e,ariaDescribedById:{draggable:re},dispatch:g,draggableNodes:E,over:bt,measureDroppableContainers:Z}),[V,Be,I,_e,g,re,E,bt,Z]);return se.createElement($Q.Provider,{value:w},se.createElement(M_.Provider,{value:ot},se.createElement(JQ.Provider,{value:it},se.createElement(zA.Provider,{value:ps},u)),se.createElement(OLe,{disabled:(o==null?void 0:o.restoreFocus)===!1})),se.createElement($Me,{...o,hiddenTextDescribedById:re}));function St(){const nt=(U==null?void 0:U.autoScrollEnabled)===!1,Ht=typeof c=="object"?c.enabled===!1:c===!1,Ct=k&&!nt&&!Ht;return typeof c=="object"?{...c,enabled:Ct}:{enabled:Ct}}}),ILe=_.createContext(null),L4="button",$Le="Draggable";function FLe(t){let{id:e,data:n,disabled:r=!1,attributes:s}=t;const i=O_($Le),{activators:a,activatorEvent:o,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:l,over:d}=_.useContext(M_),{role:m=L4,roleDescription:p="draggable",tabIndex:h=0}=s??{},y=(c==null?void 0:c.id)===e,g=_.useContext(y?zA:ILe),[v,w]=OC(),[x,A]=OC(),k=CLe(a,e),R=a0(n);Ra(()=>(l.set(e,{id:e,key:i,node:v,activatorNode:x,data:R}),()=>{const T=l.get(e);T&&T.key===i&&l.delete(e)}),[l,e]);const E=_.useMemo(()=>({role:m,tabIndex:h,"aria-disabled":r,"aria-pressed":y&&m===L4?!0:void 0,"aria-roledescription":p,"aria-describedby":f.draggable}),[r,m,h,y,p,f.draggable]);return{active:c,activatorEvent:o,activeNodeRect:u,attributes:E,isDragging:y,listeners:r?void 0:k,node:v,over:d,setNodeRef:w,setActivatorNodeRef:A,transform:g}}function tZ(){return _.useContext(JQ)}const jLe="Droppable",zLe={timeout:25};function BLe(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:s}=t;const i=O_(jLe),{active:a,dispatch:o,over:c,measureDroppableContainers:u}=_.useContext(M_),f=_.useRef({disabled:n}),l=_.useRef(!1),d=_.useRef(null),m=_.useRef(null),{disabled:p,updateMeasurementsFor:h,timeout:y}={...zLe,...s},g=a0(h??r),v=_.useCallback(()=>{if(!l.current){l.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(g.current)?g.current:[g.current]),m.current=null},y)},[y]),w=jA({callback:v,disabled:p||!a}),x=_.useCallback((E,T)=>{w&&(T&&(w.unobserve(T),l.current=!1),E&&w.observe(E))},[w]),[A,k]=OC(x),R=a0(e);return _.useEffect(()=>{!w||!A.current||(w.disconnect(),l.current=!1,w.observe(A.current))},[A,w]),_.useEffect(()=>(o({type:jr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:A,rect:d,data:R}}),()=>o({type:jr.UnregisterDroppable,key:i,id:r})),[r]),_.useEffect(()=>{n!==f.current.disabled&&(o({type:jr.SetDroppableDisabled,id:r,key:i,disabled:n}),f.current.disabled=n)},[r,i,n,o]),{active:a,rect:d,isOver:(c==null?void 0:c.id)===r,node:A,over:c,setNodeRef:k}}function ULe(t){let{animation:e,children:n}=t;const[r,s]=_.useState(null),[i,a]=_.useState(null),o=MC(n);return!n&&!r&&o&&s(o),Ra(()=>{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){s(null);return}Promise.resolve(e(u,i)).then(()=>{s(null)})},[e,r,i]),se.createElement(se.Fragment,null,n,r?_.cloneElement(r,{ref:a}):null)}const HLe={x:0,y:0,scaleX:1,scaleY:1};function VLe(t){let{children:e}=t;return se.createElement(M_.Provider,{value:ZQ},se.createElement(zA.Provider,{value:HLe},e))}const WLe={position:"fixed",touchAction:"none"},GLe=t=>FA(t)?"transform 250ms ease":void 0,qLe=_.forwardRef((t,e)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:a,rect:o,style:c,transform:u,transition:f=GLe}=t;if(!o)return null;const l=s?u:{...u,scaleX:1,scaleY:1},d={...WLe,width:o.width,height:o.height,top:o.top,left:o.left,transform:Jh.Transform.toString(l),transformOrigin:s&&r?jMe(r,o):void 0,transition:typeof f=="function"?f(r):f,...c};return se.createElement(n,{className:a,style:d,ref:e},i)}),KLe=t=>e=>{let{active:n,dragOverlay:r}=e;const s={},{styles:i,className:a}=t;if(i!=null&&i.active)for(const[o,c]of Object.entries(i.active))c!==void 0&&(s[o]=n.node.style.getPropertyValue(o),n.node.style.setProperty(o,c));if(i!=null&&i.dragOverlay)for(const[o,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(o,c);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(s))n.node.style.setProperty(c,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},YLe=t=>{let{transform:{initial:e,final:n}}=t;return[{transform:Jh.Transform.toString(e)},{transform:Jh.Transform.toString(n)}]},XLe={duration:250,easing:"ease",keyframes:YLe,sideEffects:KLe({styles:{active:{opacity:"0"}}})};function QLe(t){let{config:e,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=t;return $A((i,a)=>{if(e===null)return;const o=n.get(i);if(!o)return;const c=o.node.current;if(!c)return;const u=QQ(a);if(!u)return;const{transform:f}=ei(a).getComputedStyle(a),l=jQ(f);if(!l)return;const d=typeof e=="function"?e:ZLe(e);return GQ(c,s.draggable.measure),d({active:{id:i,data:o.data,node:c,rect:s.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:a,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:l})})}function ZLe(t){const{duration:e,easing:n,sideEffects:r,keyframes:s}={...XLe,...t};return i=>{let{active:a,dragOverlay:o,transform:c,...u}=i;if(!e)return;const f={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},l={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/o.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/o.rect.height:1},d={x:c.x-f.x,y:c.y-f.y,...l},m=s({...u,active:a,dragOverlay:o,transform:{initial:c,final:d}}),[p]=m,h=m[m.length-1];if(JSON.stringify(p)===JSON.stringify(h))return;const y=r==null?void 0:r({active:a,dragOverlay:o,...u}),g=o.node.animate(m,{duration:e,easing:n,fill:"forwards"});return new Promise(v=>{g.onfinish=()=>{y==null||y(),v()}})}}let I4=0;function JLe(t){return _.useMemo(()=>{if(t!=null)return I4++,I4},[t])}const $Ue=se.memo(t=>{let{adjustScale:e=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:a,wrapperElement:o="div",className:c,zIndex:u=999}=t;const{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:m,draggableNodes:p,droppableContainers:h,dragOverlay:y,over:g,measuringConfiguration:v,scrollableAncestors:w,scrollableAncestorRects:x,windowRect:A}=tZ(),k=_.useContext(zA),R=JLe(l==null?void 0:l.id),E=eZ(a,{activatorEvent:f,active:l,activeNodeRect:d,containerNodeRect:m,draggingNodeRect:y.rect,over:g,overlayNodeRect:y.rect,scrollableAncestors:w,scrollableAncestorRects:x,transform:k,windowRect:A}),T=L$(d),D=QLe({config:r,draggableNodes:p,droppableContainers:h,measuringConfiguration:v}),O=T?y.setRef:void 0;return se.createElement(VLe,null,se.createElement(ULe,{animation:D},l&&R?se.createElement(qLe,{key:R,id:l.id,ref:O,as:o,activatorEvent:f,adjustScale:e,className:c,transition:i,rect:T,style:{zIndex:u,...s},transform:E},n):null))});function nZ(t,e,n){const r=t.slice();return r.splice(n<0?r.length+n:n,0,r.splice(e,1)[0]),r}function eIe(t,e){return t.reduce((n,r,s)=>{const i=e.get(r);return i&&(n[s]=i),n},Array(t.length))}function bS(t){return t!==null&&t>=0}function tIe(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n{let{rects:e,activeIndex:n,overIndex:r,index:s}=t;const i=nZ(e,r,n),a=e[s],o=i[s];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},wS={scaleX:1,scaleY:1},FUe=t=>{var e;let{activeIndex:n,activeNodeRect:r,index:s,rects:i,overIndex:a}=t;const o=(e=i[n])!=null?e:r;if(!o)return null;if(s===n){const u=i[a];return u?{x:0,y:nn&&s<=a?{x:0,y:-o.height-c,...wS}:s=a?{x:0,y:o.height+c,...wS}:{x:0,y:0,...wS}};function rIe(t,e,n){const r=t[e],s=t[e-1],i=t[e+1];return r?nr.map(k=>typeof k=="object"&&"id"in k?k.id:k),[r]),p=a!=null,h=a?m.indexOf(a.id):-1,y=u?m.indexOf(u.id):-1,g=_.useRef(m),v=!tIe(m,g.current),w=y!==-1&&h===-1||v,x=nIe(i);Ra(()=>{v&&p&&f(m)},[v,m,p,f]),_.useEffect(()=>{g.current=m},[m]);const A=_.useMemo(()=>({activeIndex:h,containerId:l,disabled:x,disableTransforms:w,items:m,overIndex:y,useDragOverlay:d,sortedRects:eIe(m,c),strategy:s}),[h,l,x.draggable,x.droppable,w,m,y,c,d,s]);return se.createElement(iZ.Provider,{value:A},e)}const sIe=t=>{let{id:e,items:n,activeIndex:r,overIndex:s}=t;return nZ(n,r,s).indexOf(e)},iIe=t=>{let{containerId:e,isSorting:n,wasDragging:r,index:s,items:i,newIndex:a,previousItems:o,previousContainerId:c,transition:u}=t;return!u||!r||o!==i&&s===a?!1:n?!0:a!==s&&e===c},oIe={duration:200,easing:"ease"},oZ="transform",aIe=Jh.Transition.toString({property:oZ,duration:0,easing:"linear"}),lIe={roleDescription:"sortable"};function cIe(t){let{disabled:e,index:n,node:r,rect:s}=t;const[i,a]=_.useState(null),o=_.useRef(n);return Ra(()=>{if(!e&&n!==o.current&&r.current){const c=s.current;if(c){const u=Fv(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&a(f)}}n!==o.current&&(o.current=n)},[e,n,r,s]),_.useEffect(()=>{i&&a(null)},[i]),i}function zUe(t){let{animateLayoutChanges:e=iIe,attributes:n,disabled:r,data:s,getNewIndex:i=sIe,id:a,strategy:o,resizeObserverConfig:c,transition:u=oIe}=t;const{items:f,containerId:l,activeIndex:d,disabled:m,disableTransforms:p,sortedRects:h,overIndex:y,useDragOverlay:g,strategy:v}=_.useContext(iZ),w=uIe(r,m),x=f.indexOf(a),A=_.useMemo(()=>({sortable:{containerId:l,index:x,items:f},...s}),[l,s,x,f]),k=_.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:R,node:E,isOver:T,setNodeRef:D}=BLe({id:a,data:A,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...c}}),{active:O,activatorEvent:L,activeNodeRect:I,attributes:F,setNodeRef:U,listeners:Y,isDragging:V,over:H,setActivatorNodeRef:ee,transform:re}=FLe({id:a,data:A,attributes:{...lIe,...n},disabled:w.draggable}),X=EMe(D,U),q=!!O,K=q&&!p&&bS(d)&&bS(y),Z=!g&&V,ue=Z&&K?re:null,ie=K?ue??(o??v)({rects:h,activeNodeRect:I,activeIndex:d,overIndex:y,index:x}):null,be=bS(d)&&bS(y)?i({id:a,items:f,activeIndex:d,overIndex:y}):x,Ae=O==null?void 0:O.id,_e=_.useRef({activeId:Ae,items:f,newIndex:be,containerId:l}),Me=f!==_e.current.items,Ne=e({active:O,containerId:l,isDragging:V,isSorting:q,id:a,index:x,items:f,newIndex:_e.current.newIndex,previousItems:_e.current.items,previousContainerId:_e.current.containerId,transition:u,wasDragging:_e.current.activeId!=null}),ye=cIe({disabled:!Ne,index:x,node:E,rect:R});return _.useEffect(()=>{q&&_e.current.newIndex!==be&&(_e.current.newIndex=be),l!==_e.current.containerId&&(_e.current.containerId=l),f!==_e.current.items&&(_e.current.items=f)},[q,be,l,f]),_.useEffect(()=>{if(Ae===_e.current.activeId)return;if(Ae&&!_e.current.activeId){_e.current.activeId=Ae;return}const ut=setTimeout(()=>{_e.current.activeId=Ae},50);return()=>clearTimeout(ut)},[Ae]),{active:O,activeIndex:d,attributes:F,data:A,rect:R,index:x,newIndex:be,items:f,isOver:T,isSorting:q,isDragging:V,listeners:Y,node:E,overIndex:y,over:H,setNodeRef:X,setActivatorNodeRef:ee,setDroppableNodeRef:D,setDraggableNodeRef:U,transform:ye??ie,transition:$e()};function $e(){if(ye||Me&&_e.current.newIndex===x)return aIe;if(!(Z&&!FA(L)||!u)&&(q||Ne))return Jh.Transition.toString({...u,property:oZ})}}function uIe(t,e){var n,r;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(n=t==null?void 0:t.draggable)!=null?n:e.draggable,droppable:(r=t==null?void 0:t.droppable)!=null?r:e.droppable}}nn.Down,nn.Right,nn.Up,nn.Left;const aZ=({title:t="Se ha producido un error",subtitle:e=void 0,description:n=void 0,errorMessage:r=void 0})=>{const s=Lv();return P.jsx("div",{className:"grid h-screen place-items-center ",children:P.jsxs("div",{className:"text-center",children:[P.jsx("h2",{className:"mt-2 text-xl font-semibold text-center text-slate-900",children:t}),P.jsxs("p",{className:"mt-1 font-medium text-slate-500",children:[e||r,P.jsx("br",{}),n]}),P.jsxs("div",{className:"mt-6 space-x-8 md:ml-4",children:[P.jsx(SMe,{}),P.jsxs(no,{onClick:()=>s("/"),children:[P.jsx(Sfe,{className:"w-4 h-4 mr-2"})," Ir al inicio"]})]})]})})};aZ.displayName="ErrorOverlay";var Zt=function(){return Zt=Object.assign||function(e){for(var n,r=1,s=arguments.length;r1){if(n===0)return t.replace(e,"");if(t.includes(e)){var r=t.split(e),s=r[0],i=r[1];if(i.length===n)return t;if(i.length>n)return"".concat(s).concat(e).concat(i.slice(0,n))}var a=t.length>n?new RegExp("(\\d+)(\\d{".concat(n,"})")):new RegExp("(\\d)(\\d+)"),o=t.match(a);if(o){var s=o[1],i=o[2];return"".concat(s).concat(e).concat(i)}}return t},lZ=function(t,e){var n=e.groupSeparator,r=n===void 0?",":n,s=e.decimalSeparator,i=s===void 0?".":s,a=new RegExp("\\d([^".concat(_l(r)).concat(_l(i),"0-9]+)")),o=t.match(a);return o?o[1]:void 0},Ry=function(t){var e=t.value,n=t.decimalSeparator,r=t.intlConfig,s=t.decimalScale,i=t.prefix,a=i===void 0?"":i,o=t.suffix,c=o===void 0?"":o;if(e===""||e===void 0)return"";if(e==="-")return"-";var u=new RegExp("^\\d?-".concat(a?"".concat(_l(a),"?"):"","\\d")).test(e),f=n!=="."?gIe(e,n,u):e;n&&n!=="-"&&f.startsWith(n)&&(f="0"+f);var l=r||{},d=l.locale,m=l.currency,p=I$(l,["locale","currency"]),h=Zt(Zt({},p),{minimumFractionDigits:s||0,maximumFractionDigits:20}),y=r?new Intl.NumberFormat(d,Zt(Zt({},h),m&&{style:"currency",currency:m})):new Intl.NumberFormat(void 0,h),g=y.formatToParts(Number(f)),v=vIe(g,t),w=lZ(v,Zt({},t)),x=e.slice(-1)===n?n:"",A=f.match(RegExp("\\d+\\.(\\d+)"))||[],k=A[1];return s===void 0&&k&&n&&(v.includes(n)?v=v.replace(RegExp("(\\d+)(".concat(_l(n),")(\\d+)"),"g"),"$1$2".concat(k)):w&&!c?v=v.replace(w,"".concat(n).concat(k).concat(w)):v="".concat(v).concat(n).concat(k)),c&&x?"".concat(v).concat(x).concat(c):w&&x?v.replace(w,"".concat(x).concat(w)):w&&c?v.replace(w,"".concat(x).concat(c)):[v,x,c].join("")},gIe=function(t,e,n){var r=t;return e&&e!=="."&&(r=r.replace(RegExp(_l(e),"g"),"."),n&&e==="-"&&(r="-".concat(r.slice(1)))),r},vIe=function(t,e){var n=e.prefix,r=e.groupSeparator,s=e.decimalSeparator,i=e.decimalScale,a=e.disableGroupSeparators,o=a===void 0?!1:a;return t.reduce(function(c,u,f){var l=u.type,d=u.value;return f===0&&n?l==="minusSign"?[d,n]:l==="currency"?$i($i([],c,!0),[n],!1):[n,d]:l==="currency"?n?c:$i($i([],c,!0),[d],!1):l==="group"?o?c:$i($i([],c,!0),[r!==void 0?r:d],!1):l==="decimal"?i!==void 0&&i===0?c:$i($i([],c,!0),[s!==void 0?s:d],!1):l==="fraction"?$i($i([],c,!0),[i!==void 0?d.slice(0,i):d],!1):$i($i([],c,!0),[d],!1)},[""]).join("")},yIe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},bIe=function(t){var e=t||{},n=e.locale,r=e.currency,s=I$(e,["locale","currency"]),i=n?new Intl.NumberFormat(n,Zt(Zt({},s),r&&{currency:r,style:"currency"})):new Intl.NumberFormat;return i.formatToParts(1000.1).reduce(function(a,o,c){return o.type==="currency"?c===0?Zt(Zt({},a),{currencySymbol:o.value,prefix:o.value}):Zt(Zt({},a),{currencySymbol:o.value,suffix:o.value}):o.type==="group"?Zt(Zt({},a),{groupSeparator:o.value}):o.type==="decimal"?Zt(Zt({},a),{decimalSeparator:o.value}):a},yIe)},$4=function(t){return RegExp(/\d/,"gi").test(t)},wIe=function(t,e,n){if(n===void 0||e===""||e===void 0||t===""||t===void 0)return t;if(!t.match(/\d/g))return"";var r=t.split(e),s=r[0],i=r[1];if(n===0)return s;var a=i||"";if(a.lengthp)){if(ot===""||ot==="-"||ot===de){y&&y(void 0,o,{float:null,formatted:"",value:""}),Ne(ot),Sn(1);return}var St=de?ot.replace(de,"."):ot,nt=parseFloat(St),Ht=Ry(Zt({value:ot},be));if(it!=null){var Ct=it+(Ht.length-Ut.length);Ct=Ct<=0?x?x.length:0:Ct,Sn(Ct),Xt(mn+1)}if(Ne(Ht),y){var vn={float:nt,formatted:Ht,value:ot};y(ot,o,vn)}}},xe=function(Ut){var on=Ut.target,gn=on.value,Be=on.selectionStart;Oe(gn,Be),Y&&Y(Ut)},Te=function(Ut){return V&&V(Ut),Me?Me.length:0},Ye=function(Ut){var on=Ut.target.value,gn=rk(Zt({value:on},Ae));if(gn==="-"||gn===de||!gn){Ne(""),H&&H(Ut);return}var Be=mIe(gn,de,g),it=wIe(Be,de,w!==void 0?w:g),ot=de?it.replace(de,"."):it,St=parseFloat(ot),nt=Ry(Zt(Zt({},be),{value:it}));y&&K&&y(it,o,{float:St,formatted:nt,value:it}),Ne(nt),H&&H(Ut)},Rt=function(Ut){var on=Ut.key;if(ge(on),R&&(on==="ArrowUp"||on==="ArrowDown")){Ut.preventDefault(),Sn(Me.length);var gn=h!=null?String(h):void 0,Be=de&&gn?gn.replace(de,"."):gn,it=parseFloat(Be??rk(Zt({value:Me},Ae)))||0,ot=on==="ArrowUp"?it+R:it-R;if(E!==void 0&&otNumber(T))return;var St=String(R).includes(".")?Number(String(R).split(".")[1].length):void 0;Oe(String(St?ot.toFixed(St):ot).replace(".",de))}ee&&ee(Ut)},bt=function(Ut){var on=Ut.key,gn=Ut.currentTarget.selectionStart;if(on!=="ArrowUp"&&on!=="ArrowDown"&&Me!=="-"){var Be=lZ(Me,{groupSeparator:ie,decimalSeparator:de});if(Be&&gn&&gn>Me.length-Be.length&&Pe.current){var it=Me.length-Be.length;Pe.current.setSelectionRange(it,it)}}re&&re(Ut)};_.useEffect(function(){h==null&&l==null&&Ne("")},[l,h]),_.useEffect(function(){$e&&Me!=="-"&&Pe.current&&document.activeElement===Pe.current&&Pe.current.setSelectionRange(vt,vt)},[Me,vt,Pe,$e,mn]);var Os=function(){return h!=null&&Me!=="-"&&(!de||Me!==de)?Ry(Zt(Zt({},be),{decimalScale:$e?void 0:w,value:String(h)})):Me},Kn=Zt({type:"text",inputMode:"decimal",id:a,name:o,className:c,onChange:xe,onBlur:Ye,onFocus:Te,onKeyDown:Rt,onKeyUp:bt,placeholder:v,disabled:m,value:Os(),ref:Pe},Z);if(u){var ps=u;return se.createElement(ps,Zt({},Kn))}return se.createElement("input",Zt({},Kn))});cZ.displayName="CurrencyInput";const BA=_.forwardRef(({children:t,...e},n)=>{var i;const{error:r}=Tv();let s=t;return r&&(r.message?s=String((r==null?void 0:r.message)||((i=r.root)==null?void 0:i.message)):r.type==="required"&&(s=tr("common.required_field"))),P.jsx(kK,{ref:n,...e,children:s})});BA.displayName="FormErrorMessage";const UA=se.forwardRef(({label:t,hint:e,required:n,...r},s)=>{const{error:i}=Tv(),a=e||(n?tr("common.required"):""),o=i?"text-destructive font-semibold":"";return P.jsxs(TK,{ref:s,className:"flex justify-between text-sm",...r,children:[P.jsx("span",{className:`block font-semibold ${o}`,children:t}),a&&P.jsx("span",{className:`text-xs font-medium text-primary ${o} `,children:a})]})});UA.displayName="FormLabel";const xIe=jo("flex h-10 w-full rounded-md bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",{variants:{variant:{default:"border border-input ring-offset-background focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ",outline:"focus-visible:border focus-visible:border-input",ghost:"bg-transparent"}},defaultVariants:{variant:"default"}}),SIe=t=>{const{name:e,label:n,hint:r,description:s,placeholder:i,className:a,disabled:o,defaultValue:c,rules:u,readOnly:f,scale:l,currency:d,language:m,variant:p}=t,{control:h}=Id(),[y,g]=_.useState(""),v={input:w=>{if(w==null||typeof w!="object")return w;const x=NC.create(w);if(x.isFailure)throw console.error(x.error),x.error;const A=x.object.toString();return y.endsWith(",")?A.replace(/.0$/,","):A},output:(w,x,A)=>{const{value:k}=A??{value:null};g(k??"");const R=NC.createFromFormattedValue(k,d.code,l);if(R.isFailure)throw R.error;return R.object.toObject()}};return P.jsx(VI,{defaultValue:c,control:h,name:e,disabled:o,rules:u,render:({field:w})=>{const x=v.input(w.value),A=o||w.disabled,k=!!((u==null?void 0:u.required)??!1);return P.jsxs(fA,{className:ce(a,"space-y-3"),children:[n&&P.jsx(UA,{label:n,hint:r,required:k}),P.jsx(hA,{children:P.jsx(cZ,{intlConfig:{locale:m.code,useGrouping:!0},name:w.name,ref:w.ref,onBlur:w.onBlur,disabled:A,readOnly:f,className:ce(xIe({variant:p,className:a})),suffix:` ${d==null?void 0:d.symbol}`,groupSeparator:".",decimalSeparator:",",placeholder:i,decimalsLimit:l,decimalScale:l,step:1,value:x,onValueChange:(R,E,T)=>w.onChange(v.output(R,E,T))})}),s&&P.jsx(pA,{children:s}),P.jsx(BA,{})]})}})};SIe.displayName="FormCurrencyField";const BUe=_.forwardRef((t,e)=>{const{label:n,placeholder:r,hint:s,description:i,required:a,disabled:o,className:c,name:u}=t,{control:f}=Id(),[l,d]=_.useState(!1);return P.jsx(VI,{control:f,disabled:o,name:u,rules:{required:a},render:({field:m})=>P.jsxs(fA,{ref:e,className:ce(c,"flex flex-col space-y-3"),children:[n&&P.jsx(UA,{label:n,hint:s,required:a}),P.jsxs(ePe,{open:l,onOpenChange:d,children:[P.jsx(tPe,{asChild:!0,children:P.jsx(hA,{children:P.jsxs(no,{disabled:o,variant:"ghost",className:ce("pl-3 text-left font-normal","border border-input ",!m.value&&"text-muted-foreground"),children:[m.value?new Date(m.value).toLocaleDateString():r||P.jsx("span",{children:tr("common.pick_date")}),P.jsx(bfe,{className:ce("w-4 h-4 ml-auto disabled:opacity-50 ",o?"text-foreground":"text-ring")})]})})}),P.jsx(K7,{className:"w-auto p-0",align:"start",children:P.jsx(MW,{className:"bg-background",mode:"single",captionLayout:"buttons",defaultMonth:m.value,selected:new Date(m.value),onSelect:p=>{m.onChange(p),d(!1)},disabled:p=>p{const o=se.useId(),c=_.useMemo(()=>e||n||r,[e,n,r]);return P.jsxs(LW,{id:o,className:ce(c?"":"pt-6",t),ref:a,children:[c&&P.jsxs(IW,{className:"flex flex-row flex-wrap items-center justify-between sm:flex-nowrap",children:[P.jsxs("div",{children:[e&&P.jsx($W,{className:"text-lg leading-normal",children:e}),n&&P.jsx(FW,{className:"leading-loose",children:n})]}),r&&P.jsx("div",{className:"flex-shrink-0",children:r})]}),P.jsx(jW,{className:"grid items-start gap-6",children:i}),s&&P.jsx(zW,{className:"px-6 py-4 border-t",style:{borderStyle:"inherit"},children:s})]})});EIe.displayName="FormGroup";const F4=jo("",{variants:{variant:{default:"",outline:"border-0 focus-visible:border focus-visible:border-input focus-visible:ring-0 focus-visible:ring-offset-0 "}},defaultVariants:{variant:"default"}}),CIe=({name:t,label:e,hint:n,placeholder:r,description:s,required:i,className:a,autoSize:o,variant:c,...u})=>{const{control:f}=Id();return P.jsx(VI,{control:f,name:t,rules:{required:i},render:({field:l,fieldState:d})=>P.jsxs(fA,{className:ce(a,"flex flex-col space-y-3"),children:[e&&P.jsx(UA,{label:e,hint:n,required:i}),P.jsx(hA,{className:"grow",children:o?P.jsx(iW,{placeholder:r,className:ce(d.error?"border-destructive focus-visible:ring-destructive":"","resize-y",F4({variant:c,className:a})),...u,...l}):P.jsx(uX,{placeholder:r,className:ce(d.error?"border-destructive focus-visible:ring-destructive":"","resize-y",F4({variant:c,className:a})),...u,...l})}),s&&P.jsx(pA,{children:s}),P.jsx(BA,{})]})})},AIe=({className:t,children:e})=>P.jsx(zee,{children:P.jsx("div",{className:ce("flex flex-col w-full min-h-screen",t),children:e})});AIe.displayName="Layout";const RIe=({className:t,children:e})=>P.jsxs(P.Fragment,{children:[P.jsx("main",{className:ce("flex min-h-[calc(100vh_-_theme(spacing.36))] flex-1 flex-col gap-4 bg-muted/40 p-4 md:gap-8 md:p-10",t),children:e}),P.jsx(IX,{})]});RIe.displayName="LayoutContent";const j4=(t,e,n)=>{if(t&&"reportValidity"in t){const r=Ie(n,e);t.setCustomValidity(r&&r.message||""),t.reportValidity()}},uZ=(t,e)=>{for(const n in e.fields){const r=e.fields[n];r&&r.ref&&"reportValidity"in r.ref?j4(r.ref,n,t):r.refs&&r.refs.forEach(s=>j4(s,n,t))}},PIe=(t,e)=>{e.shouldUseNativeValidation&&uZ(t,e);const n={};for(const r in t){const s=Ie(e.fields,r),i=Object.assign(t[r]||{},{ref:s&&s.ref});if(TIe(e.names||Object.keys(t),r)){const a=Object.assign({},Ie(n,r));Qt(a,"root",i),Qt(n,r,a)}else Qt(n,r,i)}return n},TIe=(t,e)=>t.some(n=>n.startsWith(e+"."));var kIe=function(t,e,n){return e===void 0&&(e={abortEarly:!1}),n===void 0&&(n={}),function(r,s,i){try{var a=function(){return c.error?{values:{},errors:PIe((f=c.error,l=!i.shouldUseNativeValidation&&i.criteriaMode==="all",f.details.length?f.details.reduce(function(d,m){var p=m.path.join(".");if(d[p]||(d[p]={message:m.message,type:m.type}),l){var h=d[p].types,y=h&&h[m.type];d[p]=gK(p,l,d,m.type,y?[].concat(y,m.message):m.message)}return d},{}):{}),i)}:(i.shouldUseNativeValidation&&uZ({},i),{errors:{},values:c.value});var f,l},o=Object.assign({},e,{context:s}),c={},u=function(){if(n.mode==="sync")c=t.validate(r,o);else{var f=function(l,d){try{var m=l()}catch(p){return d(p)}return m&&m.then?m.then(void 0,d):m}(function(){return Promise.resolve(t.validateAsync(r,o)).then(function(l){c.value=l})},function(l){c.error=l});if(f&&f.then)return f.then(function(){})}}();return Promise.resolve(u&&u.then?u.then(a):a())}catch(f){return Promise.reject(f)}}},dZ={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(self,()=>{return n={7629:(s,i,a)=>{const o=a(375),c=a(8571),u=a(9474),f=a(1687),l=a(8652),d=a(8160),m=a(3292),p=a(6354),h=a(8901),y=a(9708),g=a(6914),v=a(2294),w=a(6133),x=a(1152),A=a(8863),k=a(2036),R={Base:class{constructor(E){this.type=E,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new v.Ids,this._preferences=null,this._refs=new w.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return o(typeof y.describe=="function","Manifest functionality disabled"),y.describe(this)}allow(...E){return d.verifyFlat(E,"allow"),this._values(E,"_valids")}alter(E){o(E&&typeof E=="object"&&!Array.isArray(E),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const T=this.clone();T.$_terms.alterations=T.$_terms.alterations||[];for(const D in E){const O=E[D];o(typeof O=="function","Alteration adjuster for",D,"must be a function"),T.$_terms.alterations.push({target:D,adjuster:O})}return T.$_temp.ruleset=!1,T}artifact(E){return o(E!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",E)}cast(E){return o(E===!1||typeof E=="string","Invalid to value"),o(E===!1||this._definition.cast[E],"Type",this.type,"does not support casting to",E),this.$_setFlag("cast",E===!1?void 0:E)}default(E,T){return this._default("default",E,T)}description(E){return o(E&&typeof E=="string","Description must be a non-empty string"),this.$_setFlag("description",E)}empty(E){const T=this.clone();return E!==void 0&&(E=T.$_compile(E,{override:!1})),T.$_setFlag("empty",E,{clone:!1})}error(E){return o(E,"Missing error"),o(E instanceof Error||typeof E=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",E)}example(E,T={}){return o(E!==void 0,"Missing example"),d.assertOptions(T,["override"]),this._inner("examples",E,{single:!0,override:T.override})}external(E,T){return typeof E=="object"&&(o(!T,"Cannot combine options with description"),T=E.description,E=E.method),o(typeof E=="function","Method must be a function"),o(T===void 0||T&&typeof T=="string","Description must be a non-empty string"),this._inner("externals",{method:E,description:T},{single:!0})}failover(E,T){return this._default("failover",E,T)}forbidden(){return this.presence("forbidden")}id(E){return E?(o(typeof E=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(E),"id cannot contain period character"),this.$_setFlag("id",E)):this.$_setFlag("id",void 0)}invalid(...E){return this._values(E,"_invalids")}label(E){return o(E&&typeof E=="string","Label name must be a non-empty string"),this.$_setFlag("label",E)}meta(E){return o(E!==void 0,"Meta cannot be undefined"),this._inner("metas",E,{single:!0})}note(...E){o(E.length,"Missing notes");for(const T of E)o(T&&typeof T=="string","Notes must be non-empty strings");return this._inner("notes",E)}only(E=!0){return o(typeof E=="boolean","Invalid mode:",E),this.$_setFlag("only",E)}optional(){return this.presence("optional")}prefs(E){o(E,"Missing preferences"),o(E.context===void 0,"Cannot override context"),o(E.externals===void 0,"Cannot override externals"),o(E.warnings===void 0,"Cannot override warnings"),o(E.debug===void 0,"Cannot override debug"),d.checkPreferences(E);const T=this.clone();return T._preferences=d.preferences(T._preferences,E),T}presence(E){return o(["optional","required","forbidden"].includes(E),"Unknown presence mode",E),this.$_setFlag("presence",E)}raw(E=!0){return this.$_setFlag("result",E?"raw":void 0)}result(E){return o(["raw","strip"].includes(E),"Unknown result mode",E),this.$_setFlag("result",E)}required(){return this.presence("required")}strict(E){const T=this.clone(),D=E!==void 0&&!E;return T._preferences=d.preferences(T._preferences,{convert:D}),T}strip(E=!0){return this.$_setFlag("result",E?"strip":void 0)}tag(...E){o(E.length,"Missing tags");for(const T of E)o(T&&typeof T=="string","Tags must be non-empty strings");return this._inner("tags",E)}unit(E){return o(E&&typeof E=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",E)}valid(...E){d.verifyFlat(E,"valid");const T=this.allow(...E);return T.$_setFlag("only",!!T._valids,{clone:!1}),T}when(E,T){const D=this.clone();D.$_terms.whens||(D.$_terms.whens=[]);const O=m.when(D,E,T);if(!["any","link"].includes(D.type)){const L=O.is?[O]:O.switch;for(const I of L)o(!I.then||I.then.type==="any"||I.then.type===D.type,"Cannot combine",D.type,"with",I.then&&I.then.type),o(!I.otherwise||I.otherwise.type==="any"||I.otherwise.type===D.type,"Cannot combine",D.type,"with",I.otherwise&&I.otherwise.type)}return D.$_terms.whens.push(O),D.$_mutateRebuild()}cache(E){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const T=this.clone();return T._cache=E||l.provider.provision(),T.$_temp.ruleset=!1,T}clone(){const E=Object.create(Object.getPrototypeOf(this));return this._assign(E)}concat(E){o(d.isSchema(E),"Invalid schema object"),o(this.type==="any"||E.type==="any"||E.type===this.type,"Cannot merge type",this.type,"with another type:",E.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!E._inRuleset(),"Cannot concatenate a schema with open ruleset");let T=this.clone();if(this.type==="any"&&E.type!=="any"){const D=E.clone();for(const O of Object.keys(T))O!=="type"&&(D[O]=T[O]);T=D}T._ids.concat(E._ids),T._refs.register(E,w.toSibling),T._preferences=T._preferences?d.preferences(T._preferences,E._preferences):E._preferences,T._valids=k.merge(T._valids,E._valids,E._invalids),T._invalids=k.merge(T._invalids,E._invalids,E._valids);for(const D of E._singleRules.keys())T._singleRules.has(D)&&(T._rules=T._rules.filter(O=>O.keep||O.name!==D),T._singleRules.delete(D));for(const D of E._rules)E._definition.rules[D.method].multi||T._singleRules.set(D.name,D),T._rules.push(D);if(T._flags.empty&&E._flags.empty){T._flags.empty=T._flags.empty.concat(E._flags.empty);const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else if(E._flags.empty){T._flags.empty=E._flags.empty;const D=Object.assign({},E._flags);delete D.empty,f(T._flags,D)}else f(T._flags,E._flags);for(const D in E.$_terms){const O=E.$_terms[D];O?T.$_terms[D]?T.$_terms[D]=T.$_terms[D].concat(O):T.$_terms[D]=O.slice():T.$_terms[D]||(T.$_terms[D]=O)}return this.$_root._tracer&&this.$_root._tracer._combine(T,[this,E]),T.$_mutateRebuild()}extend(E){return o(!E.base,"Cannot extend type with another base"),h.type(this,E)}extract(E){return E=Array.isArray(E)?E:E.split("."),this._ids.reach(E)}fork(E,T){o(!this._inRuleset(),"Cannot fork inside a ruleset");let D=this;for(let O of[].concat(E))O=Array.isArray(O)?O:O.split("."),D=D._ids.fork(O,T,D);return D.$_temp.ruleset=!1,D}rule(E){const T=this._definition;d.assertOptions(E,Object.keys(T.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const D=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(D>=0&&DD.tailor(E),ref:!1}),T.$_temp.ruleset=!1,T.$_mutateRebuild()}tracer(){return x.location?x.location(this):this}validate(E,T){return A.entry(E,this,T)}validateAsync(E,T){return A.entryAsync(E,this,T)}$_addRule(E){typeof E=="string"&&(E={name:E}),o(E&&typeof E=="object","Invalid options"),o(E.name&&typeof E.name=="string","Invalid rule name");for(const I in E)o(I[0]!=="_","Cannot set private rule properties");const T=Object.assign({},E);T._resolve=[],T.method=T.method||T.name;const D=this._definition.rules[T.method],O=T.args;o(D,"Unknown rule",T.method);const L=this.clone();if(O){o(Object.keys(O).length===1||Object.keys(O).length===this._definition.rules[T.name].args.length,"Invalid rule definition for",this.type,T.name);for(const I in O){let F=O[I];if(D.argsByName){const U=D.argsByName.get(I);if(U.ref&&d.isResolvable(F))T._resolve.push(I),L.$_mutateRegister(F);else if(U.normalize&&(F=U.normalize(F),O[I]=F),U.assert){const Y=d.validateArg(F,I,U);o(!Y,Y,"or reference")}}F!==void 0?O[I]=F:delete O[I]}}return D.multi||(L._ruleRemove(T.name,{clone:!1}),L._singleRules.set(T.name,T)),L.$_temp.ruleset===!1&&(L.$_temp.ruleset=null),D.priority?L._rules.unshift(T):L._rules.push(T),L}$_compile(E,T){return m.schema(this.$_root,E,T)}$_createError(E,T,D,O,L,I={}){const F=I.flags!==!1?this._flags:{},U=I.messages?g.merge(this._definition.messages,I.messages):this._definition.messages;return new p.Report(E,T,D,F,U,O,L)}$_getFlag(E){return this._flags[E]}$_getRule(E){return this._singleRules.get(E)}$_mapLabels(E){return E=Array.isArray(E)?E:E.split("."),this._ids.labels(E)}$_match(E,T,D,O){(D=Object.assign({},D)).abortEarly=!0,D._externals=!1,T.snapshot();const L=!A.validate(E,this,T,D,O).errors;return T.restore(),L}$_modify(E){return d.assertOptions(E,["each","once","ref","schema"]),v.schema(this,E)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(E,{source:T,name:D,path:O,key:L})=>{const I=this._definition[T][D]&&this._definition[T][D].register;I!==!1&&this.$_mutateRegister(E,{family:I,key:L})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(E,{family:T,key:D}={}){this._refs.register(E,T),this._ids.register(E,{key:D})}$_property(E){return this._definition.properties[E]}$_reach(E){return this._ids.reach(E)}$_rootReferences(){return this._refs.roots()}$_setFlag(E,T,D={}){o(E[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const O=this._definition.flags[E]||{};if(u(T,O.default)&&(T=void 0),u(T,this._flags[E]))return this;const L=D.clone!==!1?this.clone():this;return T!==void 0?(L._flags[E]=T,L.$_mutateRegister(T)):delete L._flags[E],E[0]!=="_"&&(L.$_temp.ruleset=!1),L}$_parent(E,...T){return this[E][d.symbols.parent].call(this,...T)}$_validate(E,T,D){return A.validate(E,this,T,D)}_assign(E){E.type=this.type,E.$_root=this.$_root,E.$_temp=Object.assign({},this.$_temp),E.$_temp.whens={},E._ids=this._ids.clone(),E._preferences=this._preferences,E._valids=this._valids&&this._valids.clone(),E._invalids=this._invalids&&this._invalids.clone(),E._rules=this._rules.slice(),E._singleRules=c(this._singleRules,{shallow:!0}),E._refs=this._refs.clone(),E._flags=Object.assign({},this._flags),E._cache=null,E.$_terms={};for(const T in this.$_terms)E.$_terms[T]=this.$_terms[T]?this.$_terms[T].slice():null;E.$_super={};for(const T in this.$_super)E.$_super[T]=this._super[T].bind(E);return E}_bare(){const E=this.clone();E._reset();const T=E._definition.terms;for(const D in T){const O=T[D];E.$_terms[D]=O.init}return E.$_mutateRebuild()}_default(E,T,D={}){return d.assertOptions(D,"literal"),o(T!==void 0,"Missing",E,"value"),o(typeof T=="function"||!D.literal,"Only function value supports literal option"),typeof T=="function"&&D.literal&&(T={[d.symbols.literal]:!0,literal:T}),this.$_setFlag(E,T)}_generate(E,T,D){if(!this.$_terms.whens)return{schema:this};const O=[],L=[];for(let U=0;Uee)break}const I=L.join(", ");if(T.mainstay.tracer.debug(T,"rule","when",I),!I)return{schema:this};if(!T.mainstay.tracer.active&&this.$_temp.whens[I])return{schema:this.$_temp.whens[I],id:I};let F=this;this._definition.generate&&(F=this._definition.generate(this,E,T,D));for(const U of O)F=F.concat(U);return this.$_root._tracer&&this.$_root._tracer._combine(F,[this,...O]),this.$_temp.whens[I]=F,{schema:F,id:I}}_inner(E,T,D={}){o(!this._inRuleset(),`Cannot set ${E} inside a ruleset`);const O=this.clone();return O.$_terms[E]&&!D.override||(O.$_terms[E]=[]),D.single?O.$_terms[E].push(T):O.$_terms[E].push(...T),O.$_temp.ruleset=!1,O}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(E,T={}){if(!this._singleRules.has(E))return this;const D=T.clone!==!1?this.clone():this;D._singleRules.delete(E);const O=[];for(let L=0;L{const o=a(375),c=a(8571),u=a(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};i.provider={provision:l=>new f.Cache(l)},f.Cache=class{constructor(l={}){u.assertOptions(l,["max"]),o(l.max===void 0||l.max&&l.max>0&&isFinite(l.max),"Invalid max cache size"),this._max=l.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(l,d){if(l!==null&&!f.supported.has(typeof l))return;let m=this._map.get(l);if(m)return m.value=d,void this._list.first(m);m=this._list.unshift({key:l,value:d}),this._map.set(l,m),this._compact()}get(l){const d=this._map.get(l);if(d)return this._list.first(d),c(d.value)}_compact(){if(this._map.size>this._max){const l=this._list.pop();this._map.delete(l.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(l){return l.next=null,l.prev=this.head,this.head&&(this.head.next=l),this.head=l,this.tail||(this.tail=l),l}first(l){l!==this.head&&(this._remove(l),this.unshift(l))}pop(){return this._remove(this.tail)}_remove(l){const{next:d,prev:m}=l;return d.prev=m,m&&(m.next=d),l===this.tail&&(this.tail=d),l.prev=null,l.next=null,l}}},8160:(s,i,a)=>{const o=a(375),c=a(7916),u=a(5934);let f,l;const d={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};i.version=u.version,i.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},i.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},i.assertOptions=function(m,p,h="Options"){o(m&&typeof m=="object"&&!Array.isArray(m),"Options must be of type object");const y=Object.keys(m).filter(g=>!p.includes(g));o(y.length===0,`${h} contain unknown keys: ${y}`)},i.checkPreferences=function(m){l=l||a(3378);const p=l.preferences.validate(m);if(p.error)throw new c([p.error.details[0].message])},i.compare=function(m,p,h){switch(h){case"=":return m===p;case">":return m>p;case"<":return m=":return m>=p;case"<=":return m<=p}},i.default=function(m,p){return m===void 0?p:m},i.isIsoDate=function(m){return d.isoDate.test(m)},i.isNumber=function(m){return typeof m=="number"&&!isNaN(m)},i.isResolvable=function(m){return!!m&&(m[i.symbols.ref]||m[i.symbols.template])},i.isSchema=function(m,p={}){const h=m&&m[i.symbols.any];return!!h&&(o(p.legacy||h.version===i.version,"Cannot mix different versions of joi schemas"),!0)},i.isValues=function(m){return m[i.symbols.values]},i.limit=function(m){return Number.isSafeInteger(m)&&m>=0},i.preferences=function(m,p){f=f||a(6914),m=m||{},p=p||{};const h=Object.assign({},m,p);return p.errors&&m.errors&&(h.errors=Object.assign({},m.errors,p.errors),h.errors.wrap=Object.assign({},m.errors.wrap,p.errors.wrap)),p.messages&&(h.messages=f.compile(p.messages,m.messages)),delete h[i.symbols.prefs],h},i.tryWithPath=function(m,p,h={}){try{return m()}catch(y){throw y.path!==void 0?y.path=p+"."+y.path:y.path=p,h.append&&(y.message=`${y.message} (${y.path})`),y}},i.validateArg=function(m,p,{assert:h,message:y}){if(i.isSchema(h)){const g=h.validate(m);return g.error?g.error.message:void 0}if(!h(m))return p?`${p} ${y}`:y},i.verifyFlat=function(m,p){for(const h of m)o(!Array.isArray(h),"Method no longer accepts array arguments:",p)}},3292:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.schema=function(l,d,m={}){c.assertOptions(m,["appendPath","override"]);try{return f.schema(l,d,m)}catch(p){throw m.appendPath&&p.path!==void 0&&(p.message=`${p.message} (${p.path})`),p}},f.schema=function(l,d,m){o(d!==void 0,"Invalid undefined schema"),Array.isArray(d)&&(o(d.length,"Invalid empty array schema"),d.length===1&&(d=d[0]));const p=(h,...y)=>m.override!==!1?h.valid(l.override,...y):h.valid(...y);if(f.simple(d))return p(l,d);if(typeof d=="function")return l.custom(d);if(o(typeof d=="object","Invalid schema content:",typeof d),c.isResolvable(d))return p(l,d);if(c.isSchema(d))return d;if(Array.isArray(d)){for(const h of d)if(!f.simple(h))return l.alternatives().try(...d);return p(l,...d)}return d instanceof RegExp?l.string().regex(d):d instanceof Date?p(l.date(),d):(o(Object.getPrototypeOf(d)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),l.object().keys(d))},i.ref=function(l,d){return u.isRef(l)?l:u.create(l,d)},i.compile=function(l,d,m={}){c.assertOptions(m,["legacy"]);const p=d&&d[c.symbols.any];if(p)return o(m.legacy||p.version===c.version,"Cannot mix different versions of joi schemas:",p.version,c.version),d;if(typeof d!="object"||!m.legacy)return i.schema(l,d,{appendPath:!0});const h=f.walk(d);return h?h.compile(h.root,d):i.schema(l,d,{appendPath:!0})},f.walk=function(l){if(typeof l!="object")return null;if(Array.isArray(l)){for(const m of l){const p=f.walk(m);if(p)return p}return null}const d=l[c.symbols.any];if(d)return{root:l[d.root],compile:d.compile};o(Object.getPrototypeOf(l)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const m in l){const p=f.walk(l[m]);if(p)return p}return null},f.simple=function(l){return l===null||["boolean","string","number"].includes(typeof l)},i.when=function(l,d,m){if(m===void 0&&(o(d&&typeof d=="object","Missing options"),m=d,d=u.create(".")),Array.isArray(m)&&(m={switch:m}),c.assertOptions(m,["is","not","then","otherwise","switch","break"]),c.isSchema(d))return o(m.is===void 0,'"is" can not be used with a schema condition'),o(m.not===void 0,'"not" can not be used with a schema condition'),o(m.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(l,{is:d,then:m.then,otherwise:m.otherwise,break:m.break});if(o(u.isRef(d)||typeof d=="string","Invalid condition:",d),o(m.not===void 0||m.is===void 0,'Cannot combine "is" with "not"'),m.switch===void 0){let h=m;m.not!==void 0&&(h={is:m.not,then:m.otherwise,otherwise:m.then,break:m.break});let y=h.is!==void 0?l.$_compile(h.is):l.$_root.invalid(null,!1,0,"").required();return o(h.then!==void 0||h.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(h.break===void 0||h.then===void 0||h.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),m.is===void 0||u.isRef(m.is)||c.isSchema(m.is)||(y=y.required()),f.condition(l,{ref:i.ref(d),is:y,then:h.then,otherwise:h.otherwise,break:h.break})}o(Array.isArray(m.switch),'"switch" must be an array'),o(m.is===void 0,'Cannot combine "switch" with "is"'),o(m.not===void 0,'Cannot combine "switch" with "not"'),o(m.then===void 0,'Cannot combine "switch" with "then"');const p={ref:i.ref(d),switch:[],break:m.break};for(let h=0;h{const o=a(5688),c=a(8160),u=a(3328);i.Report=class{constructor(f,l,d,m,p,h,y){if(this.code=f,this.flags=m,this.messages=p,this.path=h.path,this.prefs=y,this.state=h,this.value=l,this.message=null,this.template=null,this.local=d||{},this.local.label=i.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const g=this.path[this.path.length-1];typeof g!="object"&&(this.local.key=g)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const l=this._template(this.template,"root");l&&(this.local.label=l)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const l=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return l===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=l.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(f,l){return i.template(this.value,f,l||this.code,this.state,this.prefs)}},i.path=function(f){let l="";for(const d of f)typeof d!="object"&&(typeof d=="string"?(l&&(l+="."),l+=d):l+=`[${d}]`);return l},i.template=function(f,l,d,m,p){if(!l)return;if(u.isTemplate(l))return d!=="root"?l:null;let h=p.errors.language;if(c.isResolvable(h)&&(h=h.resolve(f,m,p)),h&&l[h]){if(l[h][d]!==void 0)return l[h][d];if(l[h]["*"]!==void 0)return l[h]["*"]}return l[d]?l[d]:l["*"]},i.label=function(f,l,d,m){if(!d.errors.label)return"";if(f.label)return f.label;let p=l.path;return d.errors.label==="key"&&l.path.length>1&&(p=l.path.slice(-1)),i.path(p)||i.template(null,d.messages,"root",l,d)||m&&i.template(null,m,"root",l,d)||"value"},i.process=function(f,l,d){if(!f)return null;const{override:m,message:p,details:h}=i.details(f);if(m)return m;if(d.errors.stack)return new i.ValidationError(p,h,l);const y=Error.stackTraceLimit;Error.stackTraceLimit=0;const g=new i.ValidationError(p,h,l);return Error.stackTraceLimit=y,g},i.details=function(f,l={}){let d=[];const m=[];for(const p of f){if(p instanceof Error){if(l.override!==!1)return{override:p};const y=p.toString();d.push(y),m.push({message:y,type:"override",context:{error:p}});continue}const h=p.toString();d.push(h),m.push({message:h,path:p.path.filter(y=>typeof y!="object"),type:p.code,context:p.local})}return d.length>1&&(d=[...new Set(d)]),{message:d.join(". "),details:m}},i.ValidationError=class extends Error{constructor(f,l,d){super(f),this._original=d,this.details=l}static isError(f){return f instanceof i.ValidationError}},i.ValidationError.prototype.isJoi=!0,i.ValidationError.prototype.name="ValidationError",i.ValidationError.prototype.annotate=o.error},8901:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8160),f=a(6914),l={};i.type=function(d,m){const p=Object.getPrototypeOf(d),h=c(p),y=d._assign(Object.create(h)),g=Object.assign({},m);delete g.base,h._definition=g;const v=p._definition||{};g.messages=f.merge(v.messages,g.messages),g.properties=Object.assign({},v.properties,g.properties),y.type=g.type,g.flags=Object.assign({},v.flags,g.flags);const w=Object.assign({},v.terms);if(g.terms)for(const R in g.terms){const E=g.terms[R];o(y.$_terms[R]===void 0,"Invalid term override for",g.type,R),y.$_terms[R]=E.init,w[R]=E}g.terms=w,g.args||(g.args=v.args),g.prepare=l.prepare(g.prepare,v.prepare),g.coerce&&(typeof g.coerce=="function"&&(g.coerce={method:g.coerce}),g.coerce.from&&!Array.isArray(g.coerce.from)&&(g.coerce={method:g.coerce.method,from:[].concat(g.coerce.from)})),g.coerce=l.coerce(g.coerce,v.coerce),g.validate=l.validate(g.validate,v.validate);const x=Object.assign({},v.rules);if(g.rules)for(const R in g.rules){const E=g.rules[R];o(typeof E=="object","Invalid rule definition for",g.type,R);let T=E.method;if(T===void 0&&(T=function(){return this.$_addRule(R)}),T&&(o(!h[R],"Rule conflict in",g.type,R),h[R]=T),o(!x[R],"Rule conflict in",g.type,R),x[R]=E,E.alias){const D=[].concat(E.alias);for(const O of D)h[O]=E.method}E.args&&(E.argsByName=new Map,E.args=E.args.map(D=>(typeof D=="string"&&(D={name:D}),o(!E.argsByName.has(D.name),"Duplicated argument name",D.name),u.isSchema(D.assert)&&(D.assert=D.assert.strict().label(D.name)),E.argsByName.set(D.name,D),D)))}g.rules=x;const A=Object.assign({},v.modifiers);if(g.modifiers)for(const R in g.modifiers){o(!h[R],"Rule conflict in",g.type,R);const E=g.modifiers[R];o(typeof E=="function","Invalid modifier definition for",g.type,R);const T=function(D){return this.rule({[R]:D})};h[R]=T,A[R]=E}if(g.modifiers=A,g.overrides){h._super=p,y.$_super={};for(const R in g.overrides)o(p[R],"Cannot override missing",R),g.overrides[R][u.symbols.parent]=p[R],y.$_super[R]=p[R].bind(y);Object.assign(h,g.overrides)}g.cast=Object.assign({},v.cast,g.cast);const k=Object.assign({},v.manifest,g.manifest);return k.build=l.build(g.manifest&&g.manifest.build,v.manifest&&v.manifest.build),g.manifest=k,g.rebuild=l.rebuild(g.rebuild,v.rebuild),y},l.build=function(d,m){return d&&m?function(p,h){return m(d(p,h),h)}:d||m},l.coerce=function(d,m){return d&&m?{from:d.from&&m.from?[...new Set([...d.from,...m.from])]:null,method(p,h){let y;if((!m.from||m.from.includes(typeof p))&&(y=m.method(p,h),y)){if(y.errors||y.value===void 0)return y;p=y.value}if(!d.from||d.from.includes(typeof p)){const g=d.method(p,h);if(g)return g}return y}}:d||m},l.prepare=function(d,m){return d&&m?function(p,h){const y=d(p,h);if(y){if(y.errors||y.value===void 0)return y;p=y.value}return m(p,h)||y}:d||m},l.rebuild=function(d,m){return d&&m?function(p){m(p),d(p)}:d||m},l.validate=function(d,m){return d&&m?function(p,h){const y=m(p,h);if(y){if(y.errors&&(!Array.isArray(y.errors)||y.errors.length))return y;p=y.value}return d(p,h)||y}:d||m}},5107:(s,i,a)=>{const o=a(375),c=a(8571),u=a(8652),f=a(8160),l=a(3292),d=a(6354),m=a(8901),p=a(9708),h=a(6133),y=a(3328),g=a(1152);let v;const w={types:{alternatives:a(4946),any:a(8068),array:a(546),boolean:a(4937),date:a(7500),function:a(390),link:a(8785),number:a(3832),object:a(8966),string:a(7417),symbol:a(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const x={_types:new Set(Object.keys(w.types))};for(const A of x._types)x[A]=function(...k){return o(!k.length||["alternatives","link","object"].includes(A),"The",A,"type does not allow arguments"),w.generate(this,w.types[A],k)};for(const A of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])x[A]=function(...k){return this.any()[A](...k)};Object.assign(x,w.methods);for(const A in w.aliases){const k=w.aliases[A];x[A]=x[k]}return x.x=x.expression,g.setup&&g.setup(x),x}};w.methods={ValidationError:d.ValidationError,version:f.version,cache:u.provider,assert(x,A,...k){w.assert(x,A,!0,k)},attempt:(x,A,...k)=>w.assert(x,A,!1,k),build(x){return o(typeof p.build=="function","Manifest functionality disabled"),p.build(this,x)},checkPreferences(x){f.checkPreferences(x)},compile(x,A){return l.compile(this,x,A)},defaults(x){o(typeof x=="function","modifier must be a function");const A=Object.assign({},this);for(const k of A._types){const R=x(A[k]());o(f.isSchema(R),"modifier must return a valid schema object"),A[k]=function(...E){return w.generate(this,R,E)}}return A},expression:(...x)=>new y(...x),extend(...x){f.verifyFlat(x,"extend"),v=v||a(3378),o(x.length,"You need to provide at least one extension"),this.assert(x,v.extensions);const A=Object.assign({},this);A._types=new Set(A._types);for(let k of x){typeof k=="function"&&(k=k(A)),this.assert(k,v.extension);const R=w.expandExtension(k,A);for(const E of R){o(A[E.type]===void 0||A._types.has(E.type),"Cannot override name",E.type);const T=E.base||this.any(),D=m.type(T,E);A._types.add(E.type),A[E.type]=function(...O){return w.generate(this,D,O)}}}return A},isError:d.ValidationError.isError,isExpression:y.isTemplate,isRef:h.isRef,isSchema:f.isSchema,in:(...x)=>h.in(...x),override:f.symbols.override,ref:(...x)=>h.create(...x),types(){const x={};for(const A of this._types)x[A]=this[A]();for(const A in w.aliases)x[A]=this[A]();return x}},w.assert=function(x,A,k,R){const E=R[0]instanceof Error||typeof R[0]=="string"?R[0]:null,T=E!==null?R[1]:R[0],D=A.validate(x,f.preferences({errors:{stack:!0}},T||{}));let O=D.error;if(!O)return D.value;if(E instanceof Error)throw E;const L=k&&typeof O.annotate=="function"?O.annotate():O.message;throw O instanceof d.ValidationError==0&&(O=c(O)),O.message=E?`${E} ${L}`:L,O},w.generate=function(x,A,k){return o(x,"Must be invoked on a Joi instance."),A.$_root=x,A._definition.args&&k.length?A._definition.args(A,...k):A},w.expandExtension=function(x,A){if(typeof x.type=="string")return[x];const k=[];for(const R of A._types)if(x.type.test(R)){const E=Object.assign({},x);E.type=R,E.base=A[R](),k.push(E)}return k},s.exports=w.root()},6914:(s,i,a)=>{const o=a(375),c=a(8571),u=a(3328);i.compile=function(f,l){if(typeof f=="string")return o(!l,"Cannot set single message string"),new u(f);if(u.isTemplate(f))return o(!l,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),l=l?c(l):{};for(let d in f){const m=f[d];if(d==="root"||u.isTemplate(m)){l[d]=m;continue}if(typeof m=="string"){l[d]=new u(m);continue}o(typeof m=="object"&&!Array.isArray(m),"Invalid message for",d);const p=d;for(d in l[p]=l[p]||{},m){const h=m[d];d==="root"||u.isTemplate(h)?l[p][d]=h:(o(typeof h=="string","Invalid message for",d,"in",p),l[p][d]=new u(h))}}return l},i.decompile=function(f){const l={};for(let d in f){const m=f[d];if(d==="root"){l.root=m;continue}if(u.isTemplate(m)){l[d]=m.describe({compact:!0});continue}const p=d;for(d in l[p]={},m){const h=m[d];d!=="root"?l[p][d]=h.describe({compact:!0}):l[p].root=h}}return l},i.merge=function(f,l){if(!f)return i.compile(l);if(!l)return f;if(typeof l=="string")return new u(l);if(u.isTemplate(l))return l;const d=c(f);for(let m in l){const p=l[m];if(m==="root"||u.isTemplate(p)){d[m]=p;continue}if(typeof p=="string"){d[m]=new u(p);continue}o(typeof p=="object"&&!Array.isArray(p),"Invalid message for",m);const h=m;for(m in d[h]=d[h]||{},p){const y=p[m];m==="root"||u.isTemplate(y)?d[h][m]=y:(o(typeof y=="string","Invalid message for",m,"in",h),d[h][m]=new u(y))}}return d}},2294:(s,i,a)=>{const o=a(375),c=a(8160),u=a(6133),f={};i.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const l=new f.Ids;return l._byId=new Map(this._byId),l._byKey=new Map(this._byKey),l._schemaChain=this._schemaChain,l}concat(l){l._schemaChain&&(this._schemaChain=!0);for(const[d,m]of l._byId.entries())o(!this._byKey.has(d),"Schema id conflicts with existing key:",d),this._byId.set(d,m);for(const[d,m]of l._byKey.entries())o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,m)}fork(l,d,m){const p=this._collect(l);p.push({schema:m});const h=p.shift();let y={id:h.id,schema:d(h.schema)};o(c.isSchema(y.schema),"adjuster function failed to return a joi schema type");for(const g of p)y={id:g.id,schema:f.fork(g.schema,y.id,y.schema)};return y.schema}labels(l,d=[]){const m=l[0],p=this._get(m);if(!p)return[...d,...l].join(".");const h=l.slice(1);return d=[...d,p.schema._flags.label||m],h.length?p.schema._ids.labels(h,d):d.join(".")}reach(l,d=[]){const m=l[0],p=this._get(m);o(p,"Schema does not contain path",[...d,...l].join("."));const h=l.slice(1);return h.length?p.schema._ids.reach(h,[...d,m]):p.schema}register(l,{key:d}={}){if(!l||!c.isSchema(l))return;(l.$_property("schemaChain")||l._ids._schemaChain)&&(this._schemaChain=!0);const m=l._flags.id;if(m){const p=this._byId.get(m);o(!p||p.schema===l,"Cannot add different schemas with the same id:",m),o(!this._byKey.has(m),"Schema id conflicts with existing key:",m),this._byId.set(m,{schema:l,id:m})}d&&(o(!this._byKey.has(d),"Schema already contains key:",d),o(!this._byId.has(d),"Schema key conflicts with existing id:",d),this._byKey.set(d,{schema:l,id:d}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(l,d=[],m=[]){const p=l[0],h=this._get(p);o(h,"Schema does not contain path",[...d,...l].join(".")),m=[h,...m];const y=l.slice(1);return y.length?h.schema._ids._collect(y,[...d,p],m):m}_get(l){return this._byId.get(l)||this._byKey.get(l)}},f.fork=function(l,d,m){const p=i.schema(l,{each:(h,{key:y})=>{if(d===(h._flags.id||y))return m},ref:!1});return p?p.$_mutateRebuild():l},i.schema=function(l,d){let m;for(const p in l._flags){if(p[0]==="_")continue;const h=f.scan(l._flags[p],{source:"flags",name:p},d);h!==void 0&&(m=m||l.clone(),m._flags[p]=h)}for(let p=0;p{const o=a(375),c=a(8571),u=a(9621),f=a(8160);let l;const d={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};i.create=function(m,p={}){o(typeof m=="string","Invalid reference key:",m),f.assertOptions(p,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!p.prefix||typeof p.prefix=="object","options.prefix must be of type object");const h=Object.assign({},d.defaults,p);delete h.prefix;const y=h.separator,g=d.context(m,y,p.prefix);if(h.type=g.type,m=g.key,h.type==="value")if(g.root&&(o(!y||m[0]!==y,"Cannot specify relative path with root prefix"),h.ancestor="root",m||(m=null)),y&&y===m)m=null,h.ancestor=0;else if(h.ancestor!==void 0)o(!y||!m||m[0]!==y,"Cannot combine prefix with ancestor option");else{const[v,w]=d.ancestor(m,y);w&&(m=m.slice(w))===""&&(m=null),h.ancestor=v}return h.path=y?m===null?[]:m.split(y):[m],new d.Ref(h)},i.in=function(m,p={}){return i.create(m,{...p,in:!0})},i.isRef=function(m){return!!m&&!!m[f.symbols.ref]},d.Ref=class{constructor(m){o(typeof m=="object","Invalid reference construction"),f.assertOptions(m,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(m.separator)||typeof m.separator=="string"&&m.separator.length===1,"Invalid separator"),o(!m.adjust||typeof m.adjust=="function","options.adjust must be a function"),o(!m.map||Array.isArray(m.map),"options.map must be an array"),o(!m.map||!m.adjust,"Cannot set both map and adjust options"),Object.assign(this,d.defaults,m),o(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(m,p,h,y,g={}){return o(!this.in||g.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(h.context,p,g):this.type==="local"?this._resolve(y,p,g):this.ancestor?this.ancestor==="root"?this._resolve(p.ancestors[p.ancestors.length-1],p,g):(o(this.ancestor<=p.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(p.ancestors[this.ancestor-1],p,g)):this._resolve(m,p,g)}_resolve(m,p,h){let y;if(this.type==="value"&&p.mainstay.shadow&&h.shadow!==!1&&(y=p.mainstay.shadow.get(this.absolute(p))),y===void 0&&(y=u(m,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(y=this.adjust(y)),this.map){const g=this.map.get(y);g!==void 0&&(y=g)}return p.mainstay&&p.mainstay.tracer.resolve(p,this,y),y}toString(){return this.display}absolute(m){return[...m.path.slice(0,-this.ancestor),...this.path]}clone(){return new d.Ref(this)}describe(){const m={path:this.path};this.type!=="value"&&(m.type=this.type),this.separator!=="."&&(m.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(m.ancestor=this.ancestor),this.map&&(m.map=[...this.map]);for(const p of["adjust","iterables","render"])this[p]!==null&&this[p]!==void 0&&(m[p]=this[p]);return this.in!==!1&&(m.in=!0),{ref:m}}updateDisplay(){const m=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${m}`);if(!this.separator)return void(this.display=`ref:${m}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${m}`);if(this.ancestor==="root")return void(this.display=`ref:root:${m}`);if(this.ancestor===1)return void(this.display=`ref:${m||".."}`);const p=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${p}${m||""}`}},d.Ref.prototype[f.symbols.ref]=!0,i.build=function(m){return(m=Object.assign({},d.defaults,m)).type==="value"&&m.ancestor===void 0&&(m.ancestor=1),new d.Ref(m)},d.context=function(m,p,h={}){if(m=m.trim(),h){const y=h.global===void 0?"$":h.global;if(y!==p&&m.startsWith(y))return{key:m.slice(y.length),type:"global"};const g=h.local===void 0?"#":h.local;if(g!==p&&m.startsWith(g))return{key:m.slice(g.length),type:"local"};const v=h.root===void 0?"/":h.root;if(v!==p&&m.startsWith(v))return{key:m.slice(v.length),type:"value",root:!0}}return{key:m,type:"value"}},d.ancestor=function(m,p){if(!p)return[1,0];if(m[0]!==p)return[1,0];if(m[1]!==p)return[0,1];let h=2;for(;m[h]===p;)++h;return[h-1,h]},i.toSibling=0,i.toParent=1,i.Manager=class{constructor(){this.refs=[]}register(m,p){if(m)if(p=p===void 0?i.toParent:p,Array.isArray(m))for(const h of m)this.register(h,p);else if(f.isSchema(m))for(const h of m._refs.refs)h.ancestor-p>=0&&this.refs.push({ancestor:h.ancestor-p,root:h.root});else i.isRef(m)&&m.type==="value"&&m.ancestor-p>=0&&this.refs.push({ancestor:m.ancestor-p,root:m.root}),l=l||a(3328),l.isTemplate(m)&&this.register(m.refs(),p)}get length(){return this.refs.length}clone(){const m=new i.Manager;return m.refs=c(this.refs),m}reset(){this.refs=[]}roots(){return this.refs.filter(m=>!m.ancestor).map(m=>m.root)}}},3378:(s,i,a)=>{const o=a(5107),c={};c.wrap=o.string().min(1).max(2).allow(!1),i.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:c.wrap,array:c.wrap,string:c.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),c.nameRx=/^[a-zA-Z0-9]\w*$/,c.rule=o.object({alias:o.array().items(o.string().pattern(c.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(c.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),i.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(c.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(c.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(c.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(c.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(c.nameRx,c.rule),terms:o.object().pattern(c.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),i.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),c.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},c.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),c.desc.buffer,c.desc.func,c.desc.ref,c.desc.regex,c.desc.special,c.desc.template,c.desc.value,o.link("/")]),c.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),c.desc.buffer,c.desc.func,c.desc.override,c.desc.ref,c.desc.regex,c.desc.template,c.desc.value),c.desc.messages=o.object().pattern(/.+/,[o.string(),c.desc.template,o.object().pattern(/.+/,[o.string(),c.desc.template])]),i.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:c.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),c.desc.ref],wrap:{label:c.wrap,array:c.wrap}},externals:o.boolean(),messages:c.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:c.desc.values,invalid:c.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),c.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:c.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(s,i,a)=>{const o=a(8571),c=a(9621),u=a(8160),f={value:Symbol("value")};s.exports=f.State=class{constructor(l,d,m){this.path=l,this.ancestors=d,this.mainstay=m.mainstay,this.schemas=m.schemas,this.debug=null}localize(l,d=null,m=null){const p=new f.State(l,d,this);return m&&p.schemas&&(p.schemas=[f.schemas(m),...p.schemas]),p}nest(l,d){const m=new f.State(this.path,this.ancestors,this);return m.schemas=m.schemas&&[f.schemas(l),...m.schemas],m.debug=d,m}shadow(l,d){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,l,d)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},f.schemas=function(l){return u.isSchema(l)?{schema:l}:l},f.Shadow=class{constructor(){this._values=null}set(l,d,m){if(!l.length||m==="strip"&&typeof l[l.length-1]=="number")return;this._values=this._values||new Map;let p=this._values;for(let h=0;h{const o=a(375),c=a(8571),u=a(5277),f=a(1447),l=a(8160),d=a(6354),m=a(6133),p={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};s.exports=p.Template=class{constructor(h,y){if(o(typeof h=="string","Template source must be a string"),o(!h.includes("\0")&&!h.includes(""),"Template source cannot contain reserved control characters"),this.source=h,this.rendered=h,this._template=null,y){const{functions:g,...v}=y;this._settings=Object.keys(v).length?c(v):void 0,this._functions=g,this._functions&&(o(Object.keys(this._functions).every(w=>typeof w=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(w=>typeof w=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const h=p.encode(this.source),y=p.split(h);let g=!1;const v=[],w=y.shift();w&&v.push(w);for(const x of y){const A=x[0]!=="{",k=A?"}":"}}",R=x.indexOf(k);if(R===-1||x[1]==="{"){v.push(`{${p.decode(x)}`);continue}let E=x.slice(A?0:1,R);const T=E[0]===":";T&&(E=E.slice(1));const D=this._ref(p.decode(E),{raw:A,wrapped:T});v.push(D),typeof D!="string"&&(g=!0);const O=x.slice(R+k.length);O&&v.push(p.decode(O))}g?this._template=v:this.rendered=v.join("")}static date(h,y){return p.dateFormat[y.dateFormat].call(h)}describe(h={}){if(!this._settings&&h.compact)return this.source;const y={template:this.source};return this._settings&&(y.options=this._settings),this._functions&&(y.functions=this._functions),y}static build(h){return new p.Template(h.template,h.options||h.functions?{...h.options,functions:h.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(h){return!!h&&!!h[l.symbols.template]}refs(){if(!this._template)return;const h=[];for(const y of this._template)typeof y!="string"&&h.push(...y.refs);return h}resolve(h,y,g,v){return this._template&&this._template.length===1?this._part(this._template[0],h,y,g,v,{}):this.render(h,y,g,v)}_part(h,...y){return h.ref?h.ref.resolve(...y):h.formula.evaluate(y)}render(h,y,g,v,w={}){if(!this.isDynamic())return this.rendered;const x=[];for(const A of this._template)if(typeof A=="string")x.push(A);else{const k=this._part(A,h,y,g,v,w),R=p.stringify(k,h,y,g,v,w);if(R!==void 0){const E=A.raw||(w.errors&&w.errors.escapeHtml)===!1?R:u(R);x.push(p.wrap(E,A.wrapped&&g.errors.wrap.label))}}return x.join("")}_ref(h,{raw:y,wrapped:g}){const v=[],w=A=>{const k=m.create(A,this._settings);return v.push(k),R=>{const E=k.resolve(...R);return E!==void 0?E:null}};try{const A=this._functions?{...p.functions,...this._functions}:p.functions;var x=new f.Parser(h,{reference:w,functions:A,constants:p.constants})}catch(A){throw A.message=`Invalid template variable "${h}" fails due to: ${A.message}`,A}if(x.single){if(x.single.type==="reference"){const A=v[0];return{ref:A,raw:y,refs:v,wrapped:g||A.type==="local"&&A.key==="label"}}return p.stringify(x.single.value)}return{formula:x,raw:y,refs:v}}toString(){return this.source}},p.Template.prototype[l.symbols.template]=!0,p.Template.prototype.isImmutable=!0,p.encode=function(h){return h.replace(/\\(\{+)/g,(y,g)=>p.opens.slice(0,g.length)).replace(/\\(\}+)/g,(y,g)=>p.closes.slice(0,g.length))},p.decode=function(h){return h.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},p.split=function(h){const y=[];let g="";for(let v=0;v ${O.toString()}`);h=T}if(!Array.isArray(h))return h.toString();const E=[];for(const T of h)E.push(p.stringify(T,y,g,v,w,{arrayItems:!0,...x}));return p.wrap(E.join(", "),!R&&k.array)},p.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},p.functions={if:(h,y,g)=>h?y:g,length:h=>typeof h=="string"?h.length:h&&typeof h=="object"?Array.isArray(h)?h.length:Object.keys(h).length:null,msg(h){const[y,g,v,w,x]=this,A=x.messages;if(!A)return"";const k=d.template(y,A[0],h,g,v)||d.template(y,A[1],h,g,v);return k?k.render(y,g,v,w,x):""},number:h=>typeof h=="number"?h:typeof h=="string"?parseFloat(h):typeof h=="boolean"?h?1:0:h instanceof Date?h.getTime():null}},4946:(s,i,a)=>{const o=a(375),c=a(1687),u=a(8068),f=a(8160),l=a(3292),d=a(6354),m=a(6133),p={};s.exports=u.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:m.toSibling}},args:(h,...y)=>y.length===1&&Array.isArray(y[0])?h.try(...y[0]):h.try(...y),validate(h,y){const{schema:g,error:v,state:w,prefs:x}=y;if(g._flags.match){const k=[],R=[];for(let T=0;Td.details(T,{override:!1}))})};if(g._flags.match==="one")return k.length===1?{value:k[0]}:{errors:v("alternatives.one")};if(k.length!==g.$_terms.matches.length)return{errors:v("alternatives.all",{details:R.map(T=>d.details(T,{override:!1}))})};const E=T=>T.$_terms.matches.some(D=>D.schema.type==="object"||D.schema.type==="alternatives"&&E(D.schema));return E(g)?{value:k.reduce((T,D)=>c(T,D,{mergeArrays:!1}))}:{value:k[k.length-1]}}const A=[];for(let k=0;kg.path[0]!=="is"&&typeof y._flags.label!="string"?y.label(h):void 0,ref:!1})}},rebuild(h){h.$_modify({each:y=>{f.isSchema(y)&&y.type==="array"&&h.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(h,y){if(y.matches)for(const g of y.matches){const{schema:v,ref:w,is:x,not:A,then:k,otherwise:R}=g;h=v?h.try(v):w?h.conditional(w,{is:x,then:k,not:A,otherwise:R,switch:g.switch}):h.conditional(x,{then:k,otherwise:R})}return h}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),p.errors=function(h,{error:y,state:g}){if(!h.length)return{errors:y("alternatives.any")};if(h.length===1)return{errors:h[0].reports};const v=new Set,w=[];for(const{reports:x,schema:A}of h){if(x.length>1)return p.unmatched(h,y);const k=x[0];if(k instanceof d.Report==0)return p.unmatched(h,y);if(k.state.path.length!==g.path.length){w.push({type:A.type,report:k});continue}if(k.code==="any.only"){for(const T of k.local.valids)v.add(T);continue}const[R,E]=k.code.split(".");E!=="base"?w.push({type:A.type,report:k}):k.code==="object.base"?v.add(k.local.type):v.add(R)}return w.length?w.length===1?{errors:w[0].report}:p.unmatched(h,y):{errors:y("alternatives.types",{types:[...v]})}},p.unmatched=function(h,y){const g=[];for(const v of h)g.push(...v.reports);return{errors:y("alternatives.match",d.details(g,{override:!1}))}}},8068:(s,i,a)=>{const o=a(375),c=a(7629),u=a(8160),f=a(6914);s.exports=c.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(l,d){return o(typeof l=="function","Method must be a function"),o(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:l,description:d}})},validate(l,d,{method:m}){try{return m(l,d)}catch(p){return d.error("any.custom",{error:p})}},args:["method","description"],multi:!0},messages:{method(l){return this.prefs({messages:l})}},shared:{method(l){o(u.isSchema(l)&&l._flags.id,"Schema must be a schema with an id");const d=this.clone();return d.$_terms.shared=d.$_terms.shared||[],d.$_terms.shared.push(l),d.$_mutateRegister(l),d}},warning:{method(l,d){return o(l&&typeof l=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:l,local:d},warn:!0})},validate:(l,d,{code:m,local:p})=>d.error(m,p),args:["code","local"],multi:!0}},modifiers:{keep(l,d=!0){l.keep=d},message(l,d){l.message=f.compile(d)},warn(l,d=!0){l.warn=d}},manifest:{build(l,d){for(const m in d){const p=d[m];if(["examples","externals","metas","notes","tags"].includes(m))for(const h of p)l=l[m.slice(0,-1)](h);else if(m!=="alterations")if(m!=="whens"){if(m==="shared")for(const h of p)l=l.shared(h)}else for(const h of p){const{ref:y,is:g,not:v,then:w,otherwise:x,concat:A}=h;l=A?l.concat(A):y?l.when(y,{is:g,not:v,then:w,otherwise:x,switch:h.switch,break:h.break}):l.when(g,{then:w,otherwise:x,break:h.break})}else{const h={};for(const{target:y,adjuster:g}of p)h[y]=g;l=l.alter(h)}}return l}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(s,i,a)=>{const o=a(375),c=a(9474),u=a(9621),f=a(8068),l=a(8160),d=a(3292),m={};s.exports=f.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(p,{schema:h,state:y,prefs:g}){if(!Array.isArray(p))return;const v=h.$_getRule("sort");return v?m.sort(h,p,v.args.options,y,g):void 0}},validate(p,{schema:h,error:y}){if(!Array.isArray(p)){if(h._flags.single){const g=[p];return g[l.symbols.arraySingle]=!0,{value:g}}return{errors:y("array.base")}}if(h.$_getRule("items")||h.$_terms.externals)return{value:p.slice()}},rules:{has:{method(p){p=this.$_compile(p,{appendPath:!0});const h=this.$_addRule({name:"has",args:{schema:p}});return h.$_mutateRegister(p),h},validate(p,{state:h,prefs:y,error:g},{schema:v}){const w=[p,...h.ancestors];for(let A=0;Athis.$_compile(p[y]),y,{append:!0});h.$_terms.items.push(g)}return h.$_mutateRebuild()},validate(p,{schema:h,error:y,state:g,prefs:v,errorsArray:w}){const x=h.$_terms._requireds.slice(),A=h.$_terms.ordered.slice(),k=[...h.$_terms._inclusions,...x],R=!p[l.symbols.arraySingle];delete p[l.symbols.arraySingle];const E=w();let T=p.length;for(let D=0;D="})}},ordered:{method(...p){l.verifyFlat(p,"ordered");const h=this.$_addRule("items");for(let y=0;ythis.$_compile(p[y]),y,{append:!0});m.validateSingle(g,h),h.$_mutateRegister(g),h.$_terms.ordered.push(g)}return h.$_mutateRebuild()}},single:{method(p){const h=p===void 0||!!p;return o(!h||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",h)}},sort:{method(p={}){l.assertOptions(p,["by","order"]);const h={order:p.order||"ascending"};return p.by&&(h.by=d.ref(p.by,{ancestor:0}),o(!h.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:h}})},validate(p,{error:h,state:y,prefs:g,schema:v},{options:w}){const{value:x,errors:A}=m.sort(v,p,w,y,g);if(A)return A;for(let k=0;knew Set(p)}},rebuild(p){p.$_terms._inclusions=[],p.$_terms._exclusions=[],p.$_terms._requireds=[];for(const h of p.$_terms.items)m.validateSingle(h,p),h._flags.presence==="required"?p.$_terms._requireds.push(h):h._flags.presence==="forbidden"?p.$_terms._exclusions.push(h):p.$_terms._inclusions.push(h);for(const h of p.$_terms.ordered)m.validateSingle(h,p)},manifest:{build:(p,h)=>(h.items&&(p=p.items(...h.items)),h.ordered&&(p=p.ordered(...h.ordered)),p)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),m.fillMissedErrors=function(p,h,y,g,v,w){const x=[];let A=0;for(const k of y){const R=k._flags.label;R?x.push(R):++A}x.length?A?h.push(p.$_createError("array.includesRequiredBoth",g,{knownMisses:x,unknownMisses:A},v,w)):h.push(p.$_createError("array.includesRequiredKnowns",g,{knownMisses:x},v,w)):h.push(p.$_createError("array.includesRequiredUnknowns",g,{unknownMisses:A},v,w))},m.fillOrderedErrors=function(p,h,y,g,v,w){const x=[];for(const A of y)A._flags.presence==="required"&&x.push(A);x.length&&m.fillMissedErrors(p,h,x,g,v,w)},m.fillDefault=function(p,h,y,g){const v=[];let w=!0;for(let x=p.length-1;x>=0;--x){const A=p[x],k=[h,...y.ancestors],R=A.$_validate(void 0,y.localize(y.path,k,A),g).value;if(w){if(R===void 0)continue;w=!1}v.unshift(R)}v.length&&h.push(...v)},m.fastSplice=function(p,h){let y=h;for(;y{let T=m.compare(R,E,x,A);if(T!==null||(y.by&&(R=y.by.resolve(R,g,v),E=y.by.resolve(E,g,v)),T=m.compare(R,E,x,A),T!==null))return T;const D=typeof R;if(D!==typeof E)throw p.$_createError("array.sort.mismatching",h,null,g,v);if(D!=="number"&&D!=="string")throw p.$_createError("array.sort.unsupported",h,{type:D},g,v);return D==="number"?(R-E)*w:R{const o=a(375),c=a(8068),u=a(8160),f=a(2036),l={isBool:function(d){return typeof d=="boolean"}};s.exports=c.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(d,{schema:m}){if(typeof d!="boolean"){if(typeof d=="string"){const p=m._flags.sensitive?d:d.toLowerCase();d=p==="true"||p!=="false"&&d}return typeof d!="boolean"&&(d=m.$_terms.truthy&&m.$_terms.truthy.has(d,null,null,!m._flags.sensitive)||(!m.$_terms.falsy||!m.$_terms.falsy.has(d,null,null,!m._flags.sensitive))&&d),{value:d}}},validate(d,{error:m}){if(typeof d!="boolean")return{value:d,errors:m("boolean.base")}},rules:{truthy:{method(...d){u.verifyFlat(d,"truthy");const m=this.clone();m.$_terms.truthy=m.$_terms.truthy||new f;for(let p=0;pd?1:0},string:{from:l.isBool,to:(d,m)=>d?"true":"false"}},manifest:{build:(d,m)=>(m.truthy&&(d=d.truthy(...m.truthy)),m.falsy&&(d=d.falsy(...m.falsy)),d)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f=a(3328),l={isDate:function(d){return d instanceof Date}};s.exports=c.extend({type:"date",coerce:{from:["number","string"],method:(d,{schema:m})=>({value:l.parse(d,m._flags.format)||d})},validate(d,{schema:m,error:p,prefs:h}){if(d instanceof Date&&!isNaN(d.getTime()))return;const y=m._flags.format;return h.convert&&y&&typeof d=="string"?{value:d,errors:p("date.format",{format:y})}:{value:d,errors:p("date.base")}},rules:{compare:{method:!1,validate(d,m,{date:p},{name:h,operator:y,args:g}){const v=p==="now"?Date.now():p.getTime();return u.compare(d.getTime(),v,y)?d:m.error("date."+h,{limit:g.date,value:d})},args:[{name:"date",ref:!0,normalize:d=>d==="now"?d:l.parse(d),assert:d=>d!==null,message:"must have a valid date format"}]},format:{method(d){return o(["iso","javascript","unix"].includes(d),"Unknown date format",d),this.$_setFlag("format",d)}},greater:{method(d){return this.$_addRule({name:"greater",method:"compare",args:{date:d},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(d){return this.$_addRule({name:"less",method:"compare",args:{date:d},operator:"<"})}},max:{method(d){return this.$_addRule({name:"max",method:"compare",args:{date:d},operator:"<="})}},min:{method(d){return this.$_addRule({name:"min",method:"compare",args:{date:d},operator:">="})}},timestamp:{method(d="javascript"){return o(["javascript","unix"].includes(d),'"type" must be one of "javascript, unix"'),this.format(d)}}},cast:{number:{from:l.isDate,to:(d,m)=>d.getTime()},string:{from:l.isDate,to:(d,{prefs:m})=>f.date(d,m)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),l.parse=function(d,m){if(d instanceof Date)return d;if(typeof d!="string"&&(isNaN(d)||!isFinite(d))||/^\s*$/.test(d))return null;if(m==="iso")return u.isIsoDate(d)?l.date(d.toString()):null;const p=d;if(typeof d=="string"&&/^[+-]?\d+(\.\d+)?$/.test(d)&&(d=parseFloat(d)),m){if(m==="javascript")return l.date(1*d);if(m==="unix")return l.date(1e3*d);if(typeof p=="string")return null}return l.date(d)},l.date=function(d){const m=new Date(d);return isNaN(m.getTime())?null:m}},390:(s,i,a)=>{const o=a(375),c=a(7824);s.exports=c.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:u}})},validate:(u,f,{n:l})=>u.length===l?u:f.error("function.arity",{n:l})},class:{method(){return this.$_addRule("class")},validate:(u,f)=>/^\s*class\s/.test(u.toString())?u:f.error("function.class",{value:u})},minArity:{method(u){return o(Number.isSafeInteger(u)&&u>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length>=l?u:f.error("function.minArity",{n:l})},maxArity:{method(u){return o(Number.isSafeInteger(u)&&u>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:u}})},validate:(u,f,{n:l})=>u.length<=l?u:f.error("function.maxArity",{n:l})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(s,i,a)=>{const o=a(978),c=a(375),u=a(8571),f=a(3652),l=a(8068),d=a(8160),m=a(3292),p=a(6354),h=a(6133),y=a(3328),g={renameDefaults:{alias:!1,multiple:!1,override:!1}};s.exports=l.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(v,w)=>v.keys(w),validate(v,{schema:w,error:x,state:A,prefs:k}){if(!v||typeof v!==w.$_property("typeof")||Array.isArray(v))return{value:v,errors:x("object.base",{type:w.$_property("typeof")})};if(!(w.$_terms.renames||w.$_terms.dependencies||w.$_terms.keys||w.$_terms.patterns||w.$_terms.externals))return;v=g.clone(v,k);const R=[];if(w.$_terms.renames&&!g.rename(w,v,A,k,R))return{value:v,errors:R};if(!w.$_terms.keys&&!w.$_terms.patterns&&!w.$_terms.dependencies)return{value:v,errors:R};const E=new Set(Object.keys(v));if(w.$_terms.keys){const T=[v,...A.ancestors];for(const D of w.$_terms.keys){const O=D.key,L=v[O];E.delete(O);const I=A.localize([...A.path,O],T,D),F=D.schema.$_validate(L,I,k);if(F.errors){if(k.abortEarly)return{value:v,errors:F.errors};F.value!==void 0&&(v[O]=F.value),R.push(...F.errors)}else D.schema._flags.result==="strip"||F.value===void 0&&L!==void 0?delete v[O]:F.value!==void 0&&(v[O]=F.value)}}if(E.size||w._flags._hasPatternMatch){const T=g.unknown(w,v,E,R,A,k);if(T)return T}if(w.$_terms.dependencies)for(const T of w.$_terms.dependencies){if(T.key!==null&&g.isPresent(T.options)(T.key.resolve(v,A,k,null,{shadow:!1}))===!1)continue;const D=g.dependencies[T.rel](w,T,v,A,k);if(D){const O=w.$_createError(D.code,v,D.context,A,k);if(k.abortEarly)return{value:v,errors:O};R.push(O)}}return{value:v,errors:R}},rules:{and:{method(...v){return d.verifyFlat(v,"and"),g.dependency(this,"and",null,v)}},append:{method(v){return v==null||Object.keys(v).length===0?this:this.keys(v)}},assert:{method(v,w,x){y.isTemplate(v)||(v=m.ref(v)),c(x===void 0||typeof x=="string","Message must be a string"),w=this.$_compile(w,{appendPath:!0});const A=this.$_addRule({name:"assert",args:{subject:v,schema:w,message:x}});return A.$_mutateRegister(v),A.$_mutateRegister(w),A},validate(v,{error:w,prefs:x,state:A},{subject:k,schema:R,message:E}){const T=k.resolve(v,A,x),D=h.isRef(k)?k.absolute(A):[];return R.$_match(T,A.localize(D,[v,...A.ancestors],R),x)?v:w("object.assert",{subject:k,message:E})},args:["subject","schema","message"],multi:!0},instance:{method(v,w){return c(typeof v=="function","constructor must be a function"),w=w||v.name,this.$_addRule({name:"instance",args:{constructor:v,name:w}})},validate:(v,w,{constructor:x,name:A})=>v instanceof x?v:w.error("object.instance",{type:A,value:v}),args:["constructor","name"]},keys:{method(v){c(v===void 0||typeof v=="object","Object schema must be a valid object"),c(!d.isSchema(v),"Object schema cannot be a joi schema");const w=this.clone();if(v)if(Object.keys(v).length){w.$_terms.keys=w.$_terms.keys?w.$_terms.keys.filter(x=>!v.hasOwnProperty(x.key)):new g.Keys;for(const x in v)d.tryWithPath(()=>w.$_terms.keys.push({key:x,schema:this.$_compile(v[x])}),x)}else w.$_terms.keys=new g.Keys;else w.$_terms.keys=null;return w.$_mutateRebuild()}},length:{method(v){return this.$_addRule({name:"length",args:{limit:v},operator:"="})},validate:(v,w,{limit:x},{name:A,operator:k,args:R})=>d.compare(Object.keys(v).length,x,k)?v:w.error("object."+A,{limit:R.limit,value:v}),args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"}]},max:{method(v){return this.$_addRule({name:"max",method:"length",args:{limit:v},operator:"<="})}},min:{method(v){return this.$_addRule({name:"min",method:"length",args:{limit:v},operator:">="})}},nand:{method(...v){return d.verifyFlat(v,"nand"),g.dependency(this,"nand",null,v)}},or:{method(...v){return d.verifyFlat(v,"or"),g.dependency(this,"or",null,v)}},oxor:{method(...v){return g.dependency(this,"oxor",null,v)}},pattern:{method(v,w,x={}){const A=v instanceof RegExp;A||(v=this.$_compile(v,{appendPath:!0})),c(w!==void 0,"Invalid rule"),d.assertOptions(x,["fallthrough","matches"]),A&&c(!v.flags.includes("g")&&!v.flags.includes("y"),"pattern should not use global or sticky mode"),w=this.$_compile(w,{appendPath:!0});const k=this.clone();k.$_terms.patterns=k.$_terms.patterns||[];const R={[A?"regex":"schema"]:v,rule:w};return x.matches&&(R.matches=this.$_compile(x.matches),R.matches.type!=="array"&&(R.matches=R.matches.$_root.array().items(R.matches)),k.$_mutateRegister(R.matches),k.$_setFlag("_hasPatternMatch",!0,{clone:!1})),x.fallthrough&&(R.fallthrough=!0),k.$_terms.patterns.push(R),k.$_mutateRegister(w),k}},ref:{method(){return this.$_addRule("ref")},validate:(v,w)=>h.isRef(v)?v:w.error("object.refType",{value:v})},regex:{method(){return this.$_addRule("regex")},validate:(v,w)=>v instanceof RegExp?v:w.error("object.regex",{value:v})},rename:{method(v,w,x={}){c(typeof v=="string"||v instanceof RegExp,"Rename missing the from argument"),c(typeof w=="string"||w instanceof y,"Invalid rename to argument"),c(w!==v,"Cannot rename key to same name:",v),d.assertOptions(x,["alias","ignoreUndefined","override","multiple"]);const A=this.clone();A.$_terms.renames=A.$_terms.renames||[];for(const k of A.$_terms.renames)c(k.from!==v,"Cannot rename the same key multiple times");return w instanceof y&&A.$_mutateRegister(w),A.$_terms.renames.push({from:v,to:w,options:o(g.renameDefaults,x)}),A}},schema:{method(v="any"){return this.$_addRule({name:"schema",args:{type:v}})},validate:(v,w,{type:x})=>!d.isSchema(v)||x!=="any"&&v.type!==x?w.error("object.schema",{type:x}):v},unknown:{method(v){return this.$_setFlag("unknown",v!==!1)}},with:{method(v,w,x={}){return g.dependency(this,"with",v,w,x)}},without:{method(v,w,x={}){return g.dependency(this,"without",v,w,x)}},xor:{method(...v){return d.verifyFlat(v,"xor"),g.dependency(this,"xor",null,v)}}},overrides:{default(v,w){return v===void 0&&(v=d.symbols.deepDefault),this.$_parent("default",v,w)}},rebuild(v){if(v.$_terms.keys){const w=new f.Sorter;for(const x of v.$_terms.keys)d.tryWithPath(()=>w.add(x,{after:x.schema.$_rootReferences(),group:x.key}),x.key);v.$_terms.keys=new g.Keys(...w.nodes)}},manifest:{build(v,w){if(w.keys&&(v=v.keys(w.keys)),w.dependencies)for(const{rel:x,key:A=null,peers:k,options:R}of w.dependencies)v=g.dependency(v,x,A,k,R);if(w.patterns)for(const{regex:x,schema:A,rule:k,fallthrough:R,matches:E}of w.patterns)v=v.pattern(x||A,k,{fallthrough:R,matches:E});if(w.renames)for(const{from:x,to:A,options:k}of w.renames)v=v.rename(x,A,k);return v}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),g.clone=function(v,w){if(typeof v=="object"){if(w.nonEnumerables)return u(v,{shallow:!0});const A=Object.create(Object.getPrototypeOf(v));return Object.assign(A,v),A}const x=function(...A){return v.apply(this,A)};return x.prototype=u(v.prototype),Object.defineProperty(x,"name",{value:v.name,writable:!1}),Object.defineProperty(x,"length",{value:v.length,writable:!1}),Object.assign(x,v),x},g.dependency=function(v,w,x,A,k){c(x===null||typeof x=="string",w,"key must be a strings"),k||(k=A.length>1&&typeof A[A.length-1]=="object"?A.pop():{}),d.assertOptions(k,["separator","isPresent"]),A=[].concat(A);const R=d.default(k.separator,"."),E=[];for(const D of A)c(typeof D=="string",w,"peers must be strings"),E.push(m.ref(D,{separator:R,ancestor:0,prefix:!1}));x!==null&&(x=m.ref(x,{separator:R,ancestor:0,prefix:!1}));const T=v.clone();return T.$_terms.dependencies=T.$_terms.dependencies||[],T.$_terms.dependencies.push(new g.Dependency(w,x,E,A,k)),T},g.dependencies={and(v,w,x,A,k){const R=[],E=[],T=w.peers.length,D=g.isPresent(w.options);for(const O of w.peers)D(O.resolve(x,A,k,null,{shadow:!1}))===!1?R.push(O.key):E.push(O.key);if(R.length!==T&&E.length!==T)return{code:"object.and",context:{present:E,presentWithLabels:g.keysToLabels(v,E),missing:R,missingWithLabels:g.keysToLabels(v,R)}}},nand(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const O of w.peers)E(O.resolve(x,A,k,null,{shadow:!1}))&&R.push(O.key);if(R.length!==w.peers.length)return;const T=w.paths[0],D=w.paths.slice(1);return{code:"object.nand",context:{main:T,mainWithLabel:g.keysToLabels(v,T),peers:D,peersWithLabels:g.keysToLabels(v,D)}}},or(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)}}},oxor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(!R.length||R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.oxor",context:T}},with(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},without(v,w,x,A,k){const R=g.isPresent(w.options);for(const E of w.peers)if(R(E.resolve(x,A,k,null,{shadow:!1})))return{code:"object.without",context:{main:w.key.key,mainWithLabel:g.keysToLabels(v,w.key.key),peer:E.key,peerWithLabel:g.keysToLabels(v,E.key)}}},xor(v,w,x,A,k){const R=[],E=g.isPresent(w.options);for(const D of w.peers)E(D.resolve(x,A,k,null,{shadow:!1}))&&R.push(D.key);if(R.length===1)return;const T={peers:w.paths,peersWithLabels:g.keysToLabels(v,w.paths)};return R.length===0?{code:"object.missing",context:T}:(T.present=R,T.presentWithLabels=g.keysToLabels(v,R),{code:"object.xor",context:T})}},g.keysToLabels=function(v,w){return Array.isArray(w)?w.map(x=>v.$_mapLabels(x)):v.$_mapLabels(w)},g.isPresent=function(v){return typeof v.isPresent=="function"?v.isPresent:w=>w!==void 0},g.rename=function(v,w,x,A,k){const R={};for(const E of v.$_terms.renames){const T=[],D=typeof E.from!="string";if(D)for(const O in w){if(w[O]===void 0&&E.options.ignoreUndefined||O===E.to)continue;const L=E.from.exec(O);L&&T.push({from:O,to:E.to,match:L})}else!Object.prototype.hasOwnProperty.call(w,E.from)||w[E.from]===void 0&&E.options.ignoreUndefined||T.push(E);for(const O of T){const L=O.from;let I=O.to;if(I instanceof y&&(I=I.render(w,x,A,O.match)),L!==I){if(!E.options.multiple&&R[I]&&(k.push(v.$_createError("object.rename.multiple",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly)||Object.prototype.hasOwnProperty.call(w,I)&&!E.options.override&&!R[I]&&(k.push(v.$_createError("object.rename.override",w,{from:L,to:I,pattern:D},x,A)),A.abortEarly))return!1;w[L]===void 0?delete w[I]:w[I]=w[L],R[I]=!0,E.options.alias||delete w[L]}}}return!0},g.unknown=function(v,w,x,A,k,R){if(v.$_terms.patterns){let E=!1;const T=v.$_terms.patterns.map(O=>{if(O.matches)return E=!0,[]}),D=[w,...k.ancestors];for(const O of x){const L=w[O],I=[...k.path,O];for(let F=0;F{const o=a(375),c=a(8068),u=a(8160),f=a(3292),l=a(6354),d={};s.exports=c.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(m,p)=>m.ref(p),validate(m,{schema:p,state:h,prefs:y}){o(p.$_terms.link,"Uninitialized link schema");const g=d.generate(p,m,h,y),v=p.$_terms.link[0].ref;return g.$_validate(m,h.nest(g,`link:${v.display}:${g.type}`),y)},generate:(m,p,h,y)=>d.generate(m,p,h,y),rules:{ref:{method(m){o(!this.$_terms.link,"Cannot reinitialize schema"),m=f.ref(m),o(m.type==="value"||m.type==="local","Invalid reference type:",m.type),o(m.type==="local"||m.ancestor==="root"||m.ancestor>0,"Link cannot reference itself");const p=this.clone();return p.$_terms.link=[{ref:m}],p}},relative:{method(m=!0){return this.$_setFlag("relative",m)}}},overrides:{concat(m){o(this.$_terms.link,"Uninitialized link schema"),o(u.isSchema(m),"Invalid schema object"),o(m.type!=="link","Cannot merge type link with another link");const p=this.clone();return p.$_terms.whens||(p.$_terms.whens=[]),p.$_terms.whens.push({concat:m}),p.$_mutateRebuild()}},manifest:{build:(m,p)=>(o(p.link,"Invalid link description missing link"),m.ref(p.link))}}),d.generate=function(m,p,h,y){let g=h.mainstay.links.get(m);if(g)return g._generate(p,h,y).schema;const v=m.$_terms.link[0].ref,{perspective:w,path:x}=d.perspective(v,h);d.assert(w,"which is outside of schema boundaries",v,m,h,y);try{g=x.length?w.$_reach(x):w}catch{d.assert(!1,"to non-existing schema",v,m,h,y)}return d.assert(g.type!=="link","which is another link",v,m,h,y),m._flags.relative||h.mainstay.links.set(m,g),g._generate(p,h,y).schema},d.perspective=function(m,p){if(m.type==="local"){for(const{schema:h,key:y}of p.schemas){if((h._flags.id||y)===m.path[0])return{perspective:h,path:m.path.slice(1)};if(h.$_terms.shared){for(const g of h.$_terms.shared)if(g._flags.id===m.path[0])return{perspective:g,path:m.path.slice(1)}}}return{perspective:null,path:null}}return m.ancestor==="root"?{perspective:p.schemas[p.schemas.length-1].schema,path:m.path}:{perspective:p.schemas[m.ancestor]&&p.schemas[m.ancestor].schema,path:m.path}},d.assert=function(m,p,h,y,g,v){m||o(!1,`"${l.label(y._flags,g,v)}" contains link reference "${h.display}" ${p}`)}},3832:(s,i,a)=>{const o=a(375),c=a(8068),u=a(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(l){const d=l.toString(),m=d.indexOf("."),p=d.indexOf("e");return(m<0?0:(p<0?d.length:p)-m-1)+(p<0?0:Math.max(0,-parseInt(d.slice(p+1))))}};s.exports=c.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(l,{schema:d,error:m}){if(!l.match(f.numberRx))return;l=l.trim();const p={value:parseFloat(l)};if(p.value===0&&(p.value=0),!d._flags.unsafe)if(l.match(/e/i)){if(f.extractSignificantDigits(l)!==f.extractSignificantDigits(String(p.value)))return p.errors=m("number.unsafe"),p}else{const h=p.value.toString();if(h.match(/e/i))return p;if(h!==f.normalizeDecimal(l))return p.errors=m("number.unsafe"),p}return p}},validate(l,{schema:d,error:m,prefs:p}){if(l===1/0||l===-1/0)return{value:l,errors:m("number.infinity")};if(!u.isNumber(l))return{value:l,errors:m("number.base")};const h={value:l};if(p.convert){const y=d.$_getRule("precision");if(y){const g=Math.pow(10,y.args.limit);h.value=Math.round(h.value*g)/g}}return h.value===0&&(h.value=0),!d._flags.unsafe&&(l>Number.MAX_SAFE_INTEGER||lu.compare(l,m,h)?l:d.error("number."+p,{limit:y.limit,value:l}),args:[{name:"limit",ref:!0,assert:u.isNumber,message:"must be a number"}]},greater:{method(l){return this.$_addRule({name:"greater",method:"compare",args:{limit:l},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(l,d)=>Math.trunc(l)-l==0?l:d.error("number.integer")},less:{method(l){return this.$_addRule({name:"less",method:"compare",args:{limit:l},operator:"<"})}},max:{method(l){return this.$_addRule({name:"max",method:"compare",args:{limit:l},operator:"<="})}},min:{method(l){return this.$_addRule({name:"min",method:"compare",args:{limit:l},operator:">="})}},multiple:{method(l){const d=typeof l=="number"?f.decimalPlaces(l):null,m=Math.pow(10,d);return this.$_addRule({name:"multiple",args:{base:l,baseDecimalPlace:d,pfactor:m}})},validate:(l,d,{base:m,baseDecimalPlace:p,pfactor:h},y)=>f.decimalPlaces(l)>p?d.error("number.multiple",{multiple:y.args.base,value:l}):Math.round(h*l)%Math.round(h*m)==0?l:d.error("number.multiple",{multiple:y.args.base,value:l}),args:[{name:"base",ref:!0,assert:l=>typeof l=="number"&&isFinite(l)&&l>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(l,d)=>Number.isSafeInteger(l)&&l>=0&&l<=65535?l:d.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(l){return o(Number.isSafeInteger(l),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:l}})},validate(l,d,{limit:m}){const p=l.toString().match(f.precisionRx);return Math.max((p[1]?p[1].length:0)-(p[2]?parseInt(p[2],10):0),0)<=m?l:d.error("number.precision",{limit:m,value:l})},convert:!0},sign:{method(l){return o(["negative","positive"].includes(l),"Invalid sign",l),this.$_addRule({name:"sign",args:{sign:l}})},validate:(l,d,{sign:m})=>m==="negative"&&l<0||m==="positive"&&l>0?l:d.error(`number.${m}`)},unsafe:{method(l=!0){return o(typeof l=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",l)}}},cast:{string:{from:l=>typeof l=="number",to:(l,d)=>l.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),f.extractSignificantDigits=function(l){return l.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(l){return(l=l.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&l.endsWith("0")&&(l=l.replace(/0+$/,"")),l==="-0"?"0":l}},8966:(s,i,a)=>{const o=a(7824);s.exports=o.extend({type:"object",cast:{map:{from:c=>c&&typeof c=="object",to:(c,u)=>new Map(Object.entries(c))}}})},7417:(s,i,a)=>{const o=a(375),c=a(5380),u=a(1745),f=a(9959),l=a(6064),d=a(9926),m=a(5752),p=a(8068),h=a(8160),y={tlds:d instanceof Set&&{tlds:{allow:d,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:f.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};s.exports=p.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(g,{schema:v,state:w,prefs:x}){const A=v.$_getRule("normalize");A&&(g=g.normalize(A.args.form));const k=v.$_getRule("case");k&&(g=k.args.direction==="upper"?g.toLocaleUpperCase():g.toLocaleLowerCase());const R=v.$_getRule("trim");if(R&&R.args.enabled&&(g=g.trim()),v.$_terms.replacements)for(const T of v.$_terms.replacements)g=g.replace(T.pattern,T.replacement);const E=v.$_getRule("hex");if(E&&E.args.options.byteAligned&&g.length%2!=0&&(g=`0${g}`),v.$_getRule("isoDate")){const T=y.isoDate(g);T&&(g=T)}if(v._flags.truncate){const T=v.$_getRule("max");if(T){let D=T.args.limit;if(h.isResolvable(D)&&(D=D.resolve(g,w,x),!h.limit(D)))return{value:g,errors:v.$_createError("any.ref",D,{ref:T.args.limit,arg:"limit",reason:"must be a positive integer"},w,x)};g=g.slice(0,D)}}return{value:g}}},validate(g,{schema:v,error:w}){if(typeof g!="string")return{value:g,errors:w("string.base")};if(g===""){const x=v.$_getRule("min");return x&&x.args.limit===0?void 0:{value:g,errors:w("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(g,v)=>/^[a-zA-Z0-9]+$/.test(g)?g:v.error("string.alphanum")},base64:{method(g={}){return h.assertOptions(g,["paddingRequired","urlSafe"]),g={urlSafe:!1,paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof g.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:g}})},validate:(g,v,{options:w})=>y.base64Regex[w.paddingRequired][w.urlSafe].test(g)?g:v.error("string.base64")},case:{method(g){return o(["lower","upper"].includes(g),"Invalid case:",g),this.$_addRule({name:"case",args:{direction:g}})},validate:(g,v,{direction:w})=>w==="lower"&&g===g.toLocaleLowerCase()||w==="upper"&&g===g.toLocaleUpperCase()?g:v.error(`string.${w}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(g,v){let w=g.length,x=0,A=1;for(;w--;){const k=g.charAt(w)*A;x+=k-9*(k>9),A^=3}return x>0&&x%10==0?g:v.error("string.creditCard")}},dataUri:{method(g={}){return h.assertOptions(g,["paddingRequired"]),g={paddingRequired:!0,...g},o(typeof g.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:g}})},validate(g,v,{options:w}){const x=g.match(y.dataUriRegex);return x&&(!x[2]||x[2]!=="base64"||y.base64Regex[w.paddingRequired].false.test(x[3]))?g:v.error("string.dataUri")}},domain:{method(g){g&&h.assertOptions(g,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const v=y.addressOptions(g);return this.$_addRule({name:"domain",args:{options:g},address:v})},validate:(g,v,w,{address:x})=>c.isValid(g,x)?g:v.error("string.domain")},email:{method(g={}){h.assertOptions(g,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(g.multiple===void 0||typeof g.multiple=="boolean","multiple option must be an boolean");const v=y.addressOptions(g),w=new RegExp(`\\s*[${g.separator?l(g.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:g},regex:w,address:v})},validate(g,v,{options:w},{regex:x,address:A}){const k=w.multiple?g.split(x):[g],R=[];for(const E of k)u.isValid(E,A)||R.push(E);return R.length?v.error("string.email",{value:g,invalids:R}):g}},guid:{alias:"uuid",method(g={}){h.assertOptions(g,["version","separator"]);let v="";if(g.version){const A=[].concat(g.version);o(A.length>=1,"version must have at least 1 valid version specified");const k=new Set;for(let R=0;R(w.prefix==="optional"?y.hexRegex.withOptionalPrefix:w.prefix===!0?y.hexRegex.withPrefix:y.hexRegex.withoutPrefix).test(g)?w.byteAligned&&g.length%2!=0?v.error("string.hexAlign"):g:v.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(g,v)=>c.isValid(g,{minDomainSegments:1})||y.ipRegex.test(g)?g:v.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(g={}){h.assertOptions(g,["cidr","version"]);const{cidr:v,versions:w,regex:x}=f.regex(g),A=g.version?w:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:v,version:A}},regex:x})},validate:(g,v,{options:w},{regex:x})=>x.test(g)?g:w.version?v.error("string.ipVersion",{value:g,cidr:w.cidr,version:w.version}):v.error("string.ip",{value:g,cidr:w.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(g,{error:v})=>y.isoDate(g)?g:v("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(g,v)=>y.isoDurationRegex.test(g)?g:v.error("string.isoDuration")},length:{method(g,v){return y.length(this,"length",g,"=",v)},validate(g,v,{limit:w,encoding:x},{name:A,operator:k,args:R}){const E=!x&&g.length;return h.compare(E,w,k)?g:v.error("string."+A,{limit:R.limit,value:g,encoding:x})},args:[{name:"limit",ref:!0,assert:h.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(g,v){return y.length(this,"max",g,"<=",v)},args:["limit","encoding"]},min:{method(g,v){return y.length(this,"min",g,">=",v)},args:["limit","encoding"]},normalize:{method(g="NFC"){return o(y.normalizationForms.includes(g),"normalization form must be one of "+y.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:g}})},validate:(g,{error:v},{form:w})=>g===g.normalize(w)?g:v("string.normalize",{value:g,form:w}),convert:!0},pattern:{alias:"regex",method(g,v={}){o(g instanceof RegExp,"regex must be a RegExp"),o(!g.flags.includes("g")&&!g.flags.includes("y"),"regex should not use global or sticky mode"),typeof v=="string"&&(v={name:v}),h.assertOptions(v,["invert","name"]);const w=["string.pattern",v.invert?".invert":"",v.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:g,options:v},errorCode:w})},validate:(g,v,{regex:w,options:x},{errorCode:A})=>w.test(g)^x.invert?g:v.error(A,{name:x.name,regex:w,value:g}),args:["regex","options"],multi:!0},replace:{method(g,v){typeof g=="string"&&(g=new RegExp(l(g),"g")),o(g instanceof RegExp,"pattern must be a RegExp"),o(typeof v=="string","replacement must be a String");const w=this.clone();return w.$_terms.replacements||(w.$_terms.replacements=[]),w.$_terms.replacements.push({pattern:g,replacement:v}),w}},token:{method(){return this.$_addRule("token")},validate:(g,v)=>/^\w+$/.test(g)?g:v.error("string.token")},trim:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:g}})},validate:(g,v,{enabled:w})=>w&&g!==g.trim()?v.error("string.trim"):g,convert:!0},truncate:{method(g=!0){return o(typeof g=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",g)}},uppercase:{method(){return this.case("upper")}},uri:{method(g={}){h.assertOptions(g,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),g.domain&&h.assertOptions(g.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:v,scheme:w}=m.regex(g),x=g.domain?y.addressOptions(g.domain):null;return this.$_addRule({name:"uri",args:{options:g},regex:v,domain:x,scheme:w})},validate(g,v,{options:w},{regex:x,domain:A,scheme:k}){if(["http:/","https:/"].includes(g))return v.error("string.uri");let R=x.exec(g);if(!R&&v.prefs.convert&&w.encodeUri){const E=encodeURI(g);R=x.exec(E),R&&(g=E)}if(R){const E=R[1]||R[2];return!A||w.allowRelative&&!E||c.isValid(E,A)?g:v.error("string.domain",{value:E})}return w.relativeOnly?v.error("string.uriRelativeOnly"):w.scheme?v.error("string.uriCustomScheme",{scheme:k,value:g}):v.error("string.uri")}}},manifest:{build(g,v){if(v.replacements)for(const{pattern:w,replacement:x}of v.replacements)g=g.replace(w,x);return g}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),y.addressOptions=function(g){if(!g)return y.tlds||g;if(o(g.minDomainSegments===void 0||Number.isSafeInteger(g.minDomainSegments)&&g.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(g.maxDomainSegments===void 0||Number.isSafeInteger(g.maxDomainSegments)&&g.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),g.tlds===!1)return g;if(g.tlds===!0||g.tlds===void 0)return o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds);o(typeof g.tlds=="object","tlds must be true, false, or an object");const v=g.tlds.deny;if(v)return Array.isArray(v)&&(g=Object.assign({},g,{tlds:{deny:new Set(v)}})),o(g.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!g.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),y.validateTlds(g.tlds.deny,"tlds.deny"),g;const w=g.tlds.allow;return w?w===!0?(o(y.tlds,"Built-in TLD list disabled"),Object.assign({},g,y.tlds)):(Array.isArray(w)&&(g=Object.assign({},g,{tlds:{allow:new Set(w)}})),o(g.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),y.validateTlds(g.tlds.allow,"tlds.allow"),g):g},y.validateTlds=function(g,v){for(const w of g)o(c.isValid(w,{minDomainSegments:1,maxDomainSegments:1}),`${v} must contain valid top level domain names`)},y.isoDate=function(g){if(!h.isIsoDate(g))return null;/.*T.*[+-]\d\d$/.test(g)&&(g+="00");const v=new Date(g);return isNaN(v.getTime())?null:v.toISOString()},y.length=function(g,v,w,x,A){return o(!A||!1,"Invalid encoding:",A),g.$_addRule({name:v,method:"length",args:{limit:w,encoding:A},operator:x})}},8826:(s,i,a)=>{const o=a(375),c=a(8068),u={};u.Map=class extends Map{slice(){return new u.Map(this)}},s.exports=c.extend({type:"symbol",terms:{map:{init:new u.Map}},coerce:{method(f,{schema:l,error:d}){const m=l.$_terms.map.get(f);return m&&(f=m),l._flags.only&&typeof f!="symbol"?{value:f,errors:d("symbol.map",{map:l.$_terms.map})}:{value:f}}},validate(f,{error:l}){if(typeof f!="symbol")return{value:f,errors:l("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const l=this.clone(),d=[];for(const m of f){o(m&&m[Symbol.iterator],"Entry must be an iterable");const[p,h]=m;o(typeof p!="object"&&typeof p!="function"&&typeof p!="symbol","Key must not be of type object, function, or Symbol"),o(typeof h=="symbol","Value must be a Symbol"),l.$_terms.map.set(p,h),d.push(h)}return l.valid(...d)}}},manifest:{build:(f,l)=>(l.map&&(f=f.map(l.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(s,i,a)=>{const o=a(375),c=a(8571),u=a(738),f=a(9621),l=a(8160),d=a(6354),m=a(493),p={result:Symbol("result")};i.entry=function(h,y,g){let v=l.defaults;g&&(o(g.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(g.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),v=l.preferences(l.defaults,g));const w=p.entry(h,y,v);o(!w.mainstay.externals.length,"Schema with external rules must use validateAsync()");const x={value:w.value};return w.error&&(x.error=w.error),w.mainstay.warnings.length&&(x.warning=d.details(w.mainstay.warnings)),w.mainstay.debug&&(x.debug=w.mainstay.debug),w.mainstay.artifacts&&(x.artifacts=w.mainstay.artifacts),x},i.entryAsync=async function(h,y,g){let v=l.defaults;g&&(v=l.preferences(l.defaults,g));const w=p.entry(h,y,v),x=w.mainstay;if(w.error)throw x.debug&&(w.error.debug=x.debug),w.error;if(x.externals.length){let k=w.value;const R=[];for(const E of x.externals){const T=E.state.path,D=E.schema.type==="link"?x.links.get(E.schema):null;let O,L,I=k;const F=T.length?[k]:[],U=T.length?f(h,T):h;if(T.length){O=T[T.length-1];let Y=k;for(const V of T.slice(0,-1))Y=Y[V],F.unshift(Y);L=F[0],I=L[O]}try{const Y=(H,ee)=>(D||E.schema).$_createError(H,I,ee,E.state,v),V=await E.method(I,{schema:E.schema,linked:D,state:E.state,prefs:g,original:U,error:Y,errorsArray:p.errorsArray,warn:(H,ee)=>x.warnings.push((D||E.schema).$_createError(H,I,ee,E.state,v)),message:(H,ee)=>(D||E.schema).$_createError("external",I,ee,E.state,v,{messages:H})});if(V===void 0||V===I)continue;if(V instanceof d.Report){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(V),v.abortEarly)break;continue}if(Array.isArray(V)&&V[l.symbols.errors]){if(x.tracer.log(E.schema,E.state,"rule","external","error"),R.push(...V),v.abortEarly)break;continue}L?(x.tracer.value(E.state,"rule",I,V,"external"),L[O]=V):(x.tracer.value(E.state,"rule",k,V,"external"),k=V)}catch(Y){throw v.errors.label&&(Y.message+=` (${E.label})`),Y}}if(w.value=k,R.length)throw w.error=d.process(R,h,v),x.debug&&(w.error.debug=x.debug),w.error}if(!v.warnings&&!v.debug&&!v.artifacts)return w.value;const A={value:w.value};return x.warnings.length&&(A.warning=d.details(x.warnings)),x.debug&&(A.debug=x.debug),x.artifacts&&(A.artifacts=x.artifacts),A},p.Mainstay=class{constructor(h,y,g){this.externals=[],this.warnings=[],this.tracer=h,this.debug=y,this.links=g,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const h=this._snapshots.pop();this.externals=h.externals,this.warnings=h.warnings}commit(){this._snapshots.pop()}},p.entry=function(h,y,g){const{tracer:v,cleanup:w}=p.tracer(y,g),x=g.debug?[]:null,A=y._ids._schemaChain?new Map:null,k=new p.Mainstay(v,x,A),R=y._ids._schemaChain?[{schema:y}]:null,E=new m([],[],{mainstay:k,schemas:R}),T=i.validate(h,y,E,g);w&&y.$_root.untrace();const D=d.process(T.errors,h,g);return{value:T.value,error:D,mainstay:k}},p.tracer=function(h,y){return h.$_root._tracer?{tracer:h.$_root._tracer._register(h)}:y.debug?(o(h.$_root.trace,"Debug mode not supported"),{tracer:h.$_root.trace()._register(h),cleanup:!0}):{tracer:p.ignore}},i.validate=function(h,y,g,v,w={}){if(y.$_terms.whens&&(y=y._generate(h,g,v).schema),y._preferences&&(v=p.prefs(y,v)),y._cache&&v.cache){const D=y._cache.get(h);if(g.mainstay.tracer.debug(g,"validate","cached",!!D),D)return D}const x=(D,O,L)=>y.$_createError(D,h,O,L||g,v),A={original:h,prefs:v,schema:y,state:g,error:x,errorsArray:p.errorsArray,warn:(D,O,L)=>g.mainstay.warnings.push(x(D,O,L)),message:(D,O)=>y.$_createError("custom",h,O,g,v,{messages:D})};g.mainstay.tracer.entry(y,g);const k=y._definition;if(k.prepare&&h!==void 0&&v.convert){const D=k.prepare(h,A);if(D){if(g.mainstay.tracer.value(g,"prepare",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}if(k.coerce&&h!==void 0&&v.convert&&(!k.coerce.from||k.coerce.from.includes(typeof h))){const D=k.coerce.method(h,A);if(D){if(g.mainstay.tracer.value(g,"coerced",h,D.value),D.errors)return p.finalize(D.value,[].concat(D.errors),A);h=D.value}}const R=y._flags.empty;R&&R.$_match(p.trim(h,y),g.nest(R),l.defaults)&&(g.mainstay.tracer.value(g,"empty",h,void 0),h=void 0);const E=w.presence||y._flags.presence||(y._flags._endedSwitch?null:v.presence);if(h===void 0){if(E==="forbidden")return p.finalize(h,null,A);if(E==="required")return p.finalize(h,[y.$_createError("any.required",h,null,g,v)],A);if(E==="optional"){if(y._flags.default!==l.symbols.deepDefault)return p.finalize(h,null,A);g.mainstay.tracer.value(g,"default",h,{}),h={}}}else if(E==="forbidden")return p.finalize(h,[y.$_createError("any.unknown",h,null,g,v)],A);const T=[];if(y._valids){const D=y._valids.get(h,g,v,y._flags.insensitive);if(D)return v.convert&&(g.mainstay.tracer.value(g,"valids",h,D.value),h=D.value),g.mainstay.tracer.filter(y,g,"valid",D),p.finalize(h,null,A);if(y._flags.only){const O=y.$_createError("any.only",h,{valids:y._valids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);T.push(O)}}if(y._invalids){const D=y._invalids.get(h,g,v,y._flags.insensitive);if(D){g.mainstay.tracer.filter(y,g,"invalid",D);const O=y.$_createError("any.invalid",h,{invalids:y._invalids.values({display:!0})},g,v);if(v.abortEarly)return p.finalize(h,[O],A);T.push(O)}}if(k.validate){const D=k.validate(h,A);if(D&&(g.mainstay.tracer.value(g,"base",h,D.value),h=D.value,D.errors)){if(!Array.isArray(D.errors))return T.push(D.errors),p.finalize(h,T,A);if(D.errors.length)return T.push(...D.errors),p.finalize(h,T,A)}}return y._rules.length?p.rules(h,T,A):p.finalize(h,T,A)},p.rules=function(h,y,g){const{schema:v,state:w,prefs:x}=g;for(const A of v._rules){const k=v._definition.rules[A.method];if(k.convert&&x.convert){w.mainstay.tracer.log(v,w,"rule",A.name,"full");continue}let R,E=A.args;if(A._resolve.length){E=Object.assign({},E);for(const D of A._resolve){const O=k.argsByName.get(D),L=E[D].resolve(h,w,x),I=O.normalize?O.normalize(L):L,F=l.validateArg(I,null,O);if(F){R=v.$_createError("any.ref",L,{arg:D,ref:E[D],reason:F},w,x);break}E[D]=I}}R=R||k.validate(h,g,E,A);const T=p.rule(R,A);if(T.errors){if(w.mainstay.tracer.log(v,w,"rule",A.name,"error"),A.warn){w.mainstay.warnings.push(...T.errors);continue}if(x.abortEarly)return p.finalize(h,T.errors,g);y.push(...T.errors)}else w.mainstay.tracer.log(v,w,"rule",A.name,"pass"),w.mainstay.tracer.value(w,"rule",h,T.value,A.name),h=T.value}return p.finalize(h,y,g)},p.rule=function(h,y){return h instanceof d.Report?(p.error(h,y),{errors:[h],value:null}):Array.isArray(h)&&h[l.symbols.errors]?(h.forEach(g=>p.error(g,y)),{errors:h,value:null}):{errors:null,value:h}},p.error=function(h,y){return y.message&&h._setTemplate(y.message),h},p.finalize=function(h,y,g){y=y||[];const{schema:v,state:w,prefs:x}=g;if(y.length){const k=p.default("failover",void 0,y,g);k!==void 0&&(w.mainstay.tracer.value(w,"failover",h,k),h=k,y=[])}if(y.length&&v._flags.error)if(typeof v._flags.error=="function"){y=v._flags.error(y),Array.isArray(y)||(y=[y]);for(const k of y)o(k instanceof Error||k instanceof d.Report,"error() must return an Error object")}else y=[v._flags.error];if(h===void 0){const k=p.default("default",h,y,g);w.mainstay.tracer.value(w,"default",h,k),h=k}if(v._flags.cast&&h!==void 0){const k=v._definition.cast[v._flags.cast];if(k.from(h)){const R=k.to(h,g);w.mainstay.tracer.value(w,"cast",h,R,v._flags.cast),h=R}}if(v.$_terms.externals&&x.externals&&x._externals!==!1)for(const{method:k}of v.$_terms.externals)w.mainstay.externals.push({method:k,schema:v,state:w,label:d.label(v._flags,w,x)});const A={value:h,errors:y.length?y:null};return v._flags.result&&(A.value=v._flags.result==="strip"?void 0:g.original,w.mainstay.tracer.value(w,v._flags.result,h,A.value),w.shadow(h,v._flags.result)),v._cache&&x.cache!==!1&&!v._refs.length&&v._cache.set(g.original,A),h===void 0||A.errors||v._flags.artifact===void 0||(w.mainstay.artifacts=w.mainstay.artifacts||new Map,w.mainstay.artifacts.has(v._flags.artifact)||w.mainstay.artifacts.set(v._flags.artifact,[]),w.mainstay.artifacts.get(v._flags.artifact).push(w.path)),A},p.prefs=function(h,y){const g=y===l.defaults;return g&&h._preferences[l.symbols.prefs]?h._preferences[l.symbols.prefs]:(y=l.preferences(y,h._preferences),g&&(h._preferences[l.symbols.prefs]=y),y)},p.default=function(h,y,g,v){const{schema:w,state:x,prefs:A}=v,k=w._flags[h];if(A.noDefaults||k===void 0)return y;if(x.mainstay.tracer.log(w,x,"rule",h,"full"),!k)return k;if(typeof k=="function"){const R=k.length?[c(x.ancestors[0]),v]:[];try{return k(...R)}catch(E){return void g.push(w.$_createError(`any.${h}`,null,{error:E},x,A))}}return typeof k!="object"?k:k[l.symbols.literal]?k.literal:l.isResolvable(k)?k.resolve(y,x,A):c(k)},p.trim=function(h,y){if(typeof h!="string")return h;const g=y.$_getRule("trim");return g&&g.args.enabled?h.trim():h},p.ignore={active:!1,debug:u,entry:u,filter:u,log:u,resolve:u,value:u},p.errorsArray=function(){const h=[];return h[l.symbols.errors]=!0,h}},2036:(s,i,a)=>{const o=a(375),c=a(9474),u=a(8160),f={};s.exports=f.Values=class{constructor(l,d){this._values=new Set(l),this._refs=new Set(d),this._lowercase=f.lowercases(l),this._override=!1}get length(){return this._values.size+this._refs.size}add(l,d){u.isResolvable(l)?this._refs.has(l)||(this._refs.add(l),d&&d.register(l)):this.has(l,null,null,!1)||(this._values.add(l),typeof l=="string"&&this._lowercase.set(l.toLowerCase(),l))}static merge(l,d,m){if(l=l||new f.Values,d){if(d._override)return d.clone();for(const p of[...d._values,...d._refs])l.add(p)}if(m)for(const p of[...m._values,...m._refs])l.remove(p);return l.length?l:null}remove(l){u.isResolvable(l)?this._refs.delete(l):(this._values.delete(l),typeof l=="string"&&this._lowercase.delete(l.toLowerCase()))}has(l,d,m,p){return!!this.get(l,d,m,p)}get(l,d,m,p){if(!this.length)return!1;if(this._values.has(l))return{value:l};if(typeof l=="string"&&l&&p){const h=this._lowercase.get(l.toLowerCase());if(h)return{value:h}}if(!this._refs.size&&typeof l!="object")return!1;if(typeof l=="object"){for(const h of this._values)if(c(h,l))return{value:h}}if(d)for(const h of this._refs){const y=h.resolve(l,d,m,null,{in:!0});if(y===void 0)continue;const g=h.in&&typeof y=="object"?Array.isArray(y)?y:Object.keys(y):[y];for(const v of g)if(typeof v==typeof l){if(p&&l&&typeof l=="string"){if(v.toLowerCase()===l.toLowerCase())return{value:v,ref:h}}else if(c(v,l))return{value:v,ref:h}}}return!1}override(){this._override=!0}values(l){if(l&&l.display){const d=[];for(const m of[...this._values,...this._refs])m!==void 0&&d.push(m);return d}return Array.from([...this._values,...this._refs])}clone(){const l=new f.Values(this._values,this._refs);return l._override=this._override,l}concat(l){o(!l._override,"Cannot concat override set of values");const d=new f.Values([...this._values,...l._values],[...this._refs,...l._refs]);return d._override=this._override,d}describe(){const l=[];this._override&&l.push({override:!0});for(const d of this._values.values())l.push(d&&typeof d=="object"?{value:d}:d);for(const d of this._refs.values())l.push(d.describe());return l}},f.Values.prototype[u.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(l){const d=new Map;if(l)for(const m of l)typeof m=="string"&&d.set(m.toLowerCase(),m);return d}},978:(s,i,a)=>{const o=a(375),c=a(8571),u=a(1687),f=a(9621),l={};s.exports=function(d,m,p={}){if(o(d&&typeof d=="object","Invalid defaults value: must be an object"),o(!m||m===!0||typeof m=="object","Invalid source value: must be true, falsy or an object"),o(typeof p=="object","Invalid options: must be an object"),!m)return null;if(p.shallow)return l.applyToDefaultsWithShallow(d,m,p);const h=c(d);if(m===!0)return h;const y=p.nullOverride!==void 0&&p.nullOverride;return u(h,m,{nullOverride:y,mergeArrays:!1})},l.applyToDefaultsWithShallow=function(d,m,p){const h=p.shallow;o(Array.isArray(h),"Invalid keys");const y=new Map,g=m===!0?null:new Set;for(let x of h){x=Array.isArray(x)?x:x.split(".");const A=f(d,x);A&&typeof A=="object"?y.set(A,g&&f(m,x)||A):g&&g.add(x)}const v=c(d,{},y);if(!g)return v;for(const x of g)l.reachCopy(v,m,x);const w=p.nullOverride!==void 0&&p.nullOverride;return u(v,m,{nullOverride:w,mergeArrays:!1})},l.reachCopy=function(d,m,p){for(const g of p){if(!(g in m))return;const v=m[g];if(typeof v!="object"||v===null)return;m=v}const h=m;let y=d;for(let g=0;g{const o=a(7916);s.exports=function(c,...u){if(!c)throw u.length===1&&u[0]instanceof Error?u[0]:new o(u)}},8571:(s,i,a)=>{const o=a(9621),c=a(4277),u=a(7043),f={needsProtoHack:new Set([c.set,c.map,c.weakSet,c.weakMap])};s.exports=f.clone=function(l,d={},m=null){if(typeof l!="object"||l===null)return l;let p=f.clone,h=m;if(d.shallow){if(d.shallow!==!0)return f.cloneWithShallow(l,d);p=w=>w}else if(h){const w=h.get(l);if(w)return w}else h=new Map;const y=c.getInternalProto(l);if(y===c.buffer)return!1;if(y===c.date)return new Date(l.getTime());if(y===c.regex)return new RegExp(l);const g=f.base(l,y,d);if(g===l)return l;if(h&&h.set(l,g),y===c.set)for(const w of l)g.add(p(w,d,h));else if(y===c.map)for(const[w,x]of l)g.set(w,p(x,d,h));const v=u.keys(l,d);for(const w of v){if(w==="__proto__")continue;if(y===c.array&&w==="length"){g.length=l.length;continue}const x=Object.getOwnPropertyDescriptor(l,w);x?x.get||x.set?Object.defineProperty(g,w,x):x.enumerable?g[w]=p(l[w],d,h):Object.defineProperty(g,w,{enumerable:!1,writable:!0,configurable:!0,value:p(l[w],d,h)}):Object.defineProperty(g,w,{enumerable:!0,writable:!0,configurable:!0,value:p(l[w],d,h)})}return g},f.cloneWithShallow=function(l,d){const m=d.shallow;(d=Object.assign({},d)).shallow=!1;const p=new Map;for(const h of m){const y=o(l,h);typeof y!="object"&&typeof y!="function"||p.set(y,y)}return f.clone(l,d,p)},f.base=function(l,d,m){if(m.prototype===!1)return f.needsProtoHack.has(d)?new d.constructor:d===c.array?[]:{};const p=Object.getPrototypeOf(l);if(p&&p.isImmutable)return l;if(d===c.array){const h=[];return p!==d&&Object.setPrototypeOf(h,p),h}if(f.needsProtoHack.has(d)){const h=new p.constructor;return p!==d&&Object.setPrototypeOf(h,p),h}return Object.create(p)}},9474:(s,i,a)=>{const o=a(4277),c={mismatched:null};s.exports=function(u,f,l){return l=Object.assign({prototype:!0},l),!!c.isDeepEqual(u,f,l,[])},c.isDeepEqual=function(u,f,l,d){if(u===f)return u!==0||1/u==1/f;const m=typeof u;if(m!==typeof f||u===null||f===null)return!1;if(m==="function"){if(!l.deepFunction||u.toString()!==f.toString())return!1}else if(m!=="object")return u!=u&&f!=f;const p=c.getSharedType(u,f,!!l.prototype);switch(p){case o.buffer:return!1;case o.promise:return u===f;case o.regex:return u.toString()===f.toString();case c.mismatched:return!1}for(let h=d.length-1;h>=0;--h)if(d[h].isSame(u,f))return!0;d.push(new c.SeenEntry(u,f));try{return!!c.isDeepEqualObj(p,u,f,l,d)}finally{d.pop()}},c.getSharedType=function(u,f,l){if(l)return Object.getPrototypeOf(u)!==Object.getPrototypeOf(f)?c.mismatched:o.getInternalProto(u);const d=o.getInternalProto(u);return d!==o.getInternalProto(f)?c.mismatched:d},c.valueOf=function(u){const f=u.valueOf;if(f===void 0)return u;try{return f.call(u)}catch(l){return l}},c.hasOwnEnumerableProperty=function(u,f){return Object.prototype.propertyIsEnumerable.call(u,f)},c.isSetSimpleEqual=function(u,f){for(const l of Set.prototype.values.call(u))if(!Set.prototype.has.call(f,l))return!1;return!0},c.isDeepEqualObj=function(u,f,l,d,m){const{isDeepEqual:p,valueOf:h,hasOwnEnumerableProperty:y}=c,{keys:g,getOwnPropertySymbols:v}=Object;if(u===o.array){if(!d.part){if(f.length!==l.length)return!1;for(let R=0;R{const o=a(8761);s.exports=class extends Error{constructor(c){super(c.filter(u=>u!=="").map(u=>typeof u=="string"?u:u instanceof Error?u.message:o(u)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,i.assert)}}},5277:s=>{const i={};s.exports=function(a){if(!a)return"";let o="";for(let c=0;c=256?"&#"+a+";":`&#x${a.toString(16).padStart(2,"0")};`)},i.isSafe=function(a){return i.safeCharCodes.has(a)},i.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),i.safeCharCodes=function(){const a=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&a.add(o);return a}()},6064:s=>{s.exports=function(i){return i.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:s=>{s.exports=function(){}},1687:(s,i,a)=>{const o=a(375),c=a(8571),u=a(7043),f={};s.exports=f.merge=function(l,d,m){if(o(l&&typeof l=="object","Invalid target value: must be an object"),o(d==null||typeof d=="object","Invalid source value: must be null, undefined, or an object"),!d)return l;if(m=Object.assign({nullOverride:!0,mergeArrays:!0},m),Array.isArray(d)){o(Array.isArray(l),"Cannot merge array onto an object"),m.mergeArrays||(l.length=0);for(let h=0;h{const o=a(375),c={};s.exports=function(u,f,l){if(f===!1||f==null)return u;typeof(l=l||{})=="string"&&(l={separator:l});const d=Array.isArray(f);o(!d||!l.separator,"Separator option is not valid for array-based chain");const m=d?f:f.split(l.separator||".");let p=u;for(let h=0;h{s.exports=function(...i){try{return JSON.stringify(...i)}catch(a){return"[Cannot display object: "+a.message+"]"}}},4277:(s,i)=>{const a={};i=s.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},a.typeMap=new Map([["[object Error]",i.error],["[object Map]",i.map],["[object Promise]",i.promise],["[object Set]",i.set],["[object WeakMap]",i.weakMap],["[object WeakSet]",i.weakSet]]),i.getInternalProto=function(o){if(Array.isArray(o))return i.array;if(o instanceof Date)return i.date;if(o instanceof RegExp)return i.regex;if(o instanceof Error)return i.error;const c=Object.prototype.toString.call(o);return a.typeMap.get(c)||i.generic}},7043:(s,i)=>{i.keys=function(a,o={}){return o.symbols!==!1?Reflect.ownKeys(a):Object.getOwnPropertyNames(a)}},3652:(s,i,a)=>{const o=a(375),c={};i.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(u,f){const l=[].concat((f=f||{}).before||[]),d=[].concat(f.after||[]),m=f.group||"?",p=f.sort||0;o(!l.includes(m),`Item cannot come before itself: ${m}`),o(!l.includes("?"),"Item cannot come before unassociated items"),o(!d.includes(m),`Item cannot come after itself: ${m}`),o(!d.includes("?"),"Item cannot come after unassociated items"),Array.isArray(u)||(u=[u]);for(const h of u){const y={seq:this._items.length,sort:p,before:l,after:d,group:m,node:h};this._items.push(y)}if(!f.manual){const h=this._sort();o(h,"item",m!=="?"?`added into group ${m}`:"","created a dependencies error")}return this.nodes}merge(u){Array.isArray(u)||(u=[u]);for(const l of u)if(l)for(const d of l._items)this._items.push(Object.assign({},d));this._items.sort(c.mergeSort);for(let l=0;lu.sort===f.sort?0:u.sort{const o=a(443),c=a(2178),u={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:o.URL||URL};i.analyze=function(f,l={}){if(!f)return c.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return c.code("DOMAIN_TOO_LONG");if(u.nonAsciiRx.test(f)){if(l.allowUnicode===!1)return c.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(u.domainControlRx.test(f))return c.code("DOMAIN_INVALID_CHARS");f=u.punycode(f),l.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const d=l.minDomainSegments||u.minDomainSegments,m=f.split(".");if(m.lengthl.maxDomainSegments)return c.code("DOMAIN_SEGMENTS_COUNT_MAX");const p=l.tlds;if(p){const h=m[m.length-1].toLowerCase();if(p.deny&&p.deny.has(h)||p.allow&&!p.allow.has(h))return c.code("DOMAIN_FORBIDDEN_TLDS")}for(let h=0;h63)return c.code("DOMAIN_LONG_SEGMENT");if(h{const o=a(9848),c=a(5380),u=a(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};i.analyze=function(l,d){return f.email(l,d)},i.isValid=function(l,d){return!f.email(l,d)},f.email=function(l,d={}){if(typeof l!="string")throw new Error("Invalid input: email must be a string");if(!l)return u.code("EMPTY_STRING");const m=!f.nonAsciiRx.test(l);if(!m){if(d.allowUnicode===!1)return u.code("FORBIDDEN_UNICODE");l=l.normalize("NFC")}const p=l.split("@");if(p.length!==2)return p.length>2?u.code("MULTIPLE_AT_CHAR"):u.code("MISSING_AT_CHAR");const[h,y]=p;if(!h)return u.code("EMPTY_LOCAL");if(!d.ignoreLength){if(l.length>254)return u.code("ADDRESS_TOO_LONG");if(f.encoder.encode(h).length>64)return u.code("LOCAL_TOO_LONG")}return f.local(h,m)||c.analyze(y,d)},f.local=function(l,d){const m=l.split(".");for(const p of m){if(!p.length)return u.code("EMPTY_LOCAL_SEGMENT");if(d){if(!f.atextRx.test(p))return u.code("INVALID_LOCAL_CHARS")}else for(const h of p){if(f.atextRx.test(h))continue;const y=f.binary(h);if(!f.atomRx.test(y))return u.code("INVALID_LOCAL_CHARS")}}},f.binary=function(l){return Array.from(f.encoder.encode(l)).map(d=>String.fromCharCode(d)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(s,i)=>{i.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},i.code=function(a){return{code:a,error:i.codes[a]}}},9959:(s,i,a)=>{const o=a(375),c=a(5752);i.regex=function(u={}){o(u.cidr===void 0||typeof u.cidr=="string","options.cidr must be a string");const f=u.cidr?u.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(u.version===void 0||typeof u.version=="string"||Array.isArray(u.version),"options.version must be a string or an array of string");let l=u.version||["ipv4","ipv6","ipvfuture"];Array.isArray(l)||(l=[l]),o(l.length>=1,"options.version must have at least 1 version specified");for(let p=0;p{if(f==="forbidden")return c.ip[p];const h=`\\/${p==="ipv4"?c.ip.v4Cidr:c.ip.v6Cidr}`;return f==="required"?`${c.ip[p]}${h}`:`${c.ip[p]}(?:${h})?`}).join("|")})`,m=new RegExp(`^${d}$`);return{cidr:f,versions:l,regex:m,raw:d}}},5752:(s,i,a)=>{const o=a(375),c=a(6064),u={generate:function(){const f={},l="\\dA-Fa-f",d="["+l+"]",m="\\w-\\.~",p="!\\$&'\\(\\)\\*\\+,;=",h="%"+l,y=m+h+p+":@",g="["+y+"]",v="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+v+"\\.){3}"+v;const w=d+"{1,4}",x="(?:"+w+":"+w+"|"+f.ipv4address+")",A="(?:"+w+":){6}"+x,k="::(?:"+w+":){5}"+x,R="(?:"+w+")?::(?:"+w+":){4}"+x,E="(?:(?:"+w+":){0,1}"+w+")?::(?:"+w+":){3}"+x,T="(?:(?:"+w+":){0,2}"+w+")?::(?:"+w+":){2}"+x,D="(?:(?:"+w+":){0,3}"+w+")?::"+w+":"+x,O="(?:(?:"+w+":){0,4}"+w+")?::"+x,L="(?:(?:"+w+":){0,5}"+w+")?::"+w,I="(?:(?:"+w+":){0,6}"+w+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+A+"|"+k+"|"+R+"|"+E+"|"+T+"|"+D+"|"+O+"|"+L+"|"+I+")",f.ipvFuture="v"+d+"+\\.["+m+p+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const F="["+m+h+p+":]*",U="["+m+h+p+"]{1,255}",Y="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+U+")",V="(?:"+F+"@)?"+Y+"(?::\\d*)?",H="(?:"+F+"@)?("+Y+")(?::\\d*)?",ee=g+"*",re=g+"+",X="(?:\\/"+ee+")*",q="\\/(?:"+re+X+")?",K=re+X,Z="["+m+h+p+"@]+"+X,ue="(?:\\/\\/\\/"+ee+X+")";return f.hierPart="(?:(?:\\/\\/"+V+X+")|"+q+"|"+K+"|"+ue+")",f.hierPartCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+K+")",f.relativeRef="(?:(?:\\/\\/"+V+X+")|"+q+"|"+Z+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+H+X+")|"+q+"|"+Z+"|)",f.query="["+y+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+y+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+y+"\\/\\?]*",f}};u.rfc3986=u.generate(),i.ip={v4Cidr:u.rfc3986.ipv4Cidr,v6Cidr:u.rfc3986.ipv6Cidr,ipv4:u.rfc3986.ipv4address,ipv6:u.rfc3986.ipv6address,ipvfuture:u.rfc3986.ipvFuture},u.createRegex=function(f){const l=u.rfc3986,d="(?:\\?"+(f.allowQuerySquareBrackets?l.queryWithSquareBrackets:l.query)+")?(?:#"+l.fragment+")?",m=f.domain?l.relativeRefCapture:l.relativeRef;if(f.relativeOnly)return u.wrap(m+d);let p="";if(f.scheme){o(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const g=[].concat(f.scheme);o(g.length>=1,"scheme must have at least 1 scheme specified");const v=[];for(let w=0;w{const a={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};i.Parser=class{constructor(o,c={}){if(!c[a.settings]&&c.constants)for(const u in c.constants){const f=c.constants[u];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${u} contains invalid ${typeof f} value type`)}this.settings=c[a.settings]?c:Object.assign({[a.settings]:!0,constants:{},functions:{}},c),this.single=null,this._parts=null,this._parse(o)}_parse(o){let c=[],u="",f=0,l=!1;const d=p=>{if(f)throw new Error("Formula missing closing parenthesis");const h=c.length?c[c.length-1]:null;if(l||u||p){if(h&&h.type==="reference"&&p===")")return h.type="function",h.value=this._subFormula(u,h.value),void(u="");if(p===")"){const y=new i.Parser(u,this.settings);c.push({type:"segment",value:y})}else if(l){if(l==="]")return c.push({type:"reference",value:u}),void(u="");c.push({type:"literal",value:u})}else if(a.operatorCharacters.includes(u))h&&h.type==="operator"&&a.operators.includes(h.value+u)?h.value+=u:c.push({type:"operator",value:u});else if(u.match(a.numberRx))c.push({type:"constant",value:parseFloat(u)});else if(this.settings.constants[u]!==void 0)c.push({type:"constant",value:this.settings.constants[u]});else{if(!u.match(a.tokenRx))throw new Error(`Formula contains invalid token: ${u}`);c.push({type:"reference",value:u})}u=""}};for(const p of o)l?p===l?(d(),l=!1):u+=p:f?p==="("?(u+=p,++f):p===")"?(--f,f?u+=p:d(p)):u+=p:p in a.literals?l=a.literals[p]:p==="("?(d(),++f):a.operatorCharacters.includes(p)?(d(),u=p,d()):p!==" "?u+=p:d();d(),c=c.map((p,h)=>p.type!=="operator"||p.value!=="-"||h&&c[h-1].type!=="operator"?p:{type:"operator",value:"n"});let m=!1;for(const p of c){if(p.type==="operator"){if(a.operatorsPrefix.includes(p.value))continue;if(!m)throw new Error("Formula contains an operator in invalid position");if(!a.operators.includes(p.value))throw new Error(`Formula contains an unknown operator ${p.value}`)}else if(m)throw new Error("Formula missing expected operator");m=!m}if(!m)throw new Error("Formula contains invalid trailing operator");c.length===1&&["reference","literal","constant"].includes(c[0].type)&&(this.single={type:c[0].type==="reference"?"reference":"value",value:c[0].value}),this._parts=c.map(p=>{if(p.type==="operator")return a.operatorsPrefix.includes(p.value)?p:p.value;if(p.type!=="reference")return p.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(p.value))throw new Error(`Formula contains invalid reference ${p.value}`);return this.settings.reference?this.settings.reference(p.value):a.reference(p.value)})}_subFormula(o,c){const u=this.settings.functions[c];if(typeof u!="function")throw new Error(`Formula contains unknown function ${c}`);let f=[];if(o){let l="",d=0,m=!1;const p=()=>{if(!l)throw new Error(`Formula contains function ${c} with invalid arguments ${o}`);f.push(l),l=""};for(let h=0;hnew i.Parser(l,this.settings)),function(l){const d=[];for(const m of f)d.push(m.evaluate(l));return u.call(l,...d)}}evaluate(o){const c=this._parts.slice();for(let u=c.length-2;u>=0;--u){const f=c[u];if(f&&f.type==="operator"){const l=c[u+1];c.splice(u+1,1);const d=a.evaluate(l,o);c[u]=a.single(f.value,d)}}return a.operatorsOrder.forEach(u=>{for(let f=1;f":return c>u;case">=":return c>=u;case"==":return c===u;case"!=":return c!==u;case"&&":return c&&u;case"||":return c||u}return null},a.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:s=>{s.exports=JSON.parse('{"version":"17.13.3"}')}},r={},function s(i){var a=r[i];if(a!==void 0)return a.exports;var o=r[i]={exports:{}};return n[i](o,o.exports,s),o.exports}(5107);var n,r})})(dZ);var DIe=dZ.exports;const z4=Dd(DIe),NIe=()=>{const t=_.useContext(NQ);if(t===void 0)throw new Error("useDataSource must be used within a DataSourceProvider");return t},OIe=()=>{const t=NIe();return{useSubmitIncidence:e=>{const{mutateOptions:n={}}=e||{};return Cde({mutationFn:r=>t.createOne({resource:"support",data:r}),...n})}}},MIe=z4.object({incidence:z4.string().min(10).required().messages({"string.empty":"Debe escribir algo antes de enviar","string.min":"El texto es demasiado corto. Debe tener al menos 10 caracteres","string.max":"El texto es demasiado largo.","any.required":"La descripción es requerida"})});function LIe(){const[t,e]=_.useState(!1),[n,r]=_.useState(!1),{toast:s}=LX(),{useSubmitIncidence:i}=OIe(),a=pAe({mode:"onBlur",resolver:kIe(MIe),defaultValues:{incidence:""}}),{handleSubmit:o,watch:c,reset:u}=a,f=c("incidence"),{mutate:l}=i({mutateOptions:{onSuccess:()=>{s({title:"Incidencia enviada",description:"La incidencia se ha enviado correctamente",variant:"success"}),e(!1),u()},onError:()=>{s({title:"Error en el envío",description:"No se ha podido enviar la incidencia correctamente. Por favor, inténtalo de nuevo.",variant:"destructive"})}}}),d=async h=>{l(h)},m=()=>{f.trim()?r(!0):(e(!1),u())},p=()=>{r(!1),e(!1),u()};return P.jsxs(P.Fragment,{children:[P.jsxs(fxe,{open:t,onOpenChange:e,children:[P.jsx(hxe,{asChild:!0,children:P.jsxs(no,{variant:"outline",size:"icon",className:"overflow-hidden rounded-full bg-primary text-primary-foreground",onClick:()=>e(!0),children:[P.jsx(_fe,{className:"w-5 h-5"}),P.jsx("span",{className:"sr-only",children:"Abrir ventana de soporte"})]})}),P.jsxs(D8,{className:"sm:max-w-xl",children:[P.jsxs(N8,{className:"mb-2",children:[P.jsx(M8,{children:tr("support.modal.title")}),P.jsx(L8,{children:tr("support.modal.subtitle")})]}),P.jsx(vAe,{...a,children:P.jsxs("form",{onSubmit:o(d),className:"space-y-4",children:[P.jsx(CIe,{name:"incidence",placeholder:"Describe la incidencia aquí...",className:"min-h-96"}),P.jsxs(O8,{children:[P.jsx(no,{type:"button",variant:"outline",onClick:m,children:"Cancelar"}),P.jsx(no,{type:"submit",children:"Enviar incidencia"})]})]})})]})]}),P.jsx(rW,{open:n,onOpenChange:r,children:P.jsxs(AL,{children:[P.jsxs(RL,{children:[P.jsx(TL,{children:"¿Estás seguro de que quieres cancelar?"}),P.jsx(kL,{children:"Has escrito texto en el campo de descripción. Si cierras la ventana, perderás los cambios no guardados."})]}),P.jsxs(PL,{children:[P.jsx(NL,{onClick:()=>r(!1),children:"Volver al formulario"}),P.jsx(DL,{onClick:p,children:"Sí, cerrar"})]})]})})]})}var IIe={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const $Ie=Dd(IIe);var FIe=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function B4(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],($Ie[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var r=t.indexOf("-->");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var s=new RegExp(FIe),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var a=i[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var jIe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,zIe=/^\s*$/,BIe=Object.create(null);function fZ(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(fZ,"")+"";case"comment":return t+""}}var UIe={parse:function(t,e){e||(e={}),e.components||(e.components=BIe);var n,r=[],s=[],i=-1,a=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");r.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(jIe,function(c,u){if(a){if(c!=="")return;a=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("");return{type:"comment",comment:r!==-1?t.slice(4,r):""}}for(var s=new RegExp(UIe),i=null;(i=s.exec(t))!==null;)if(i[0].trim())if(i[1]){var a=i[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],s.lastIndex--}else i[2]&&(e.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return e}var HIe=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,VIe=/^\s*$/,WIe=Object.create(null);function gZ(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?function(n){var r=[];for(var s in n)r.push(s+'="'+n[s]+'"');return r.length?" "+r.join(" "):""}(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(gZ,"")+"";case"comment":return t+""}}var GIe={parse:function(t,e){e||(e={}),e.components||(e.components=WIe);var n,r=[],s=[],i=-1,a=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");r.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(HIe,function(c,u){if(a){if(c!=="")return;a=!1}var f,l=c.charAt(1)!=="/",d=c.startsWith("